my dog learned polymorphism
The moose likes Product and Other Certifications and the fly likes XSLT/XPath - Find unique text node value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "XSLT/XPath - Find unique text node value " Watch "XSLT/XPath - Find unique text node value " New topic

XSLT/XPath - Find unique text node value

Raymond Law

Joined: Oct 07, 2002
Posts: 12
I have the following XML and want to retreive unique text node. Can xPath/XSLT achieve that??

Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
You want to retrieve all distinct values?
I think this is possible using axes

"....bigmouth strikes again, and I've got no right to take my place with the human race...."<p>SCJP 1.4
Micheal Jacob
Ranch Hand

Joined: Nov 25, 2002
Posts: 89
Here is the code. But in this i have faced one problem. The problem is,any axis looks on the original source document, not the logical xml document after ascending.
so this piece of code will fetch the unique values when it is in ascending order.

This xsl look upon the previous given xml.
Let's wait for others view on this.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Here is a much simpler solution:
Mahesh Chalil
Ranch Hand

Joined: Jan 24, 2002
Posts: 147
Using the Key mechanism it will be more simpler.

I agree. Here's the link:
subject: XSLT/XPath - Find unique text node value
It's not a secret anymore!