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

- mandatory NOT do so before calling xmlNodeAddContent()

  Yes that's my understanding :-)


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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