Hey all.
I have a xml string:
<Test> Result : this is the result</Test>
How do i parse XML using XMLReader class to get "this is the result" as a string back.
thanx !
Hey all.
I have a xml string:
<Test> Result : this is the result</Test>
How do i parse XML using XMLReader class to get "this is the result" as a string back.
thanx !
Just create an xml reader using that string and use it for parsing
var reader = System.Xml.XmlReader.Create(new System.IO.StringReader(<xmlstring>))
var r = System.Xml.XmlReader.Create(new System.IO.StringReader("<Test> Result : this is the result</Test>"))
while (r.Read()) {
if (r.NodeType == XmlNodeType.Element && r.LocalName == "Test") {
Console.Write(r.ReadElementContentAsString());
}
}