Insert() methods check for inserted XML to be in the same doc, and remove XML from old location if already inserted.

This commit is contained in:
Michael Daumling
2013-10-23 07:47:29 +02:00
parent ab42b16bac
commit ed52328ced
3 changed files with 103 additions and 6 deletions

View File

@@ -734,6 +734,10 @@ public:
/**
Add a child node as the last (right) child.
If the child node is already part of the document,
it is moved from its old location to the new location.
Returns the addThis argument or 0 if the node does not
belong to the same document.
*/
XMLNode* InsertEndChild( XMLNode* addThis );
@@ -742,10 +746,19 @@ public:
}
/**
Add a child node as the first (left) child.
If the child node is already part of the document,
it is moved from its old location to the new location.
Returns the addThis argument or 0 if the node does not
belong to the same document.
*/
XMLNode* InsertFirstChild( XMLNode* addThis );
/**
Add a node after the specified child node.
If the child node is already part of the document,
it is moved from its old location to the new location.
Returns the addThis argument or 0 if the afterThis node
is not a child of this node, or if the node does not
belong to the same document.
*/
XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );