Re: [xml] Behaviour of xmlNodeAddContent() vs. xmlNodeSetContent()



On Wed, Oct 25, 2006 at 02:51:32PM +0200, Keim, Markus wrote:
Hi Daniel,

well, comparing the documentation of both calls
(I've actually done so before asking) doesn't make
that different behaviour *that* obvious.

  Agreed, xmlNodeAddContent is lower level, working at the text node
string level while xmlNodeSetContent is more at the serialization level.
A lot of this is just history, not always very rational, and nearly
impossible to change. Though if you want to submit a patch to make 
the function comments more explicit, sure !

However, a statement of you that both calls behave as intended
is abolutely adequate (and appreciated) for my issue, I'd have
to adjust the application, then.

So, if I got this right, that would mean to
- mandatory pass user input through xmlEncodeEntitiesReentrant()
  (resp. xmlEncodeSpecialChars()) before calling
  xmlNodeSetContent()

- mandatory NOT do so before calling xmlNodeAddContent()
?

  Yes that's my understanding :-)

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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