This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 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

----------------------------------------------------------------
To subscribe or unsubscribe from this elist use the subscription
manager: <http://lists.oasis-open.org/ob/adm.pl>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]