On Sat, 2004-02-14 at 10:27, Michael Kay wrote:
> > Hmm, maybe I'm simply blind when reading docs... returning=20
> > the DOM wrapped in a DOMSource does the trick. I assume this=20
> > possibility has been made available for exactly the use case I have?
> Yes, among others. But it was more a by-product of the fact that Saxon
> can now work on a view of a third-party DOM, rather than copying it into
> its own structure.=20
Do I understand this correctly: A DOMSource is no longer automatically
transformed into a TinyTree prior to working on it with saxon7.x? It now
works on the foreign DOM directly?
> Incidentally, in 6.x instead of using an extension
> function you can always use a URIResolver and the document() function
> (which some people feel is cleaner anyway).
> Do remember that using a DOM with Saxon is (still) much less efficient
> than using the native TinyTree implementation.
But I fail to see the alternative? I have all my XSLT cached as
Templates objects but I need to create my documents in memory at
runtime, and I can't do it in a SAX like way (I need access to already
created nodes to change them). The question I'm always unsure with is if
it would be better to
a) give the DOM directly to saxon
b) Try to construct a TinyTree myself before feeding it to saxon
for saxon6.x I had the impression that it wouldn't matter as saxon would
do b) internally anyway, but reading your comment above makes me unsure
about the way saxon7.x works. (Actually, with our current system using
saxon6 we settled for version b) because occasionally such a DOM would
be used for more than one transformation, so caching the TinyTree
version helped in this case)
The same problem arises of course when using the mentioned extension
function: Is it different in total runtime if I return the DOMSource or
a TinyTree that I created myself from an existing DOM version???
Thanks a lot for your time,