Hello,

I'm confused about org.dom4j.Node's method selectSingleNode(String) - it's
supposed to return a Node.  What happens when the XPath expression doesn't
find anything is not documented, but I'd assume that it would return null. 
Instead, it throws an exception - the message in the exception suggests you
try another method such as selectObject() to evaluate the results of the
expression:

org.dom4j.XPathException: Exception occurred evaluting XPath: The result of
the XPath expression is not a Node. It was: true of type: java.lang.Boolean.
You might want to use a different method such as selectObject() to evaluate
this XPath expression
        at org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:163)
        at org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:188)
        at [... etc]

I can use selectObject() or some other method to try to get to the nodes I'm
interested in, but the behavior kind of bites.  Is this a bug?

Cheers,

- R




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to