Re: [xml-bindings]libxml-python C-API question



On Thu, Jun 06, 2002 at 06:18:49AM -0400, Daniel Veillard wrote:

>   hum, at the python level you *must* call that function with the
> _o field of the xmlCore (or descendant classe) instance.
>   Could you check first you did that at the python level, check
> libxml2.py to see how it's done usually.

Ah, thanks a lot! So changing 

 parseString(node, "A test") to parseString(node._o, "A test")

does it. So it works, but it looks ugly. If i read your code right
that seems to be the reason for your wrappers in libxml2.py. Is there
no way to do the unwrapping on the C side?

> 
>   err, I'm not sure I understand. You mean calling from C code the
> python wrappers ? I have a hard time figuring out why one would want
> to do this ...

No, more like this: assume a module that provides functions that want
to return XML data (as a silly example: mod_weather.py with a function
weatherAsXml('New Haven') ). It would be very convenient if the function
could return an libxl2 document object so that the return value could
be processed with functions from libxml2/libxslt. I consider this as
an essential functionallity for the interplay of modules creating or
modifying XML data. BTW, i'm _not_ really a Python programmer so maybe
i miss something rather obvious. I just had a look at 
http://www.python.org/doc/current/ext/using-cobjects.html and wondered
whether an API as difined in this doc is planned for libxml2.

 Thanks again

    Ralf Mattes






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