Search code examples
c#xmlxmlnodeinnertext

how to get innertext from xmlnode C#


after I deserialized the xml, i'm able to parse all the elements and attributes. One of the attributes return an XmlNode. When expand the node, I could see the inner text, but not sure how to extract it. Any suggestion? enter image description here


Solution

  • I've got it figure out..

    var xn = (XmlNode[])attribute.DateValue; //attribute.DateValue is the node that we want to read
    var sdate = xn[0].InnerText;
    

    Thanks guys!