Possible Duplicate:
C#: Read XML Attribute using XmlDocument
In C# if I were to have the XMLDocument containing:
<Hello>
<Person:"Alan" Saying:"My name is Alan">
</Hello>
Then how might I obtain the single attribute “Saying”? I’ve found code which works when a single attribute is contained within the “<>” however it does not appear to work where there are multiple attributes inside as is above.
Any help would be much appreciated, I’m rather a C# novice 🙂
First off, that is not valid xml. I think you want something like
and the simplest way to get Alan’s Saying is
for a more detailed explanation of why that works, see XPath Examples