CopyXMLNode()

Syntax

*Result = CopyXMLNode(*Node, *ParentNode [, *PreviousNode])
Description
Copies the given XML node and all its contained text and children to a new location. This function can even be used to copy nodes into a different XML tree. For moving a complete node to a new location MoveXMLNode() can be used.

Parameters

'*Node' specifies the node to copy.
'*ParentNode' is the node into which to insert the new node. To insert the new node at the root of the tree, RootXMLNode() can be used here.
'*PreviousNode' specifies a childnode of '*ParentNode' after which the new node should be inserted. If this value is 0 or not specified, the new node is inserted as the first child of its parent. If this value is -1, the node is inserted as the last child of its parent.

The following rules must be followed for a successful copying:
- The root node of a tree cannot be copied
- *ParentNode may not be of type #PB_XML_Comment or #PB_XML_CData
- *PreviousNode must be a direct child of *ParentNode (if it is specified)
- If the XML tree already has a main node, only nodes other than #PB_XML_Normal and #PB_XML_CData can be inserted at the root level

Return value

Returns the pointer to the new XML node if it was copied successfully or 0 if copying was not possible.

Supported OS

All

<- ChildXMLNode() - XML Index - CreateXML() ->