[jdom-interest] JDOM and XPath API

Michael Kay mike at saxonica.com
Mon Sep 19 01:28:30 PDT 2011


> Further, with that change, the XPath class can easily become an 
> interface... which may improve the flexibility of some things.
>
> The XPathFactory class can have the same newInstance(), selectNodes() 
> And selectSingleNode() methods which will in turn use a shortcut to 
> the defaultFactory(). But, it can also be used to allow for different 
> implementations of the factory.
>

The methods selectNodes() and selectSingleNode() are very XPath-1.0 
oriented. If there's going to be an API change at this stage of the 
game, it would really make sense to anticipate XPath 2.0. Unfortunately 
that's potentially quite complex, for example how do you handle an XPath 
expression that returns a sequence of dates? For two attempts to solve 
this problem, you can look at the XQJ API and Saxon's s9api API.

Michael Kay


More information about the jdom-interest mailing list