I would like to get all the content in between the tags but I do not know how to do this because of the urn: namespace.
<urn:ResponseStatus version="1.0" xmlns:urn="urn:camera-org">
<urn:requestURL>/CAMERA/Streaming/status</urn:requestURL>
<urn:statusCode>4</urn:statusCode>
<urn:statusString>Invalid Operation</urn:statusString>
<urn:id>0</urn:id>
</urn:ResponseStatus>
Any ideas?
local-name(). Like this:xPathFactory.newXPath().compile("//*[local-name()='requestURL']/text()");will return/CAMERA/Streaming/statusNamespaceContextthat maps namespaces names and URIs and set it on the XPath object before querying.Solution 1 sample:
Solution 2 sample:
Edit
This is a complete example, it correctly retrieve the element: