Re: [xml] Re: xmlReplaceNode

On Thu, Jun 10, 2004 at 02:01:45PM +0400, Dmitry Belous wrote:
Hi, All

perhaps, bug:

xmlReplaceNode(OLD, NEW) not call xmlSetTreeDoc(NEW, OLD->doc),
therefore xmlDocDumpFormatMemory return corrupted result
if node NEW belong to other doc. If NEW->doc == NULL,
all ok, but attribute value always translate to &#xNNN when
char in attribute value >= 0x80

xmlSetTreeDoc(NODE, DOC) don't work for inside nodes when NODE->DOC == DOC

  yes, on purpose, it's assumed when the subtree get added to NODE
then the doc must match.
  Beware, with the addition of per-document dictionnaries, migrating
trees from a doc to another you must make sure the documents share the
same dictionnaries or that the subtree does not use the document
dictionnary. It's far safer in general to simply copy tree instead of 
moving them unless you really know what you are doing.


Daniel Veillard      | Red Hat Desktop team
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]