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

Re: SAX 1.0 : handleData and processingInstruction

  • From: Lars Marius Garshol <larsga@i...>
  • To: "XML Developers' List" <xml-dev@i...>
  • Date: 18 May 1998 17:39:31 +0200

sax processinginstruction

* Philippe Le Hégaret
|
| charecters takes an array of characters for the data :
| 
|   public abstract void characters(char ch[],
|                                   int start,
|                                   int length) throws SAXException
| 
|   processingInstruction takes a String for the data :
| 
|   public abstract void processingInstruction(String target,
|                                              String data) throws SAXException
| 
|   Why is there this difference in SAX ?

I wasn't "present" when this decision was made, but I'd guess
characters is the way it is because this way is faster in most
implementations, since most parsers keep a character buffer during
parsing and this avoids unecessary buffer copying. 

However, doing it this way is obviously less convenient for the user,
who would prefer to just get a String and be done with it. I guess
this is why the current form of processingInstruction was chosen,
since processing instructions rarely occur often in documents and thus
performance is less of an issue.

See also:

<URL:http://www.lists.ic.ac.uk/hypermail/xml-dev/9801/0042.html>
<URL:http://www.lists.ic.ac.uk/hypermail/xml-dev/9801/0087.html>

-- 
"These are, as I began, cumbersome ways / to kill a man. Simpler, direct, 
and much more neat / is to see that he is living somewhere in the middle /
of the twentieth century, and leave him there."     -- Edwin Brock

 http://www.stud.ifi.uio.no/~larsga/      http://birk105.studby.uio.no/


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.