Re: [xml] child nodes disappear after call to xmlNodeSetContent()



Today at 13:41, Markus STROBL wrote:

after every call to xmlNodeSetContent, all the childs are removed!

This way, you're basically removing references to all the other
subnodes, and inserting a single text node.  Btw, how do you think you
could get something like this:
  <a>foo
     <b>blah</b>
     bar
  </a>

if you had <a><b>blah</b></a>?  What would you expect SetContent to do
in such cases?  (I'm just showing that this behavior is simply logical)


You most likely want to construct 'text' nodes, and insert them
instead of using SetContent: watch out for keeping proper relations
(->children, ->next, ->prev) between nodes.  I know this only from
Python bindings, so I cannot help you with concrete code.


Cheers,
Danilo



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