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

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Mon Oct 23 2000 - 11:56:03 EDT


On Mon, Oct 23, 2000 at 09:46:16AM -0400, Harry Blundell wrote:
>
> Thanks for your answer, but I think that either I wasn't clear, or I'm
> missing something.

   I honnestly think it's the second

> I have no problem with the way the mixed content of
> an element is stored. 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). 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.
>
> I'll write such a function if I have to - I just want to be sure that I'm
> not reinventing the wheel.

  Honnestly it doesn't make sense to me:

<a>aaaa<b>bbbbb</b>AAAAAA</a>

This generate 5 nodes,
   the parent node a with 3 children
      + a text node containing "aaaa"
      + a b node with one child
          + a text node containing "bbbb"
      + a text node containing "AAAAA"

 Now tell me what your semantic of xmlNodeSetContent(nodea, "cccccc")
would be and I'm pretty sure I can suggest another one which makes as
much (less) sense.

 If you want toc chnage the content of the text node do it directly
but sonething which would remove the "aaaa" and "AAAAA" nodes leaving
b untouched will not be integrated in libxml because from an XML
content model it doesn't make sense !

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | libxml Gnome XML toolkit
Tel : +33 476 615 257  | 655, avenue de l'Europe | http://xmlsoft.org/
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Rpmfind search site
 http://www.w3.org/People/all#veillard%40w3.org  | http://rpmfind.net/
----
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 - 12:44:00 EDT