[jdom-interest] XSLT API is too complex

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon Apr 29 07:00:01 PDT 2002


Elliotte Rusty Harold wrote:
> During Jason's talk on JDOM at SD2002West last Friday, I noticed that 
> the XSLT API is way too complex. It requires the user to be familiar 
> with TrAX and use multiple annoying factory classes instead of the 
> obvious constructors that are the hallmark of JDOM.

The aim at the time was not to design an XSLT API for JDOM but just to provide 
a better replacement to using string buffers to pass JDOM documents in and out 
of XSLT transformers.

> I wrote simple implementations of XSLTransform and XSLException in the
> San Jose and Las Vegas airports on my way home from the conference.
> Since they're relatively long I've put them up on my web site at
> http://cafeconleche.org/jdom/XSLTransform.java

2 remarks:
  a. Why not have all constructors just calling a single one:
        protected? public? XSLTransform(Source source)
to make them as simple as:
        public XSLTransform(Reader stylesheet) throws XSLException {
           this(new StreamSource(stylesheet));

  b. in transform, 2 JDOMSources are allocated. Remove line:
           Source source = new JDOMSource(in);


More information about the jdom-interest mailing list