![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Xalan-j XPathAPI and namespaces SOLVED Xalan-j XPathAPI and namespacesTo: NULL Date: 11/3/2003 7:45:00 PM 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? -- Dino Morelli dino.morelli@s... .~. http://www.debian.org Debian GNU/Linux /V /( ) ^^-^^ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
