Click here to Skip to main content
15,064,140 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am reading the following XML structure, using -
XPATH: "//root/node1[@value]/node2":
  <node1 value="abc">
    <node2 value="def" />
    <node2 value="ghi" />
    <node2 value="jkl" />

I have to use data from "node1" if the data from "node2" satisfies certain conditions.
If the conditions for "node2" information are met, how do I access the "node1" attribute?
Updated 29-Oct-11 19:58pm
[no name] 29-Oct-11 13:45pm
Where are you doing this? With XSLT, C#, JavaScript?
lovinlife045 29-Oct-11 23:20pm
Hi Mark, It's used in a C# program.

Amir Mahfoozi 30-Oct-11 2:18am
[no name] 30-Oct-11 2:54am
Thank you Amir. :)
Espen Harlinn 30-Oct-11 12:00pm
5'ed :)
[no name] 30-Oct-11 12:51pm
Thank you Espen. :)
In addition to other solutions, consider using Html Agility Pack :[^]
Espen Harlinn 30-Oct-11 12:01pm
Interesting link, my 5
Amir Mahfoozi 30-Oct-11 15:08pm
Thanks ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900