Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
XML
Xalan-j XPathAPI and namespaces
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dino Morelli, post: 769622"] 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? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
XML
Xalan-j XPathAPI and namespaces
Top