This content has been marked as final. Show 3 replies
You need to specify the namespace context somewhere before you execute that line of code. Remember that when you use namespaces, the prefix is just a short cut that identifies the actual namespace URI, and you always have to tell the processing software how to map the prefix to the namespace URI.
In a full XML document you declare it like this:
but in an XPath expression you have to declare it in some other way. Look for methods that create namespace context and apply it to XPath somehow.
Within the XML, there is the following. Could this be declaring the "xsd" namespace?
How can I set the namespace of the XPath in a org.dom4j document?
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:EX="urn:schemas-microsoft-com:xml-analysis:exception">
Yes, that's right. (I should have said xmlns:xsd in my earlier post, not xml:xsd.)
I have no experience with dom4j so I have no idea how it handles XPath versus namespaces. And I didn't see anything special in my 5 minutes of reading the API documentation. Does it have a support forum? If so, ask there.