OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: DOCBOOK-APPS: XSL Stylesheet Problems passing formal.procedures toprocedure template


> From: Eric Baudais <baudais@okstate.edu>
> 
> I am writing a customization layer for Norm's
> stylesheets v1.45 and am running 
> into a problem with the procedure template.  My XSL stylesheet is:
> 
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 version='1.0'
>                 xmlns="http://www.w3.org/TR/xhtml1/transitional"
>                 exclude-result-prefixes="#default">
> 
> <!-- Importing the Norman Walsh's stylesheet as the basis. -->
> <xsl:import href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh-1.45/html/docbook.xsl"/>
> 
> <xsl:template match="procedure">
>   <xsl:choose>
>   <xsl:when test="@role='informal'">
>      <xsl:call-template name="a.procedure">
> 	   <xsl:with-param name="formal.procedures" select="0"/>
>      </xsl:call-template>
>   </xsl:when>
>   <xsl:otherwise>
>     <xsl:call-template name="a.procedure"/>
>   </xsl:otherwise>
>   </xsl:choose>
> </xsl:template>
> 
> <xsl:template name="a.procedure">
> 
>   <div class="{name(.)}">
>     <xsl:call-template name="anchor"/>
>     <xsl:if test="title or $formal.procedures !=0">
>       <xsl:call-template name="formal.object.heading"/>
>     </xsl:if>
>     <xsl:apply-templates select="*[local-name()!='step']"/>
>     <ol>
>      <xsl:attribute name="type">
>         <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
>       </xsl:attribute>
>       <xsl:apply-templates select="step"/>
> 	</ol>
> 	</div>
> 
> </xsl:template>
> 
> </xsl:stylesheet>

A parameter has to be declared in the template
before you can pass a value to it.  So you
just need:

<xsl:template name="a.procedure">
  <xsl:param name="formal.procedures" select="0"/>
  [rest of template]

This puts the parameter "formal.procedures" in scope this
that template.  This  statement also gives you an
opportunity to set a default value, which is overridden
when you call the template "with-param".

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC