![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
Quoting David Yip <yipdw@...635...>:
Is the void* data argument in XML node listeners available to pass extra data to listener callback routines, or does it have another function that would prevent that purpose? (For example, passing a pointer to an instance of a class that is unique on a per-document basis.)
Yes, you can do that, but I would strongly recommend using XML::Node::addObserver rather than XML::Node::addListener in new code.
XML::Node::addListener is effectively just a wrapper around XML::Node::addObserver, and will be going away after the 0.42 release.
Simply subclass XML::NodeObserver and override the notify*() methods for any events you are interested in. You can keep any needed supplemental data in data memebrs of your subclass.
-mental