bwh1te
asked on
XML XPathDocument
Hi,
I am getting some XML in from a web service in asp.net page.
The XML is in a string which I am loading into an xPathDocument.
To begin with I strip out the CDATA section usnig a REPLACE function call.
The resulting string will not work in an xPathDocument (I cannot navigate to anynodes) If however I take the floowing root element out of the string it does! It would seem to have something to do woth the namespaces - does anyone have any ideas??
<CTFschedule xmlns='http://www.govtalk.gov.uk/taxation/CTF' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.govtalk.gov.uk/taxation/CTF CTFschedule-v1-2.xsd'>
I am getting some XML in from a web service in asp.net page.
The XML is in a string which I am loading into an xPathDocument.
To begin with I strip out the CDATA section usnig a REPLACE function call.
The resulting string will not work in an xPathDocument (I cannot navigate to anynodes) If however I take the floowing root element out of the string it does! It would seem to have something to do woth the namespaces - does anyone have any ideas??
<CTFschedule xmlns='http://www.govtalk.gov.uk/taxation/CTF' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.govtalk.gov.uk/taxation/CTF CTFschedule-v1-2.xsd'>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you very much!
ASKER
The link you show is using the creatObject (associated with classic asp not asp.net)
Apparently the xPathDocument does not accept namespaces???????? This was why it was failing!