Details
-
Bug
-
Status: Resolved
-
Resolution: Incomplete
-
2.3
-
None
-
None
-
Operating System: All
Platform: HP
-
9081
Description
When using the ...
public static Node selectSingleNode(Node contextNode,
java.lang.String str,
Node namespaceNode)
or
public static Node selectSingleNode(Node contextNode,
java.lang.String str)
methods of XPathAPI or CachedXPathAPI on a Document object that contains
multiple namespaces ... the method returns null every time!
For instance, take the following markup ...
<?xml version="1.0" encoding="UTF-8"?>
<parent parentId="123">
<parms targetNamespace="http://foo.com/" xmlns="http://foo.com/">
<foo><name>foo</name></foo>
</parms>
</parent>
The following XPathAPI query returns null!
Document doc = DocumentBuilder.parse("pathtofoo.xml");
Element elParent = doc.getDocumentElement();
Element elName = XPathAPI.selectSingeNode(elParent, "parent/foo/name");
i've also tried ...
Element elName = XPathAPI.selectSingeNode(elParent, "parent/foo/name",
elParent);
still returns null! Any clues?