Re: [xml] Re: python interfaces for libxml2



Daniel Veillard wrote:
  I reread that code, and I don't see why you would use such a _private
field. The xmlRelaxNGValidCtxt is a private structure, its content is not
exported outside of that module and I have no intent to make it public. So
tell me more about why you need such a field there ...

I can register an error handler for each xmlRelaxNGValidCtxt I create. When I
register the handler, I provide a pointer to some user data, but when I
free the context, I can't determine the pointer to my custom data from this
context directly, but have to use a list with a context <-> custom data mapping.

This is a lot better (in my opinion) with the context-specific error handlers
of xmlParserCtxt. When you register an error handler with custom data there,
you can store a pointer to the data in the "_private" field of the context,
so it's no problem to free this data when the context gets freed.

I hope this is clearer now...
Joachim

--
Joachim Bauch

struktur AG             Fon.:  +49 (0)711 896656 69
Junghansstr. 5          Fax.:  +49 (0)711 896656 10
D-70469 Stuttgart       eMail: bauch struktur de                    solutions for
Germany                 Web:   http://www.struktur.de            digital business

Download icoya OpenContent 1.3 for FREE!    visit http://www.icoya.de/iOC4free <-




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]