Re: Standard API to XSL processors

Subject: Re: Standard API to XSL processors
From: James Clark <jjc@xxxxxxxxxx>
Date: Tue, 12 Jan 1999 09:37:07 +0700
Tyler Baker wrote:
 
> If someone has to build a DOM
> tree, write it out to a stream which is then piped into an XSL Processor and
> reparsed, that is an extra indirection of inefficiency that in the real world
> would knock out a lot of the potential benefits of a standard XSL API.

But if you write it out to a SAX DocumentHandler rather than a
OutputStream or a Writer you don't have this inefficiency.

Always writing out to the DOM is seriously inefficient.  In many cases
it would double the amount of memory you need (two trees in memory,
rather than one).  Building a DOM tree is *expensive* especially in
Java.

If you have to choose one kind of output, a SAX DocumentHandler is the
most efficient choice.  It means you have little overhead whatever you
want to do:

- write the XML an OutputStream
- write the XML to Writer
- run another SAX filter
- build a DOM tree

Any other choice introduces substantial overhead in some of those four
cases.

James



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


Current Thread