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



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

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.

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]