RE: [xml-dev] XSLT with DOM or SAX ?

From
Michael Kay <>
To
'Kurt Riede' <>,
Date
2005-03-28T17:56:35Z
Thread
RE: [xml-dev] XSLT with DOM or SAX ?
> 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/