D
Dino Morelli
Looking for someone familiar with Xalan-j..
I'm having problems isolating a node in a Document with Xalan-j's
XPathAPI class when that element is in a namespace.
using:
Xalan-j v2.5.1
JDK v1.4.2-b28
Given an XML document that looks like this:
<a xmlns:foo="foo-ns">
<b>value 1</b>
<foo:b>value 2</foo:b>
</a>
These calls return null:
// Document doc contains the parsed above document
Node n = XPathAPI.selectSingleNode(doc, "/a/foo:b");
Node n = XPathAPI.selectSingleNode(doc, "/a/foo:b",
doc.getDocumentElement());
However, this xpath works, retrieving the second b with no namespace
explicitly requested:
"/a/b[2]"
Does anyone know how to make the first type of xpath "/a/food:b" work?
I'm having problems isolating a node in a Document with Xalan-j's
XPathAPI class when that element is in a namespace.
using:
Xalan-j v2.5.1
JDK v1.4.2-b28
Given an XML document that looks like this:
<a xmlns:foo="foo-ns">
<b>value 1</b>
<foo:b>value 2</foo:b>
</a>
These calls return null:
// Document doc contains the parsed above document
Node n = XPathAPI.selectSingleNode(doc, "/a/foo:b");
Node n = XPathAPI.selectSingleNode(doc, "/a/foo:b",
doc.getDocumentElement());
However, this xpath works, retrieving the second b with no namespace
explicitly requested:
"/a/b[2]"
Does anyone know how to make the first type of xpath "/a/food:b" work?