Re: [xml] Getting Node content with markup

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
> format which must be able to handle XML such as this:
>      <Function name="foo">
>        <Description>The function <FuncName>foo</FuncName> modifies
> 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
> 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
> xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml functions
> unfortunately they are unimplemented. If I have to I could write
> to reconstruct the tags from the tree but I would much rather not
> 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
> be implemented. I might be able to donate an implementation if you
> interested in it.

  have you tried node.serialize() ? see python/tests/ for
a full set of examples. If operated at the reader level you will have
to get it to Expand() first ...


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine
xml mailing list, project page
xml gnome org

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