[Home] [By Thread] [By Date] [Recent Entries]

  • To: "'Kurt Riede'" <kriede@u...>,<xml-dev@l...>
  • Subject: RE: XSLT with DOM or SAX ?
  • From: "Michael Kay" <mike@s...>
  • Date: Mon, 28 Mar 2005 18:56:35 +0100
  • In-reply-to: <89050616@w...>
  • Thread-index: AcUziwlVZPqLEb2ESUC7YavBOwJ7tAAM8o0g

> Concerning your discussion about performance of 
> transformation, I have a related question:
> 
> Suppose we have a big XML document (>10MB) that rarely 
> changes. Now we want to transform it very often (>100 per 
> minute) in different ways, to extract and transform different 
> parts of the XML to distinct targets. 
> What is the best practise?
> Is there a way to make the transformer to cache the internal 
> optimized representation of the XML?

The answer to this is processor-dependent.

In Saxon there are various ways of building the internal representation of
the tree in memory, depending how much control you want to exercise: the
simplest is 

DocumentInfo doc = StaticQueryContext.build(streamSource);

Since DocumentInfo implements the JAXP Source interface, you can then use it
directly as the input to a transformation, as often as you like.

Michael Kay
http://www.saxonica.com/



Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member