[jdom-interest] JDOMTransformer

Laurent Bihanic laurent.bihanic at atosorigin.com
Fri May 2 08:29:57 PDT 2003


Hi,

Jason Hunter wrote:
> I just checked in org.jdom.transform.JDOMTransformer to help with simple
> transformations.  It's been a TODO item to make simple transformations
> into a "one-liner".  I'm not sure I've got the best approach here, but
> best to check it in and get some review.  I changed the
> samples/XSLTransform.java to use the new convenience class.
> 
> Please check it out and let me know what you think!

3 points:

a. Why exposing the TrAX exceptions? All aspects of TrAX are hidden but these. 
Throwing JDOMExceptions would make this class easier to deal with for JDOM users

b. Two other transformation "types" are possible: Document -> List and List -> 
Document. But as XSLT does not guarantee the output is a well-formed document, 
why not stick to only 2 transform methods, both returning a List ?

c. This class could be very useful in a multithreaded environment such as 
servlets. Too bad this is not possible while making it threadsafe would be so 
easy: Allocate a Templates instead of a Transformer in constructor and 
allocate a new Transformer for each transform() call.

Laurent




More information about the jdom-interest mailing list