Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
7
Reply
How to read XML attribute values ?
sachi vasishta
Nov 21 2011 5:25 AM
4.1k
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
How create admin panel?
Can anyone say how to bind data in to repeater control