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

Re: SAX/C++: C++-specific design principles

  • From: Daniel Veillard <Daniel.Veillard@w...>
  • To: David Megginson <david@m...>
  • Date: Fri, 3 Dec 1999 08:15:21 -0500

xmlchar c
On Thu, Dec 02, 1999 at 04:32:36PM -0500, David Megginson wrote:
> Here are the principles that I applied to creating my first draft
> SAX/C++ interface:

  I'm afraid I won't be able to provide this interface in libxml
(the Gnome XML library http://xmlsoft.org/) due to the focus on C++,
though a C++ wrapper on top should be able to provide it.


> 2. Pointers never change ownership -- if a Parser (for example) wants
>    to own an InputSource, it needs to make its own copy.  The app has
>    to free everything that it allocates, and the SAX driver, likewise.

  Very good idea,

> 4. Hold my nose and use UTF-8 rather than UTF-16, for compatibility
>    with most existing C++ code.

  Like James pointed out it's hard to segregate a class of users.
UTF-8 compacteness will be appreciated by people wanting low memory
overhead when building transaction processing. UTF-16 will simplify
interfacing to DOM or using XML in UI oriented apps.

> 5. Use char * rather than string, to avoid forcing a lot of allocation 
>    overhead on the SAX driver.

I did opt for the simple approach having an xmlChar type used everywhere
except non XML content (filenames, errors messages ...). Having it 8 or
16 bits should be a compile-time (or run-time but that's more risky)
option.

Daniel

-- 
Daniel.Veillard@w... | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe

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/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe 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.