I've moved this back on-list, so there is a record of the information and so that other users can contribute their own experience.
 
Yes, Saxon has direct support for JDOM: see http://saxon.sourceforge.net/saxon6.5.2/samples.html#jdom 
 
I haven't measured the performance. It works very differently from the DOMSource: if you supply a DOMSource, Saxon strips it down and constructs its own tree representation. If you supply a JDOM source, Saxon uses the JDOM tree directly. This avoids the cost of rebuilding the tree, but restricts Saxon to the access paths provided by JDOM - which means, in particular, that sorting nodes into document order is very expensive.
 
Using a DOM as the intermediate format between JDOM and Saxon is certainly a very bad idea. Much better to interface them using SAX: I'm pretty sure JDOM has the ability to output SAX events, which you can feed directly into SAXON.
 
Michael Kay
-----Original Message-----
From: Grant C. Peters [mailto:grantcpeters@earthlink.net]
Sent: 27 September 2002 00:33
To: michael.h.kay@ntlworld.com
Subject: RE: [saxon] using a DOMSource

I solved my problem, but I would like to tell you why I am using a DOMSource, perhaps there is a better way to do this, I know it's alittle off topic, it doesn't relate directly to saxon, but the reason I am using a DOMSource, is because I am actually creating a org.jdom.Document from data I get from a database, I use JDOM because I can easily instantiate the objects (Elements, Attribute,…) and create the structure I want, and then use a DOMOutputter to output the the DOM node to supply to saxon,  is there a better way to get my JDOM Document into saxon?

Thanks alot

 

Grant C. Peters

grantcpeters@earthlink.net

phone  : 415.948.7030

 

-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net]On Behalf Of Michael Kay
Sent: Thursday, September 26, 2002 07:16
To: 'Grant C. Peters'; saxon-help@lists.sourceforge.net
Subject: RE: [saxon] using a DOMSource

 

You're probably doing something wrong, but I can't tell what without seeing some details.

 

Generally, NullPointerExceptions shouldn't happen in Saxon, unless you actually supply a null value for a parameter that Saxon requires to be non-null.

 

Do you have a good reason to supply a DOMSource to Saxon? It's generally bad news from a performance point of view. If the data already exists as a DOM, then supply it that way, but never create a DOM specifically to provide the Saxon input. If you need to preprocess the data before transformation, use a SAX filter if at all possible.

 

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com

 

 -----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Grant C. Peters
Sent: 25 September 2002 20:53
To: saxon-help@lists.sourceforge.net
Subject: [saxon] using a DOMSource

Everytime I try to transform a DOMSource with a org.w3c.dom.Element as my arg to the c'tor, I get a null pointer exception

Does anyone know why this is?

thanks

 

Grant C. Peters

grantcpeters@earthlink.net

phone  : 415.948.7030