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

RE: Does SAX make sense?


RE:  Does SAX make sense?
> * XML documents are rarely smaller than memory

You presumably meant to say that they are rarely larger than memory?
> 
> These two things conspire to make it that, for the lion's 
> share of documents, by the time the SAX stream is finished, 
> all the SAX events will be still in memory, though perhaps 
> unreachable. If they are in memory, why not make them available?
> 

SAX events are not objects. They are method calls containing objects as
their parameters. In many cases the underlying objects will be reused by
the parser, for example the same AttributeCollection object will be
reused for each startElement event, and the byte array that is passed to
the characters() method will be reused for each bufferfull of data that
is read from disc.

It's quite true, of course, that if you have enough memory to hold a DOM
representation of your document, then using SAX merely in order to save
memory is fairly pointless. But that doesn't seem a very profound
observation.

Michael Kay


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.