Detailed Description

Most common node types are wxXML_TEXT_NODE (name and attributes are irrelevant) and wxXML_ELEMENT_NODE.

Example: in <title>hi</title> there is an element with the name title and irrelevant content and one child of type wxXML_TEXT_NODE with hi as content.

The wxXML_PI_NODE type sets the name to the PI target and the contents to the instructions. Note that whilst the PI instructions are often in the form of pseudo-attributes these do not use the nodes attribute system. It is the users responsibility to code and decode the instruction text.

If wxUSE_UNICODE is 0, all strings are encoded in the encoding given to wxXmlDocument::Load (default is UTF-8).

Constructor & Destructor Documentation

Creates this XML node and eventually insert it into an existing XML tree.

Parameters

parent

The parent node to which append this node instance. If this argument is NULL this new node will be floating and it can be appended later to another one using the AddChild() or InsertChild() functions. Otherwise the child is already added to the XML tree by this constructor and it shouldn't be done again.

Note that this does NOT copy siblings and parent pointer, i.e. GetParent() and GetNext() will return NULL after using copy ctor and are never unmodified by operator=(). On the other hand, it DOES copy children and attributes.

Note that this function works in O(n) time where n is the number of existing children. Consequently, adding large number of child nodes using this method can be expensive, because it has O(n^2) time complexity in number of nodes to be added. Use InsertChildAfter() to populate XML tree in linear time.

Inserts the child node immediately before followingNode in the children list.

Returns

true if followingNode has been found and the child node has been inserted.

Note

For historical reasons, followingNode may be NULL. In that case, then child is prepended to the list of children and becomes the first child of this node, i.e. it behaves identically to using the first children (as returned by GetChildren()) for followingNode).