diff options
Diffstat (limited to 'src/xml/doc/src/xml-processing.qdoc')
-rw-r--r-- | src/xml/doc/src/xml-processing.qdoc | 74 |
1 files changed, 19 insertions, 55 deletions
diff --git a/src/xml/doc/src/xml-processing.qdoc b/src/xml/doc/src/xml-processing.qdoc index 226eeb196d..acca1b070b 100644 --- a/src/xml/doc/src/xml-processing.qdoc +++ b/src/xml/doc/src/xml-processing.qdoc @@ -1,29 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \group xml-tools @@ -31,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} */ @@ -39,6 +15,7 @@ /*! \page xml-processing.html \title XML Processing + \ingroup explanations-dataprocessingandio \brief An Overview of the XML processing facilities in Qt. @@ -204,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} */ /*! @@ -215,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 @@ -231,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()}, @@ -277,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. */ /*! @@ -376,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. */ |