Thanks for reporting this. Saxon 9.2 changed the logic so that you have to register the external object models you want to use with the Configuration. So the problem can be fixed by changing the code at line 167 of ApplyXPathJAXP to

} else if (objectModel.equals(NamespaceConstant.OBJECT_MODEL_XOM)) {
                nu.xom.Builder builder = new nu.xom.Builder();
                document = FileInputStream(filename));

This isn't really very satisfactory, because the idea of this sample application is that it should use JAXP interfaces only (so casting down to a Saxon implementation class defeats the purpose). In fact there's already another case where it does the down cast. Ideally, if the XPath factory is looking for an XPath implementation that supports XOM, Saxon should enable XOM support automatically; but unfortunately, the JAXP factory mechanism selects Saxon without telling Saxon what object model to expect. I think the right answer is that, since Saxon's XPathFactory claims in its manifest to support all these external object models, the XPathFactory should create a configuration in which they are already enabled. The only difficulty is doing this in a way that is sensitive to which Saxon edition is being used. So it looks like a "next release" fix rather than a simple bug fix.

Michael Kay

On 02/09/2010 8:33 PM, Malix Ren wrote:
Hi Michael,
When running 
ApplyXPathJAXP data/books.xml "//ITEM"  xom
with saxon9ee.jar

It reported error:
Exception in thread "main" javax.xml.xpath.XPathExpressionException: Cannot locate an object model implementation for nodes of class nu.xom.Document
at net.sf.saxon.xpath.XPathExpressionImpl.evaluate(
at net.sf.saxon.xpath.XPathExpressionImpl.evaluate(
at ApplyXPathJAXP.doMain(
at ApplyXPathJAXP.main(

It seems xom support like 
is not included in saxon9ee.jar

Thanks and best regards

------------------------------------------------------------------------------ This Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010.
_______________________________________________ saxon-help mailing list archived at