OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] Seeking Examples of XSLT Memory Stress

[ Lists Home | Date Index | Thread Index ]

> If the document falls out of scope then both XSLT 1 and 2 allow
> an implementation to discard it.  I don't think we'll see a
> procedural way to discard a document otherwise, except as
> part of something like the XQuery update facility perhaps.

In practice it's quite difficult to discard the document automatically. The
spec offers two guarantees:

(a) if the same document (URI) is loaded again, you'll get the same node

(b) if the same document (URI) is loaded again, it will have the same

It would be possible to discard the document and achieve (a) by remembering
the node identifiers and reusing them if needed. Achieving (b) though is
really hard, given that the URI might in the worst case identify a random
number generator. The only real way to do it is to serialize a private copy
of the document to disk.

The real problem though is in deciding when it's a good idea to discard the
document. For example, if the stylesheet is working its way through the
@href links from the primary source document, what's the chance that you'll
want to visit the same target document more than once? That's why I decided
that in this case having a user function to tell me when the document is no
longer needed is rather more useful.

Michael Kay


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS