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

SAX is not a read-only API (wa RE: re: XML SIG 17...)

  • To: "'Elliotte Rusty Harold'" <elharo@m...>,<xml-dev@l...>
  • Subject: SAX is not a read-only API (wa RE: re: XML SIG 17...)
  • From: "Aaron Skonnard" <aarons@d...>
  • Date: Thu, 12 Sep 2002 11:50:26 -0600
  • Importance: Normal
  • In-reply-to: <p04330107b9a67af28126@[192.168.254.4]>

sax read only

Elliotte Rusty Harold wrote:

> At 11:09 AM -0600 9/12/02, Aaron Skonnard wrote:
> 
> > Since when is SAX a "read-only API"? SAX is simply a suite 
> > of interface definitions for programmatically representing 
> > XML documents. Why does it matter what side of the interface 
> > you're on? It's still SAX.
> 
> Is there a single method call anywhere in the three SAX packages that
> actually creates a fragment of XML? 


I assume you're referring to an XML Infoset, and not XML 1.0, since that
what the API models. If so, sure, characters produces a fragment of XML
in a single call. But why does it matter if it's a single call anyway? A
sequence of calls can model an XML Infoset in an intuitive manner.


> You can create a few helper classes like AttributesImpl. but there's 
> nothing to actually put them in a file or on a stream. 

Who cares where it goes? SAX is about programmatically modeling
Infosets.

> Where are the SAX calls to create a new XML document? 

ch.startDocument();
// document content goes here...
Ch.endDocument();

> They don't exist. SAX is a read-only API. It supports
> parsing of XML documents, but has no support whatsoever for creating
> new XML documents, modifying XML documents, or writing them onto
> streams. You can write code to do all this yourself. Just don't
> pretend that code is part of SAX.

The SAX interfaces don't mandate "parsing of XML documents", although
the interfaces can be used for this common task, as well as others. 

-aaron

......................................................
. Aaron Skonnard, DevelopMentor (http://skonnard.com).
.  Essential XML Quick Reference available online!   .
.    Download PDFs: http://www.develop.com/books     .
......................................................



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.