[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

grouping help (...probably)

Subject: grouping help (...probably)
From: Jan Limpens <jan.limpens@xxxxxxxxx>
Date: Tue, 28 Sep 2004 14:36:16 -0300
bar.xml
hi people,

i've got (type of) this xml:

<root>

<foo>
<bar xml:lang="de">1de</bar>
</foo>

<foo>
<bar xml:lang="en">2en</bar>
<bar xml:lang="de">2de</bar>
</foo>

<foo>
<bar xml:lang="en">3en</bar>
</foo>

<foo>
<bar xml:lang="en">4en</bar>
<bar xml:lang="de">4de</bar>
</foo>

</root>

and an xsl that allows to choose a language, and, if there is no item
in the selected language, falls back to the default language, which
usually is English.

	<xsl:template match="foo">
		<xsl:choose>
			<xsl:when test="bar[@lang=$selectedLanguage]">
				<xsl:apply-templates select="bar[@xml:lang=$selectedLanguage]"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates select="bar[@xml:lang=$defaultLanguage]"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

but now i need only the first 3 (a param) entries, so that when de is
the selected language i get:
1de - 2de - 3 en
an when it's en
2en - 3en - 4en

and I don't know how to do this. I somehow get the feeling that
grouping might be involved, but have no clue how to really make it
work...

anyone can help me?

-- 
Jan
http://www.limpens.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.