[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...)
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|