Jump to content

How do I retrieve inner (child) nodes

Recommended Posts

Hi; Given this XML . <SUPAPPRAISER> <INSPECTION> <STATECERT> <NUM>12456789</NUM> </STATECERT> </INSPECTION></SUPAPPRAISER> I want to store the Num node value in an variable. I tried the XML DOM tutorial and example but they aren't exactly working with my code. This is asp.net 4.0 XmlNodeList elem_SupAppraiser = incomingxml_doc.GetElementsByTagName("SUPAPPRAISER");string hold = elem_SupAppraiser.Item(0).Value; if (elem_SupAppraiser != null && elem_SupAppraiser[0] != null){SuprAppra_Cert = elem_SupAppraiser[0].InnerText; What expression am I missing ? Thanks

Link to post
Share on other sites
  • 2 weeks later...

can you not just do


otherwise, you would probably have to start at the root and slowly iterate your way down the nodes till you get to NUM

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...