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

RE: The SAX interface of the xml4c2 parser

  • From: roddey@u...
  • To: xml-dev@i...
  • Date: Mon, 25 Oct 1999 16:36:57 -0600

xml4c2



>I don't like returning "const XMLCh*" instead of "const wstring&" or
>"const string&" (even though an approach like this would be more
>efficient for an expat wrapper).  I don't need the index out of range
>warning capability, because I iterate through the AttributeList
>entries anyway.
>

wstring is not available on all the platforms. We have to support lots of
platforms and a plain character array pointer is the universal format that
everyone can understand.

>I don't like giving an AttributeList& argument to
>DocumentHandler::startElement(), instead of an
>AttributeList*, because this rules out the possibility
>of passing a null-pointer on for the cases that don't
>have an attribute list.
>

That's what the length method of the attribute list is for. Just query it for
the number of elements. A reference to an attribute list is more consistent with
the Java interface and is more convenient for the end user. For performance
reasons, most practical parsers would keep around one list object per parser
instance which is just passed out over and over again (as apposed to
constructing one on every start element callout), so there would be no
performance overhead concerns. And it means that the code that handles it can be
simpler. It doesn't have to test first for null then do the loop. It just does
the loop. If there are zero elements, the loop is never entered.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
roddey@u...



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.