Removing special characters inside XPATH
I have some elements with a tag <xxx:element>
inside my xml.
I want to get them using XPath. I have tried several ways to get them but no success so far.
//xxx:element
just returns nothing. I assume it is because of the :
characater //#xxx:element#
giving an exception: "Location step was expected after token" / "or" // ". //'xxx:element'
Same exception.
Any suggestions?
Based on choroba's answer, I found the Xml namespace splitting my xpath!
Found a solution using the local-name property. The following works just fine:
// * [-local name () 'element' =]
The part xxx:
is the namespace prefix. It should work in XPath, but depending on the language you are using, you may need to register the namespace before you can use it.
In saxon // *: the element does the trick for me