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

Re: XSL Unique values

Subject: Re: XSL Unique values
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Wed, 31 Aug 2005 22:59:23 +0200
xsl unique
Hi,

Tempore 22:40:37, die 08/31/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Prakash R <raghits@xxxxxxxxx>:

Is there any way using XSL I can get the unique
metadata[@fieldid=3]/fieldvalues for each product. I
know I can do it across the entire XML doc. In this
example for product(name=shirt) it would be RG,LN and
SM , product(name=t-shirt) it would be AA,BB,CC,DD,EE.
I want to be able to get these separately for each
product and iterate through it within the product if
possible.

Close examination of a working sample (such as below) is always the best method to learn in my opinion...


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

<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:key name="metadata" match="metadata"
	use="concat(generate-id(ancestor::product),@fieldid,fieldvalue)"/>

<xsl:template match="product">
<xsl:value-of select="name"/>:

<xsl:for-each select=".//metadata[generate-id(
	key('metadata',concat(generate-id(current()),3,.))[1])=generate-id()]">
	<xsl:value-of select="fieldvalue"/>-
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>



regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
B+Numquam mores quos extuli referoB;  - Seneca , Ad Lucilium I, 7

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.