Selecting distinct values from different node in XPATH 1.0

enpysoft <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
Hi Experts,
          I have to get the list of the distinct attribute values across
different node level. To help you understand my requirement, i am herewith
listed with a sample XML file

My XML file looks like this

<validation>
 <report>
   <script city="NY">
          <case name="ramesh" status="BE"/>
          <case name="rajesh" status="B.Com" />
   </script>
   <script city="AL">
          <case name="ramesh" status="Law" />
   </script>
 </report>
</validation>

Now i have to get only the values as ramesh and rajesh and i should not get
ramesh two times. As i use only XPATH 1.0 and XSLT 1.0 i cannot use
distinct-values function. I earlier tried using to fetch distinct values to
a variable using the below script in xslt and it is not working.

<xsl:variable name="uniquevalues"
select="/validation/report/script/case[not(@name=predicate-sibling::validation/report/script/case/@name)]/@name"
/>

The above code snippet is not working. Kindly let me know what has to be
done to get my expected output.


thanks in advance,
npselvan
-- 
View this message in context: http://www.nabble.com/Selecting-distinct-values-from-different-node-in-XPATH-1.0-tp24717305p24717305.html
Sent from the Xalan - J - Users mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.