OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: nestable C/C++ parser

[ Lists Home | Date Index | Thread Index ]
  • From: Paul Miller <stele@fxtech.com>
  • To: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
  • Date: Thu, 09 Dec 1999 16:27:44 -0500

> I think your original request got lost in a side track.  If is very possible
> to do what you want with expat.  The trick is the use of the XML_SetUserData
> and the userdata argument.  Basically, the trick is to create a base class
> that has methods that you want to change the behavior of (typically,
> StartElement and EndElement).  Create derived classes for each different
> behavior that you want.  Call XML_SetUserData to the initial handler object.
> In your StartElement callback, cast the userdata argument up to a pointer to
> your base class and call its startElement virtual method.  If you want to
> change the handler, make another call to XML_SetUserData.

The problem here is it requires 3 callbacks to parse a single element
and restore the state. I'd like a cleaner solution.

--
Paul Miller - stele@fxtech.com

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS