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

Reply via email to