LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject: Re: dispalying node vlaues
From: Gavin Tong <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Thu, 1 Feb 2001 16:45:38 -0800
Content-Type:text/plain
Parts/Attachments:
Parts/Attachments

text/plain (29 lines)


John, thanks alot for the prompt response.  I did some more reading and
ended up using a variable for the count function.  I included the code below
just in case anyone else is interested, I got it from here:
http://zvon.org/xxl/XSLTutorial/Books/Book1/bookInOne.html#chapter5
Thanks again,
Gavin Tong

<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >

<xsl:variable name="totalChapters" select='count(//chapter)'/>

<xsl:template match="/">
<TABLE>

<xsl:for-each select="//chapter">
<TR><TD>
<xsl:value-of select="."/>
<xsl:text> (</xsl:text>
<xsl:value-of select="position()"/>
<xsl:text> /</xsl:text>
<xsl:value-of select="$totalChapters"/>
<xsl:text> )</xsl:text>

</TD></TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager