[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT functions in XPath

Subject: Re: XSLT functions in XPath
From: Owen Rees <owen.rees@xxxxxx>
Date: Wed, 11 Oct 2006 13:04:52 +0100
dtmnodelist xpath
--On 11 October 2006 02:26 +0200 Victor Toni wrote:

After further investigation I noticed that Saxon's XPath implementation
(over JAXP) had difficulties to deal with "random" XPath results as
context since "net.sf.saxon.dom.DOMNodeList" implements "NodeList" but
not "Node":

If you use the Java 5 XPath implementation (which is a version of Xerces) then you will find yourself getting "com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList" as the result of xpath.evaluate(path,context,XPathConstants.NODESET). This also implements "NodeList" but not "Node".


If you supply this as context to another call like that then if the path is "." it will work but if the path is "*" you get "javax.xml.transform.TransformerException: Unknown error in XPath." caused by a NullPointerException.

Although the JAXP 1.3 spec suggests that you can use a node list as the context in a call to 'evaluate' it does not explain what that means. The XPath specifications do not suggest any meaning for a context consisting of a list of nodes.

--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.