It's fine to cache the Saxon tree structure and use it for multiple
transformations (either tree structure, in fact). A couple of things to
watch out for:
* all the transformations using the tree must use the same NamePool - but
unless you create your own NamePools that will happen automatically.
* it's best not to use xsl:strip-space in the stylesheets. If you want to
strip whitespace, do it while building the tree.
Note that you can create the Saxon tree structure without using any internal
Saxon API's: you can build it by doing a JAXP identity transformation from a
StreamSource (or SAXSource) to a DOMResult.
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@... Behalf Of
> Sent: 20 February 2002 21:21
> To: saxon-help@...
> Subject: [saxon] Caching TinyTrees?
> As part of my pipelining, I realized that at one stage, I'm
> passing the same
> SAX events on to two different SAXON transform instances.
> Thus the TinyTree
> is being built twice, once for each transform.
> What I'm thinking of doing is introducing a pre-stage that
> simply builds a TinyTree
> from the SAX events. Then I'll pass the same tree to each
> transform. I'm reading
> the code and I can't see a problem with this, but once again
> I appeal to the
> masters. 8-) Is there a problem with two different
> Controllers walking the
> same TinyTree instance? If there is, do you think that doing
> a deep-copy of
> the tree would be cheaper than simply going back to the
> original step of having
> two builders build two separate trees?
> Jean Duteau
> saxon-help mailing list