1 \section{\class{wxXmlNode
}}\label{wxxmlnode
}
3 Represents a node in an XML
document. See
\helpref{wxXmlDocument
}{wxxmldocument
}.
5 Node has a name and may have content
6 and properties. Most common node types are
{\tt wxXML
\_TEXT\_NODE} (name and
7 properties are irrelevant) and
{\tt wxXML
\_ELEMENT\_NODE} (e.g. in
{\tt <title>hi</title>
} there is
8 an element with name="title", irrelevant content and one child (
{\tt wxXML
\_TEXT\_NODE}
11 If wxUSE
\_UNICODE is
0, all strings are encoded in the encoding given to Load
15 \wxheading{Derived from
}
19 \wxheading{Include files
}
25 The following are the node types supported by wxXmlNode:
34 wxXML_CDATA_SECTION_NODE,
35 wxXML_ENTITY_REF_NODE,
40 wxXML_DOCUMENT_TYPE_NODE,
41 wxXML_DOCUMENT_FRAG_NODE,
43 wxXML_HTML_DOCUMENT_NODE
50 \helpref{wxXmlDocument
}{wxxmldocument
},
\helpref{wxXmlProperty
}{wxxmlproperty
}
53 \latexignore{\rtfignore{\wxheading{Members
}}}
56 \membersection{wxXmlNode::wxXmlNode
}\label{wxxmlnodewxxmlnode
}
59 \func{}{wxXmlNode
}{\param{wxXmlNode*
}{parent
},
\param{wxXmlNodeType
}{type
},
\param{const wxString\&
}{name
},
\param{const wxString\&
}{content = wxEmptyString
},
\param{wxXmlProperty*
}{props = NULL
},
\param{wxXmlNode*
}{next = NULL
}}
61 \wxheading{Parameters
}
63 \docparam{parent
}{The parent node. Can be NULL.
}
64 \docparam{type
}{One of the wxXmlNodeType enumeration value.
}
65 \docparam{name
}{The name of the node. This is the string which appears between angular brackets.
}
66 \docparam{content
}{The content of the node. Only meaningful when
{\it type
} is
{\tt wxXML
\_TEXT\_NODE} or
{\tt wxXML
\_CDATA\_SECTION\_NODE}.
}
67 \docparam{props
}{If not NULL, this wxXmlProperty object and its eventual siblings are attached to
69 \docparam{next
}{If not NULL, this node and its eventual siblings are attached to
72 \func{}{wxXmlNode
}{\param{const wxXmlNode\&
}{node
}}
74 Copy constructor. Note that this does NOT copy syblings
75 and parent pointer, i.e.
\helpref{GetParent()
}{wxxmlnodegetparent
} and
\helpref{GetNext()
}{wxxmlnodegetnext
} will return NULL
76 after using copy ctor and are never unmodified by operator=.
78 On the other hand, it DOES copy children and properties.
81 \func{}{wxXmlNode
}{\param{wxXmlNodeType
}{type
},
\param{const wxString\&
}{name
},
\param{const wxString\&
}{content = wxEmptyString
}}
83 A simplified version of the first constructor form.
86 \membersection{wxXmlNode::
\destruct{wxXmlNode
}}\label{wxxmlnodedtor
}
88 \func{}{\destruct{wxXmlNode
}}{\void}
90 The virtual destructor. Deletes attached children and properties.
92 \membersection{wxXmlNode::AddChild
}\label{wxxmlnodeaddchild
}
94 \func{void
}{AddChild
}{\param{wxXmlNode*
}{child
}}
96 Adds the given node as child of this node. To attach a second children to this node, use the
97 \helpref{SetNext()
}{wxxmlnodesetnext
} function of the
{\it child
} node.
99 \membersection{wxXmlNode::AddProperty
}\label{wxxmlnodeaddproperty
}
101 \func{void
}{AddProperty
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{value
}}
103 Appends a property with given
{\it name
} and
{\it value
} to the list of properties for this node.
105 \func{void
}{AddProperty
}{\param{wxXmlProperty*
}{prop
}}
107 Appends the given property to the list of properties for this node.
109 \membersection{wxXmlNode::DeleteProperty
}\label{wxxmlnodedeleteproperty
}
111 \func{bool
}{DeleteProperty
}{\param{const wxString\&
}{name
}}
113 Removes the first properties which has the given
{\it name
} from the list of properties for this node.
115 \membersection{wxXmlNode::GetChildren
}\label{wxxmlnodegetchildren
}
117 \constfunc{wxXmlNode*
}{GetChildren
}{\void}
119 Returns the first child of this node.
120 To get a pointer to the second child of this node (if it does exist), use the
121 \helpref{GetNext()
}{wxxmlnodegetnext
} function on the returned value.
123 \membersection{wxXmlNode::GetContent
}\label{wxxmlnodegetcontent
}
125 \constfunc{wxString
}{GetContent
}{\void}
127 Returns the content of this node. Can be an empty string.
129 \membersection{wxXmlNode::GetName
}\label{wxxmlnodegetname
}
131 \constfunc{wxString
}{GetName
}{\void}
133 Returns the name of this node. Can be an empty string (e.g. for nodes of type
{\tt wxXML
\_TEXT\_NODE} or
{\tt wxXML
\_CDATA\_SECTION\_NODE}).
135 \membersection{wxXmlNode::GetNext
}\label{wxxmlnodegetnext
}
137 \constfunc{wxXmlNode*
}{GetNext
}{\void}
139 Returns a pointer to the sibling of this node or NULL if there are no siblings.
141 \membersection{wxXmlNode::GetParent
}\label{wxxmlnodegetparent
}
143 \constfunc{wxXmlNode*
}{GetParent
}{\void}
145 Returns a pointer to the parent of this node or NULL if this node has no parent.
147 \membersection{wxXmlNode::GetPropVal
}\label{wxxmlnodegetpropval
}
149 \constfunc{bool
}{GetPropVal
}{\param{const wxString\&
}{propName
},
\param{wxString*
}{value
}}
151 Returns
\true if a property named
{\it propName
} could be found.
152 If the
{\it value
} pointer is not NULL, the value of that property is saved there.
154 \constfunc{wxString
}{GetPropVal
}{\param{const wxString\&
}{propName
},
\param{const wxString\&
}{defaultVal
}}
156 Returns the value of the property named
{\it propName
} if it does exist.
157 If it does not exist, the
{\it defaultVal
} is returned.
159 \membersection{wxXmlNode::GetProperties
}\label{wxxmlnodegetproperties
}
161 \constfunc{wxXmlProperty*
}{GetProperties
}{\void}
163 Return a pointer to the first property of this node.
165 \membersection{wxXmlNode::GetType
}\label{wxxmlnodegettype
}
167 \constfunc{wxXmlNodeType
}{GetType
}{\void}
169 Returns the type of this node.
172 \membersection{wxXmlNode::HasProp
}\label{wxxmlnodehasprop
}
174 \constfunc{bool
}{HasProp
}{\param{const wxString\&
}{propName
}}
176 Returns
\true if this node has a property named
{\it propName
}.
178 \membersection{wxXmlNode::InsertChild
}\label{wxxmlnodeinsertchild
}
180 \func{void
}{InsertChild
}{\param{wxXmlNode*
}{child
},
\param{wxXmlNode*
}{before
\_node}}
182 Inserts the
{\it child
} node after
{\it before
\_node} in the children list.
184 \membersection{wxXmlNode::RemoveChild
}\label{wxxmlnoderemovechild
}
186 \func{bool
}{RemoveChild
}{\param{wxXmlNode*
}{child
}}
188 Removes the given node from the children list. Returns
\true if the node was found and removed
189 or
\false if the node could not be found.
191 \membersection{wxXmlNode::SetChildren
}\label{wxxmlnodesetchildren
}
193 \func{void
}{SetChildren
}{\param{wxXmlNode*
}{child
}}
195 Sets as first child the given node. The caller is responsible to delete any previously present
198 \membersection{wxXmlNode::SetContent
}\label{wxxmlnodesetcontent
}
200 \func{void
}{SetContent
}{\param{const wxString\&
}{con
}}
202 Sets the content of this node.
204 \membersection{wxXmlNode::SetName
}\label{wxxmlnodesetname
}
206 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
208 Sets the name of this node.
210 \membersection{wxXmlNode::SetNext
}\label{wxxmlnodesetnext
}
212 \func{void
}{SetNext
}{\param{wxXmlNode*
}{next
}}
214 Sets as sibling the given node. The caller is responsible to delete any previously present
217 \membersection{wxXmlNode::SetParent
}\label{wxxmlnodesetparent
}
219 \func{void
}{SetParent
}{\param{wxXmlNode*
}{parent
}}
221 Sets as parent the given node. The caller is responsible to delete any previously present
224 \membersection{wxXmlNode::SetProperties
}\label{wxxmlnodesetproperties
}
226 \func{void
}{SetProperties
}{\param{wxXmlProperty*
}{prop
}}
228 Sets as first property the given wxXmlProperty object.
229 The caller is responsible to delete any previously present properties attached to this node.
231 \membersection{wxXmlNode::SetType
}\label{wxxmlnodesettype
}
233 \func{void
}{SetType
}{\param{wxXmlNodeType
}{type
}}
235 Sets the type of this node.
237 \membersection{wxXmlNode::operator=
}\label{wxxmlnodeoperatorassign
}
239 \func{wxXmlNode\& operator
}{operator=
}{\param{const wxXmlNode\&
}{node
}}
241 See the copy constructor for more info.