CreateXMLNode()

Syntax

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

Parameters

ParentNode 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.
Name$ The node name$. Can be an empty string if the node name isn't required.
PreviousNode (optional) 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 (optional) 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.

Return value

The new XML node if it was created successfully or zero if no node could be inserted at this point.

Remarks

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

See Also

DeleteXMLNode()

Supported OS

All

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