|
-
Jul 16th, 2004, 05:39 AM
#1
Thread Starter
Addicted Member
Distinct values from XML using stylesheet
Hi,
I have an XML file as below:
Code:
<xml>
<data>
<row>1</row>
<item>xxx</item>
</data>
<data>
<row>2</row>
<item>yyy</item>
</data>
<data>
<row>3</row>
<item>xxx</item>
</data>
</xml>
I need to be able to select each of the "item" entries but have a distinct, unique list (i.e. xxx, then yyy) and I am using an xsl:for-each loop:
Code:
<xsl:for-each select="/xml/data/row[-- what do I put in here? --]">
-- code
</xsl:for-each>
So if you know SQL, similar to the "select distinct ... " command.
This is a simplified example of my real application - I know that this can be done many other ways but I need to use a for-each.
Hoping somebody can help.....
DJ
-
Jul 16th, 2004, 09:15 PM
#2
Frenzied Member
if you tried looking at the 'if' function of XSLT? might do what you want
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|