[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Caching source documents and key()s

Subject: RE: Caching source documents and key()s
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 9 Aug 2001 10:57:33 +0100
saxon caching input dom structure
> I have a JAVA web application which has to present content from
> the same XML document several times for an user task, sort of
> a poor, short-lived in-memory database.
> Can anybody share experiences on caching source documents,
> using TrAX/JAXP1.1? Should i cache the File representation,
> or is it better to cache a DOM tree or SAX events, provided
> that ca. 60% of the file content is markup or ignorable whitespace?
>
> Furthermore, i use key() heavily to pull stuff from cross referenced
> elements. It would be nice to keep already built indexes across
> invocations of the processor, preferably along with the processor
> dependent representation of the input source. Something like what
> Templates is for the style sheet.
> Any comments from our processor implementors about this?

I think the answers are going to be processor dependent.

With Saxon, you should cache Saxon's own native tree structure, which you
can create using JAXP interfaces if you nominate Saxon as your
DocumentBuilder. You should avoid using <xsl:strip-space> in your stylesheet
(if you need to strip spaces, do it once in a separate transformation, and
save the result document), and if you want key indexes to be reused, you
should use the same stylesheet (Templates object) each time, because Saxon
won't recognize equivalence between two keys defined in different
stylesheets.

Saxon's standard tree model takes slightly longer to build and uses more
memory than its tiny tree model, but it's faster to navigate, so if you are
using the tree repeatedly then it's probably worth using the standard tree
model: if you only use it once the tinytree is usually better.

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.