riverwalker 0 Posted November 12, 2012 Report Share Posted November 12, 2012 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 Quote Link to post Share on other sites
thescientist 231 Posted November 23, 2012 Report Share Posted November 23, 2012 can you not just do GetElementsByTagName('NUM') otherwise, you would probably have to start at the root and slowly iterate your way down the nodes till you get to NUM Quote Link to post Share on other sites
dsonesuk 913 Posted November 23, 2012 Report Share Posted November 23, 2012 lowercase 'g' for GetgetElementsByTagName('NUM') Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.