I have a VB.net application using an API and getting back large amounts of XML.
In my VB I use code like this to get a list of nodes and then a FOR EACH loop to go through them...
Dim XMLNodeList as XML.XMLNodeList = XMLReply.SelectNodes("//Book")
This would get me a list of the <Book> nodes for me to play with.
This works fine.
The problem I have is that the XML returned from this one API has nodes with names like <hello:world> or <big:problem>
The words don't matter. The point is that they have colons : in them... When I now run the above code to get my list it throws a big error like this
Run-time exception thrown : System.Xml.XPath.XPathException - Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.
So I am guessing I need to escape my XPATH somehow or find another way....
Any ideas anybody. I have been scratching my head on this for way too long already
Thanks in advance
Tom.
Enter your message below
Sign in or Join us (it's free).