Re: [xml] Moving XML_ENTITY_REF_NODEs between documents using xmlAddChild()

On Tue, Oct 31, 2006 at 10:47:56PM +0000, John Marshall wrote:

In the process of moving some nodes from one document
to another, I bumped into XML_ENTITY_REF_NODE nodes
not being "fixed up" (i.e., there are references to the
XML_ENTITY_DECL node of the original document) when I
did xmlUnlinkNode(), then xmlAddChild().

Are there any suggestions about how to handle this
while my target document does not yet contain a
suitable XML_ENTITY_DECL to be referenced?

  Find the XML_ENTITY_DECL and copy its content recursively
i.e. do a replace or insert an XML_ENTITY_REF_NODE with only
NULL pointers except for the entity name (and parent/siblings)

  I don't see any other solution.


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]