[Home] [By Thread] [By Date] [Recent Entries]

  • From: Paul Miller <stele@f...>
  • To: "Arnold, Curt" <Curt.Arnold@h...>
  • 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@f...

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...)



Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member