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

Re: StreamSource vs SAXSource

Subject: Re: StreamSource vs SAXSource
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sun, 02 Nov 2003 12:52:42 +0100
saxsource
Pramodh Peddi wrote:
I understand the differences between DOMSource and SAXSource. But, I din't
quite understand the differences (in terms of memory and time consumption)
between SAXSource and StreamSource.

When I have XML String to be transformed against a xsl. Which Source is the
best in terms of memory and time? SAXSource? StreamSource? I guess When we
have an XML Stream, StreamSource is better.

This borders on being off-topic for this list but anyway. There is not much difference in terms of memory an processing time for SAXSource vs. StreamSource itself. The kind of source you have to use is determined by the form you get the XML.

If you read the XML from a file or an URL connection, or if
you somehow get a string, then you have to use a StreamSource.

There are basically two reasons to prefer a SAXSource instead of a
StreamSource:

If you get, for example, the data already in a prestructured
form, like an SAX event stream or as the result set of a database,
then it might be more useful to use a SAX source instead of going
through the trouble of building a serialized XML stream to feed
into a StreamSource. This means of course providing a custom
XMLReader to the SAXSource.

The other reason to use a SAXSource if you have to take some
control over the parser or its configuration, for example for
providing a custom entity resolver or forcing schema validation.

J.Pietschmann


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.