diff options
Diffstat (limited to 'src/xml/doc/src/xml-processing.qdoc')
-rw-r--r-- | src/xml/doc/src/xml-processing.qdoc | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/src/xml/doc/src/xml-processing.qdoc b/src/xml/doc/src/xml-processing.qdoc index b98749ca41..acca1b070b 100644 --- a/src/xml/doc/src/xml-processing.qdoc +++ b/src/xml/doc/src/xml-processing.qdoc @@ -7,7 +7,7 @@ \brief Classes that support XML. - These classes are relevant to XML users. + These classes are relevant to \l{XML Processing}{XML} users. \generatelist{related} */ @@ -15,6 +15,7 @@ /*! \page xml-processing.html \title XML Processing + \ingroup explanations-dataprocessingandio \brief An Overview of the XML processing facilities in Qt. @@ -180,7 +181,7 @@ namespace prefix. In this case the local part and the qualified name are identical (i.e. \e chapter). - \sa {DOM Bookmarks Example} + \sa {DOM Bookmarks Application} */ /*! @@ -191,7 +192,8 @@ \nextpage Working with the DOM Tree Qt provides two classes for reading and writing XML through a simple streaming - API: QXmlStreamReader and QXmlStreamWriter. + API: QXmlStreamReader and QXmlStreamWriter. These classes are located in + \l{Qt Serialization}{Qt Serialization (part of QtCore)}. A stream reader reports an XML document as a stream of tokens. This differs from SAX as SAX applications provide handlers to @@ -207,27 +209,14 @@ \l{QXmlStreamReader::error()}{error()} and \l{QXmlStreamReader::hasError()} {hasError()} can be used to check and view the errors. - An example of QXmlStreamReader implementation would be the \c XbelReader in - \l{QXmlStream Bookmarks Example}, which wraps a QXmlStreamReader. - The constructor takes \a treeWidget as a parameter and the class has Xbel - specific functions: - - \snippet streambookmarks/xbelreader.h 1 - - \dots - \snippet streambookmarks/xbelreader.h 2 - \dots + An example of an implementation tha uses QXmlStreamReader would be the + \l{QXmlStream Bookmarks Example#xbelreader-class-definition}{XbelReader} in + \l{QXmlStream Bookmarks Example}, which wraps a QXmlStreamReader. Read the + \l{QXmlStream Bookmarks Example#xbelreader-class-implementation}{implementation} + to learn more about how to use the QXmlStreamReader class. - The \c read() function accepts a QIODevice and sets it with - \l{QXmlStreamReader::setDevice()}{setDevice()}. The - \l{QXmlStreamReader::raiseError()}{raiseError()} function is used to - display a custom error message, inidicating that the file's version - is incorrect. - - \snippet streambookmarks/xbelreader.cpp 1 - - The pendent to QXmlStreamReader is QXmlStreamWriter, which provides an XML - writer with a simple streaming API. QXmlStreamWriter operates on a + Paired with QXmlStreamReader is the QXmlStreamWriter class, which provides + an XML writer with a simple streaming API. QXmlStreamWriter operates on a QIODevice and has specialized functions for all XML tokens or events you want to write, such as \l{QXmlStreamWriter::writeDTD()}{writeDTD()}, \l{QXmlStreamWriter::writeCharacters()}{writeCharacters()}, @@ -253,11 +242,10 @@ or subsequent calls to \l{QXmlStreamWriter::writeStartElement()} {writeStartElement()}. - The \c XbelWriter class from \l{QXmlStream Bookmarks Example} wraps a - QXmlStreamWriter. Its \c writeFile() function illustrates the core - functions of QXmlStreamWriter mentioned above: - - \snippet streambookmarks/xbelwriter.cpp 1 + The \l{QXmlStream Bookmarks Example#xbelwriter-class-definition}{XbelWriter} + class from \l{QXmlStream Bookmarks Example} wraps a QXmlStreamWriter. View + the \l{QXmlStream Bookmarks Example#xbelwriter-class-implementation}{implementation} + to see how to use the QXmlStreamWriter class. */ /*! @@ -352,7 +340,7 @@ DOM implementation. To get started please refer to the \l QDomDocument documentation. - You might also want to take a look at the \l{DOM Bookmarks Example}, + You might also want to take a look at the \l{DOM Bookmarks Application}, which illustrates how to read and write an XML bookmark file (XBEL) using DOM. */ |