jaxp namespaces in document elements
843834Nov 24 2009 — edited Nov 27 2009I am trying to use Java to access xml items using XPath.
I am OK with an xml document with name spaces in root element.
But not namespaces declared in elements.
Typically see two documents at
http://www.w3schools.com/XML/xml_namespaces.asp
Under
XML Namespaces - The xmlns Attribute
Quote "Namespaces can be declared in the elements where they are used or in the XML root element:"
My Xpath is "/root/h:table/h:tr/h:td"
This works OK for second document with namespaces in root element.
But not the first document with namespaces in the elements.
I have tried using lookupNamespaceURI but this only seems to process root element.
It's hair pulling time!
Any Ideas
Thanks