HI, I deserialized and applied xpath but still, I get the same error message as you did. I will not post the whole xml but using shortened “//D:OF[1]” (as @vsadykov stated) neither full “are:Ares_odpovedi /are:Odpoved/D:Vypis_RZP/D:ZAU/D:OF[1]” xpath worked.
Is there a solution to the namespace manager as suggested in the error message?
Thank you!
Hi, I have found this topic useful but I thought my scenario might add value.
I was trying to make XPATH work for an XML document that had a namespace, but no short name.
A simplified form of the XML is:
<?xml version="1.0" encoding="utf-8"?>
David Martin
david.martin@ether-solutions.co.uk
I struggled to XPATH to work, as the namespace did not have a shortname e.g. abc
The solution which I hope might help others, is that once the XML file had been read into the string variable - myXMLString, as well as being processed with XPATH, it can also be edited without impacting the XML on the file system. Therefore, a simple string Replace, to remove the namespace e.g. Replace(“xmlns=”“https://www.myite.uk/test”“”,“”)
This simplifies the XML and XPATH works perfectly with the updated string variable. Seems obvious with hindsight but not so apparent when you looking at the source XML file on the file system.