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

On Thu, Jun 06, 2002 at 01:11:02PM +0200, rm fabula de wrote:
> 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
> > 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 Is there
> no way to do the unwrapping on the C side?

  Simpler to wrap at the python level, just encapsulate your call to
parseString. At least for generated stubs I found it had a lot of good
properties at the cost of IMHO minimal uglyness.

> >   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: 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

  Okay, simply get to use the libxml2 python module,
I don't see why you want to go back to C ? Maybe I'm confused or the
morning coffee didn't made effect ...

> 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 
> and wondered
> whether an API as difined in this doc is planned for libxml2.

  I'm still not sure I fully understand, but I definitely take patches :-)


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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