Hi,
I'm not sure what to think of this issue. The thing is that you are trying to run an xpath-expression on an invalid XML document (valid XML documents must have a root element!). I believe that an exception should be thrown if you try to select nodes using xpath on such documents (but not a NPE which is the case now).
I think you should try to avoid doing xpath evaluations on such documents...
regards, Maarten
[EMAIL PROTECTED] wrote:
Hi,
I upgraded to RC1 but I had to revert back to previous final version, because there were
issues with selectNode (jaxen respectively).
I think the issue is following:
Document doc = DocumentHelper.createDocument(); Node node = doc.selectSingleNode("/data");
(simplified, selectSingleNode is part of method, that is called either on empty or existing document).
java.lang.NullPointerException at org.jaxen.dom4j.DocumentNavigator.getChildAxisIterator(DocumentNavigator.java:227) at org.jaxen.expr.iter.IterableChildAxis.namedAccessIterator(IterableChildAxis.java:100) at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:183) at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:151) at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:240) at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107) at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:712) at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:241) at org.jaxen.BaseXPath.selectSingleNode(BaseXPath.java:264) at org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:144) at org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:186)
Leos
-------------------- Připravte se! Je tu škola. Navštivte včas Palác Flóra. Od 20.srpna do 5.září probíhá v Paláci Flóra speciální trh školních potřeb. http://user.centrum.cz/redir.php?url=http://www.palacflora.com
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user