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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: DOCBOOK: apply-templates within for-each???


In your example code, you have:

select=""

I think you want:

select="."

Nothing to process otherwise.  8^)

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

On Thu, Feb 06, 2003 at 02:08:42PM -0700, Ethan Vaughn wrote:
> I'm trying to apply templates within a for-each but the apply-templates never 
> gets executed. The call-template directive works, but then the HTML i'm 
> creating (the anchor tag in this case) gets stuck up in <step> rather than 
> down where the <xref> is. Here' s the code:
> 
> <xsl:template match="step">
> 	<xsl:variable name="stepnum">
> 		<xsl:number level="single" count="step" format="1"/>
> 	</xsl:variable>
> 	<xsl:variable name="stepid" select="@id"/>
> 
> 	<p><hr align="left"/><br/>
> 	<!-- create html anchor if id exists //-->
> 	<xsl:if test="@id">
> 		<a name="{@id}"/>
> 						
> 		<!-- process all <xrefs> pointed to this <step> //-->
> 		<xsl:for-each select="//xref[@linkend=$stepid]">
> 			<xsl:apply-templates select="" mode="step">
> 				<xsl:with-param name="linktext" select="$stepnum"/>
> 			</xsl:apply-templates>
> 		</xsl:for-each>				
> 		
> 	</xsl:if>
> 	<span class="step"><xsl:value-of select="$stepnum"/>. </span>
> 	<xsl:apply-templates/>
> 	</p>
> </xsl:template>
> 
> <xsl:template match="xref" mode="step">
> 	<xsl:param name="linktext" select="LINK"/>
> 
> 	<a href="#{@linkend}">
> 	Step <xsl:value-of select="$linktext"/>
> 	</a>
> </xsl:template>
> 
> 
> The goal here is to have the number generated in the processing of <step> to 
> be passed to the <xref> to be used as the html anchor tag text.  I'm hoping 
> to globally process all <xref> pointing to this step.
> 
> I've thought about doing the anchor tag inside the <xref> template, but have 
> no way of getting the step's numerical value.
> 
> Any ideas??
> 
> --------------------------------------
> Ethan Vaughn
> ethan@gurulabs.com
> --------------------------------------

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


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


Powered by eList eXpress LLC