Re: [xml] Getting Node content with markup
- From: Ben Gamari <ben milkyway0 dyndns org>
- To: veillard redhat com
- Cc: xml gnome org
- Subject: Re: [xml] Getting Node content with markup
- Date: Sun, 31 Aug 2003 15:24:49 -0400
This was exactly what I was looking for. Thanks!
On 2003.08.31 14:36, Daniel Veillard wrote:
On Sun, Aug 31, 2003 at 01:52:46PM -0400, Ben Gamari wrote:
> Hi,
>
> I am implementing a python library to modify an XML-based
documentation
> format which must be able to handle XML such as this:
> <Function name="foo">
> <Description>The function <FuncName>foo</FuncName> modifies
the
> variable <VarName>bar</VarName> etc.</Description>
> </Function>
> Instead of creating classes for the <FuncName> and <VarName>
elements I
> would like to pass the inner xml of the <Description> element
directly
> to the user. I'm using the tree API and haven't found a suitable
> function. However, when I was looking at the XMLReader API I found
the
> xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml functions
but
> unfortunately they are unimplemented. If I have to I could write
code
> to reconstruct the tags from the tree but I would much rather not
have
> to undo the work of the parser. Does anyone know of a way to get the
> inner xml of an element with the tree api or know if and when this
will
> be implemented. I might be able to donate an implementation if you
are
> interested in it.
have you tried node.serialize() ? see python/tests/serialize.py for
a full set of examples. If operated at the reader level you will have
to get it to Expand() first ...
Daniel
--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]