XPUSR
asked on
XML XPATH Select distinct elements
Hi Experts,
How do I select (using C# System.XML) the distinct categories using XPATH into an array?
I am thinking that something along the following line should do the trick, however I ain't having much luck:
xmlNodes = xmlDoc.SelectNodes("//MACH INES/CAR/C ATEGORY[no t(CATEGORY /text()=pr eceding::n ode/text() )]/text()" );
Thanks,
j.
How do I select (using C# System.XML) the distinct categories using XPATH into an array?
I am thinking that something along the following line should do the trick, however I ain't having much luck:
xmlNodes = xmlDoc.SelectNodes("//MACH
Thanks,
j.
<MACHINES>
<CAR name='Toyota'>
<DATA>Some Data</DATA>
<CATEGORY>JPY</CATEGORY>
</CAR>
<CAR name='Audi'>
<CATEGORY>ITL</CATEGORY>
</CAR>
<CAR name='Mazda'>
<CATEGORY>UK</CATEGORY>
</CAR>
<CAR name='Nissan'>
<CATEGORY>ITL</CATEGORY>
</CAR>
<CAR name='Nissan'>
<CATEGORY>ITL</CATEGORY>
</CAR>
<CAR name='Nissan'>
<CATEGORY>UK</CATEGORY>
</CAR>
</MACHINES>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
welcome
ASKER