%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Name: xmlnode.tex
+%% Name: xmldocument.tex
%% Purpose: wxXmlDocument documentation
%% Author: Francesco Montorsi
%% Created: 2006-04-18
...
- // process properties of <tag1>
- wxString propvalue1 = child->GetPropVal(wxT("prop1"), wxT("default-value"));
- wxString propvalue2 = child->GetPropVal(wxT("prop2"), wxT("default-value"));
+ // process attributes of <tag1>
+ wxString attrvalue1 =
+ child->GetAttribute(wxT("attr1"),
+ wxT("default-value"));
+ wxString attrvalue2 =
+ child->GetAttribute(wxT("attr2"),
+ wxT("default-value"));
...
\begin{verbatim}
wxXmlDocument doc;
doc.Load(wxT("myfile.xml"), wxT("UTF-8"), wxXMLDOC_KEEP_WHITESPACE_NODES);
-doc.Save(wxT("myfile2.xml"), wxXML_NO_INDENTATION); // myfile2.xml will be indentic to myfile.xml
+
+// myfile2.xml will be indentic to myfile.xml saving it this way:
+doc.Save(wxT("myfile2.xml"), wxXML_NO_INDENTATION);
\end{verbatim}
Using default parameters, you will get a reformatted document which in general is different from
\begin{verbatim}
wxXmlDocument doc;
doc.Load(wxT("myfile.xml"));
-doc.Save(wxT("myfile2.xml")); // myfile2.xml != myfile.xml
+doc.Save(wxT("myfile2.xml")); // myfile2.xml != myfile.xml
\end{verbatim}
<wx/xml/xml.h>
+\wxheading{Library}
+
+\helpref{wxXml}{librarieslist}
+
\wxheading{See also}
-\helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlProperty}{wxxmlproperty}
+\helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlAttribute}{wxxmlattribute}
\latexignore{\rtfignore{\wxheading{Members}}}
\func{}{wxXmlDocument}{\param{const wxString\& }{filename}, \param{const wxString\& }{encoding = wxT("UTF-8")}, \param{int }{flags = wxXMLDOC\_NONE}}
-Loads the given {\it filename} using the given encoding. See \helpref{Load()}{wxxmldocumentload}.
+Loads the given {\it filename} using the given encoding. See \helpref{Load}{wxxmldocumentload}.
\func{}{wxXmlDocument}{\param{wxInputStream\& }{stream}, \param{const wxString\& }{encoding = wxT("UTF-8")}, \param{int }{flags = wxXMLDOC\_NONE}}
-Loads the XML document from given stream using the given encoding. See \helpref{Load()}{wxxmldocumentload}.
+Loads the XML document from given stream using the given encoding. See \helpref{Load}{wxxmldocumentload}.
\func{}{wxXmlDocument}{\param{const wxXmlDocument\& }{doc}}
-Copy constructor.
+Copy constructor. Deep copies all the XML tree of the given document.
\membersection{wxXmlDocument::\destruct{wxXmlDocument}}\label{wxxmldocumentdtor}
\constfunc{wxString}{GetEncoding}{\void}
Returns encoding of in-memory representation of the document
-(same as passed to \helpref{Load()}{wxxmldocumentload} or constructor, defaults to UTF-8).
+(same as passed to \helpref{Load}{wxxmldocumentload} or constructor, defaults to UTF-8).
-NB: this is meaningless in Unicode build where data are stored as wchar\_t*.
+NB: this is meaningless in Unicode build where data are stored as {\tt wchar\_t*}.
Returns encoding of document (may be empty).
-Note: this is the encoding original file was saved in, *not* the
+Note: this is the encoding original file was saved in, {\bf not} the
encoding of in-memory representation!
Returns the version of document.
This is the value in the {\tt <?xml version="1.0"?>} header of the XML document.
-If the version property was not explicitely given in the header, this function
+If the version attribute was not explicitely given in the header, this function
returns an empty string.
\func{void}{SetRoot}{\param{wxXmlNode* }{node}}
Sets the root node of this document. Deletes previous root node.
-Use \helpref{DetachRoot}{wxxmldocumentdetachroot} and then SetRoot if you want
+Use \helpref{DetachRoot}{wxxmldocumentdetachroot} and then
+\helpref{SetRoot}{wxxmldocumentsetroot} if you want
to replace the root node without deleting the old document tree.
\func{wxXmlDocument\& operator}{operator=}{\param{const wxXmlDocument\& }{doc}}
-Copies the given document.
+Deep copies the given document.