To add on to what Tom said:
- Translets are currently implemented as a kind of Templates object
(sort-of; look at the code for details). One of the points of Templates
objects is that they are pre-parsed and pre-processed in-memory
representations of stylesheets. Since JAXP/TrAX allows you to plug in
different processors underneath the same API's, exactly how each processor
pre-processes the stylesheet will vary. Note that Templates objects are
also threadsafe, making them (in any processor) a good candidate for
creating at startup time and caching for later use.
- Xalan now offers you two kinds of processors: the normal
org.apache.xalan.processor.* stuff, which is from before (with
improvements), and the newly donated XSLTC stuff in org.apache.xalan.xsltc.
*. There's a JAXP system property javax.xml.transform.TransformerFactory
that you can set to choose which processor you want to create.
- Translets are good if you know you will be using the same stylesheet over
and over and can preprocess it once. Translets may also be better for some
kinds of distributed processing models, where you want transforms to happen
on the client and not just the server. The normal Xalan mode is probably
better if you're only using the stylesheet once, since there is some
overhead in creating the Translet for the first time. Also, the
xsltc/Translets aren't quite as stable as the main xalan mode yet. And
we're doing a lot of work on both halves of our project, xalan mode and
xsltc mode, to make them both faster and share more code, so stay tuned...
- Shane
---- you Tom Amiro <[EMAIL PROTECTED]> wrote ---
> The short answer is that translets in most cases are much faster because
they
> incorporate the instructions from the stylesheet as Java bytecode,
> which at runtime are used to transform an XML source.
>
> The translet only encodes the operations included in the stylesheet.
> XSLTC maximizes performance by building an optimized internal
representation
> of the XML source tree, which can be cached in memory. Then at runtime
you can
> apply the compiled translet against the cached XML source. This is best
> suited to the case where you want to transform the same (or infrequently
> changing) XML source over and over.
>
> Tom
>
> Dmitri Ilyin wrote:
> >
> > Hi *,What is the basic difference bitween templates and XSLTC
translet???Which \
> > advantages give translets??Which should be used to better \
> > performance??regardsDmitri