Suppose I have the following XML Document.
<reply success="true">More nodes go here</reply>
How to get the value of the attribute success, which in this case would be the string "true".
I would try something like this:
XmlDocument doc = new XmlDocument();
doc.LoadXml("<reply success=\"true\">More nodes go here</reply>");
XmlElement root = doc.DocumentElement;
string s = root.Attributes["success"].Value;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With