QXmlSerializer Class ReferenceThe QXmlSerializer class is an implementation of QAbstractXmlReceiver for transforming XQuery output into unformatted XML. More... #include <QXmlSerializer> Inherits: QAbstractXmlReceiver. Inherited by: QXmlFormatter. Note: All functions in this class are reentrant. This class was introduced in Qt 4.4. Public Functions
Reimplemented Public Functions
Detailed DescriptionThe QXmlSerializer class is an implementation of QAbstractXmlReceiver for transforming XQuery output into unformatted XML. QXmlSerializer translates an XQuery sequence, usually the output of an QXmlQuery, into XML. Consider the example: QXmlQuery query; query.setQuery("doc('index.html')/html/body/p[1]"); QXmlSerializer serializer(query, myOutputDevice); query.evaluateTo(&serializer); First it constructs a query that gets the first paragraph from document index.html. Then it constructs an instance of this class with the query and myOutputDevice. Finally, it evaluates the query, producing an ordered sequence of calls to the serializer's callback functions. The sequence of callbacks transforms the query output to XML and writes it to myOutputDevice. QXmlSerializer will:
If an error occurs during serialization, result is undefined unless the serializer is driven through a call to QXmlQuery::evaluateTo(). If the generated XML should be indented and formatted for reading, use QXmlFormatter. See also XSLT 2.0 and XQuery 1.0 Serialization and QXmlFormatter. Member Function Documentation
|