Commit f99c5e51 authored by Nico Vertriest's avatar Nico Vertriest Committed by The Qt Project
Browse files

Added section on XML in Qt


Spelling corrections suggested by M.Curtis

Change-Id: I22a4b1365d966c2a35eab7479652a2759595f2fc
Reviewed-by: default avatarMartin Smith <martin.smith@digia.com>
Reviewed-by: default avatarJerome Pasion <jerome.pasion@digia.com>
parent 111a5843
dev 5.10 5.11 5.12 5.12.1 5.12.10 5.12.11 5.12.12 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.13 5.13.0 5.13.1 5.13.2 5.14 5.14.0 5.14.1 5.14.2 5.15 5.15.0 5.15.1 5.15.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.9.8 6.0 6.0.0 6.1 6.1.0 6.1.1 6.1.2 6.1.3 6.2 6.2.0 6.2.1 6.2.2 old/5.0 old/5.1 old/5.2 tqtc/vxworks-5.5 wip/android v5.15.0-alpha1 v5.14.1 v5.14.0 v5.14.0-rc2 v5.14.0-rc1 v5.14.0-beta3 v5.14.0-beta2 v5.14.0-beta1 v5.14.0-alpha1 v5.13.2 v5.13.1 v5.13.0 v5.13.0-rc3 v5.13.0-rc2 v5.13.0-rc1 v5.13.0-beta4 v5.13.0-beta3 v5.13.0-beta2 v5.13.0-beta1 v5.13.0-alpha1 v5.12.7 v5.12.6 v5.12.5 v5.12.4 v5.12.3 v5.12.2 v5.12.1 v5.12.0 v5.12.0-rc2 v5.12.0-rc1 v5.12.0-beta4 v5.12.0-beta3 v5.12.0-beta2 v5.12.0-beta1 v5.12.0-alpha1 v5.11.3 v5.11.2 v5.11.1 v5.11.0 v5.11.0-rc2 v5.11.0-rc1 v5.11.0-beta4 v5.11.0-beta3 v5.11.0-beta2 v5.11.0-beta1 v5.11.0-alpha1 v5.10.1 v5.10.0 v5.10.0-rc3 v5.10.0-rc2 v5.10.0-rc1 v5.10.0-beta4 v5.10.0-beta3 v5.10.0-beta2 v5.10.0-beta1 v5.10.0-alpha1 v5.9.9 v5.9.8 v5.9.7 v5.9.6 v5.9.5 v5.9.4 v5.9.3 v5.9.2 v5.9.1 v5.9.0 v5.9.0-rc2 v5.9.0-rc1 v5.9.0-beta4 v5.9.0-beta3 v5.9.0-beta2 v5.9.0-beta1 v5.9.0-alpha1 v5.8.0 v5.8.0-rc1 v5.8.0-beta1 v5.8.0-alpha1 v5.7.1 v5.7.0 v5.7.0-rc1 v5.7.0-beta1 v5.7.0-alpha1 v5.6.3 v5.6.2 v5.6.1 v5.6.1-1 v5.6.0 v5.6.0-rc1 v5.6.0-beta1 v5.6.0-alpha1 v5.5.1 v5.5.0 v5.5.0-rc1 v5.5.0-beta1 v5.5.0-alpha1 v5.4.2 v5.4.1 v5.4.0 v5.4.0-rc1 v5.4.0-beta1 v5.4.0-alpha1 v5.3.2 v5.3.1 v5.3.0 v5.3.0-rc1 v5.3.0-beta1 v5.3.0-alpha1 v5.2.1 v5.2.0 v5.2.0-rc1 v5.2.0-beta1 v5.2.0-alpha1 v5.1.1 v5.1.0 v5.1.0-rc2 v5.1.0-rc1 v5.1.0-beta1 v5.1.0-alpha1 v5.0.2 v5.0.1 v5.0.0 v5.0.0-rc2 v5.0.0-rc1
No related merge requests found
Showing with 32 additions and 5 deletions
......@@ -134,11 +134,38 @@ cation might freeze until one transaction commits or rolls back.
\section1 XML Support in Qt
### Talk briefly about XML as a storage format and mention main classes QXMLStreamReader and
QXMLStreamWriter, as well as XML usage in QML.
In addition, make sure the following pages are reachable from this section, either directly
or indirectly:
The QXmlStreamReader class provides a fast parser for reading XML via a simple
streaming API. QXmlStreamReader is a well-formed XML 1.0 parser that does not
include external parsed entities. As long as no error occurs, the application
code can assume that the XML follows W3C's standards.
QXmlStreamReader understands and resolves XML namespaces. For example, in
case of a StartElement, namespaceUri() returns the namespace the element
is in, and name() returns the element's local name. The combination of
namespaceUri() and name() uniquely identifies an element.
QXmlStreamReader does not put a high load on the CPU, since it doesn't store
the entire XML document tree in memory, but only the current token at the time
it is reported.
The QXmlStreamWriter class provides an XML writer with a simple streaming API.
QXmlStreamWriter is the counterpart to QXmlStreamReader for writing XML.
It operates on a QIODevice specified with setDevice(). The API is quite simple:
for every XML token or event you want to write, the writer provides a dedicated
function.
QXmlStreamWriter takes care of prefixing namespaces, all you have to do
is specify the namespaceUri when writing elements or attributes. If you
have to use certain standardized prefixes, you can force the writer to use them
by declaring the namespaces manually with either writeNamespace()
or writeDefaultNamespace().
The stream writer can automatically format the generated XML data by adding
line-breaks and indentation, making the code much more readable. This feature
can be turned on with the auto-formatting property.
By default, QXmlStreamWriter encodes XML in UTF-8. Different encodings can
be enforced using setCodec().
\list
\li \l {An Introduction to Namespaces}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment