How to read XML attribute values ?
Hi All,
How to read a XML attribute value in C# ?
I have a XML doc as below stored in a file called Auto.xml in the same path as that of the solution.
<root>
<fault category="pending">
<text>Pending Fault found on</text>
</fault>
<fault category="repaired">
<text>Repaired Fault on</text>
</fault>
<genere>
<text1>Aircraft</text1>
<text2>Component</text2>
<text3>Subsystem</text3>
</genere>
</root>
Now I want to check the node type, i.e., if the node type is attribute and if the attribute value is "pending" then I want to return the corresponding text node value "Pending Fault found on" as a string array. But I don't know how to read the attribute value of a node.
(I am using VS 2008)
Thanks,
Sachi