[jdom-interest] JDOMTransformer

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun May 4 11:19:23 PDT 2003


At 5:29 PM +0200 5/2/03, Laurent Bihanic wrote:


>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 ?

I agree. This is sensible. There is no guarantee that an XSLTransform 
returns a complete Document. Both methods should return 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.
>

The question here is what the performance cost of allocating a new 
Transformer object is. Certainly it's less than creating by parsing 
the stylesheet from scratch, but perhaps it's still significant. In 
general, nothing in JDOM promises thread safety. Is there a benchmark 
in the house?
-- 
Elliotte Rusty Harold
elharo at metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



More information about the jdom-interest mailing list