Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - position() within nested xsl:for-each >Thread Next - Re: position() within nested xsl:for-each Re: position() within nested xsl:for-eachTo: NULL Date: 8/4/2005 8:56:00 PM Hi,
Tempore 22:16:51, die Thursday 04 August 2005 AD, hinc in foro {microsoft.public.xsl} scripsit Grinder <grinder@n...>:
> Which yields output like this:
>
> 1. First show of first season
> 2. Second show of first season
> 3. Third show of first season
> 1. First show of second season
> 2. Second show of second season
>
> How can I get the numbering to be relative to the entire document,
> instead of the <Season>, like this:
>
> 1. First show of first season
> 2. Second show of first season
> 3. Third show of first season
> 4. First show of second season
> 5. Second show of second season
>
> Thanks for your time and consideration.
In theory, you could use something like this:
<xsl:for-each select="Season">
<xsl:for-each select="Episode">
<xsl:number count="Episode" level="any"/>
<xsl:text>. </xsl:text>
<xsl:value-of select="Title"/>
<br/>
</xsl:for-each>
</xsl:for-each>
But why would you? It seems you're outputting HTML and that language offers you semantics to create ordered lists. The user agent will render them as a numbered lists.
<ol>
<xsl:for-each select="Season">
<xsl:for-each select="Episode">
<li><xsl:value-of select="Title"/></li>
</xsl:for-each>
</xsl:for-each>
</ol>
regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Spread the wiki (http://www.wikipedia.org)
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
