riverwalker Posted November 12, 2012 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 Link to comment Share on other sites More sharing options...
thescientist Posted November 23, 2012 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 Link to comment Share on other sites More sharing options...
dsonesuk Posted November 23, 2012 Share Posted November 23, 2012 lowercase 'g' for GetgetElementsByTagName('NUM') Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now