[jdom-interest] XPath selectSingleNode returns Boolean problem

Steven Shand steven at stevenshand.com
Wed Oct 22 03:00:34 PDT 2003


The javadocs state that XPath.selectSingleNode can return node types 
only (Element ,Attribute ,Text ,CDATA ,Comment or ProcessingInstruction)

However the code below return a Boolean.

String expression = "descendant-or-self::text() != ''"
XPath xpath = XPath.newInstance( expression );
Object match = xpath.selectSingleNode( element );

I guess this is a bug or am I missing something obvious?

Ironically, this behavior is just what I want!

Steven Shand




More information about the jdom-interest mailing list