Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: position() within nested xsl:for-each

From: "Joris Gillis" <roac@-------.-->
To: 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)


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent