Re: [xml] xmlNodeSetContent that doesn't wipe out child elements?

Date view Thread view Subject view Author view

From: TOM (ptittom@free.fr)
Date: Mon Oct 23 2000 - 12:08:01 EDT


On 23/10/2000 15:46:16 Harry Blundell wrote:
> My problem is with my understanding of xmlNodeSetContent: before
> adding new content to an element node, it removes ALL child nodes
> - both text nodes (understandable) and element nodes (no so
> understandable, at least to me).

If you set the content of the node, it means you want this node to have
only this text.

> I'm looking for a function that replaces the child text nodes
> (and I'm not too concerned with where the new text nodes go - at
> the end would be fine), while leaving the child element nodes
> intact.

*You* don't mind where the text node goes, but it can't be the case for
everyone.

> I'll write such a function if I have to - I just want to be sure
> that I'm not reinventing the wheel.

There's no function doing what you want (stripping all text nodes adn
adding a new one as the last child) because it doesn't make sense for
everyone (I'm tempted to say it doesn't make sense at all but in rare
projects).
You'll need to write your own function (not too difficult though ;o)

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 14:43:56 EDT