Joseph, Thanks for the tip on this. I will just re-read the document from disk using a StreamSource (if that's what you mean by re-reading it with SAX). The document is local, and the operating system will cache recently read files, so the overhead should be minimal.
Thanks, Cory -----Original Message----- From: Joseph Kesselman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 28, 2002 9:21 AM To: [EMAIL PROTECTED] Subject: Re: Re-using DTM On Wednesday, 08/28/2002 at 09:06 MST, "Cory Isaacson" <[EMAIL PROTECTED]> wrote: > I have to run several XSLT iterations against the same XML source document, > and was wondering if there is a way I can cache and re-use the DTM, so that > Xalan doesn't have to rebuild this each time. I know that I can parse the > document and use it as a DOMSource, but was curious if it might perform better > if I used the DTM somehow. Xalan has some (fairly dumb) caching built in, at the DTMManager layer. The DTMManager is owned by the XPathContext, so if you could reuse the context you'd reuse that cache. But I don't think our XSLT APIs currently expose the ability to do that.... and we should probably try to find time to consider how that cache can be made more intelligent. Xalan's performance when reading from a DOM actually isn't that great -- we still have to build a DTM wrapper around the DOM, and making that wrapper both efficient and compact has been a serious challenge. If the document is local (so you don't have to worry about network delays), you may actually be better off re-reading the document through SAX. ______________________________________ Joe Kesselman / IBM Research
