Morten Jorgensen <[EMAIL PROTECTED]> wrote:
> Why does TransformerFactory.newTemplates() have to compile the input
> stylesheet if there is already a stored class definition for the
translet?
As the main designer of TrAX, I can testify that
TransformerFactory#newTemplates() was always meant as a compilation step,
though hiding the details of whether it compiles into a Java class or it
creates a StylesheetRoot like object. If you can persistently store the
Templates instance, the details of when you want to #newTemplates() the
stylesheet is exactly the same whether you are using interpreted Xalan or
compiled Xalan (i.e. XSLTC).
My main point here is that the use case for TransformerFactory#newTemplates
() was meant to be that an application only calls it when the stylesheet
has changed.
The details of TransformerFactory#newTemplates() and Templates probably
needs some work to make it really do well for the compiled model. We
should work on this for JAXP 1.2. But it should fit the bill well enough
for the moment.
Gary L Peskin wrote:
> I don't really think that TRaX has "...
> loads of crap ... that most users will never bother even looking at" but
> I could be wrong there too.
javax.xml.transform, all aspects of it, is well exercised by a wide variety
of users. I don't think there's a lot of fluff. A given Translet need
only implement javax.xml.transform.Transformer and
javax.xml.transform.TransformerHandler, and optionally XMLReader. I don't
think this is a lot of overhead at all, especially since the source tree
(either DOMImpl or DTM) implements a ContentHandler anyway.
-scott