CreateXMLNode()

Syntax

*Result = CreateXMLNode(*ParentNode [, *PreviousNode [, Type]])
Description
Creates a new XML node and inserts it into the given parent node.

Parameters

'*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.
'Type' specifies the type for the new node. The default is #PB_XML_Normal. Note that the node type cannot be changed after the node was created.

The following rules must be followed for a successful insertion:
- *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)
- A node of type #PB_XML_Root cannot be created manually
- 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 created successfully or 0 if no node could be inserted at this point.

Supported OS

All

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