/usr/share/qt5/doc/qtxmlpatterns/qxmlserializer.html is in qtxmlpatterns5-doc-html 5.5.1-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qxmlserializer.cpp -->
<title>QXmlSerializer Class | Qt XML Patterns 5.5</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.5</li>
<li><a href="qtxmlpatterns-index.html">Qt XML Patterns</a></li>
<li><a href="qtxmlpatterns-module.html">C++ Classes</a></li>
<li>QXmlSerializer</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QXmlSerializer Class</h1>
<!-- $$$QXmlSerializer-brief -->
<p>The <a href="qxmlserializer.html">QXmlSerializer</a> class is an implementation of <a href="qabstractxmlreceiver.html">QAbstractXmlReceiver</a> for transforming <a href="xmlprocessing.html">XQuery</a> output into unformatted XML. <a href="#details">More...</a></p>
<!-- @@@QXmlSerializer -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QXmlSerializer></span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += xmlpatterns</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 4.4</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qabstractxmlreceiver.html">QAbstractXmlReceiver</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qxmlformatter.html">QXmlFormatter</a></p>
</td></tr></table></div><p><b>Note:</b> All functions in this class are reentrant.</p>
<ul>
<li><a href="qxmlserializer-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#QXmlSerializer">QXmlSerializer</a></b>(const QXmlQuery &<i> query</i>, QIODevice *<i> outputDevice</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QTextCodec * </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#codec">codec</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIODevice * </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#outputDevice">outputDevice</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#setCodec">setCodec</a></b>(const QTextCodec *<i> outputCodec</i>)</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#atomicValue">atomicValue</a></b>(const QVariant &<i> value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#attribute">attribute</a></b>(const QXmlName &<i> name</i>, const QStringRef &<i> value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#characters">characters</a></b>(const QStringRef &<i> value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#comment">comment</a></b>(const QString &<i> value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#endDocument">endDocument</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#endElement">endElement</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#endOfSequence">endOfSequence</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#namespaceBinding">namespaceBinding</a></b>(const QXmlName &<i> nb</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#processingInstruction">processingInstruction</a></b>(const QXmlName &<i> name</i>, const QString &<i> value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#startDocument">startDocument</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#startElement">startElement</a></b>(const QXmlName &<i> name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlserializer.html#startOfSequence">startOfSequence</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">12 public functions inherited from <a href="qabstractxmlreceiver.html#public-functions">QAbstractXmlReceiver</a></li>
</ul>
<a name="details"></a>
<!-- $$$QXmlSerializer-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qxmlserializer.html">QXmlSerializer</a> class is an implementation of <a href="qabstractxmlreceiver.html">QAbstractXmlReceiver</a> for transforming <a href="xmlprocessing.html">XQuery</a> output into unformatted XML.</p>
<p><a href="qxmlserializer.html">QXmlSerializer</a> translates an <a href="qabstractxmlreceiver.html#xquery-sequence">XQuery sequence</a>, usually the output of an <a href="qxmlquery.html">QXmlQuery</a>, into XML. Consider the example:</p>
<pre class="cpp"><span class="type"><a href="qxmlquery.html">QXmlQuery</a></span> query;
query<span class="operator">.</span>setQuery(<span class="string">"doc('index.html')/html/body/p[1]"</span>);
<span class="type"><a href="qxmlserializer.html#QXmlSerializer">QXmlSerializer</a></span> serializer(query<span class="operator">,</span> myOutputDevice);
query<span class="operator">.</span>evaluateTo(<span class="operator">&</span>serializer);</pre>
<p>First it constructs a <a href="qxmlquery.html">query</a> that gets the first paragraph from document <code>index.html</code>. Then it constructs an instance of this class with the <a href="qxmlquery.html">query</a> and myOutputDevice. Finally, it <a href="qxmlquery.html#evaluateTo">evaluates</a> the <a href="qxmlquery.html">query</a>, 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.</p>
<p><a href="qxmlserializer.html">QXmlSerializer</a> will:</p>
<ul>
<li>Declare namespaces when needed,</li>
<li>Use appropriate escaping, when characters can't be represented in the XML,</li>
<li>Handle line endings appropriately,</li>
<li>Report errors, when it can't serialize the content, e.g., when asked to serialize an attribute that is a top-level node, or when more than one top-level element is encountered.</li>
</ul>
<p>If an error occurs during serialization, result is undefined unless the serializer is driven through a call to <a href="qxmlquery.html#evaluateTo">QXmlQuery::evaluateTo</a>().</p>
<p>If the generated XML should be indented and formatted for reading, use <a href="qxmlformatter.html">QXmlFormatter</a>.</p>
</div>
<p><b>See also </b><a href="http://www.w3.org/TR/xslt-xquery-serialization/">XSLT 2.0 and XQuery 1.0 Serialization</a> and <a href="qxmlformatter.html">QXmlFormatter</a>.</p>
<!-- @@@QXmlSerializer -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QXmlSerializer[overload1]$$$QXmlSerializerconstQXmlQuery&QIODevice* -->
<h3 class="fn" id="QXmlSerializer"><a name="QXmlSerializer"></a>QXmlSerializer::<span class="name">QXmlSerializer</span>(const <span class="type"><a href="qxmlquery.html">QXmlQuery</a></span> &<i> query</i>, <span class="type">QIODevice</span> *<i> outputDevice</i>)</h3>
<p>Constructs a serializer that uses the name pool and message handler in <i>query</i>, and writes the output to <i>outputDevice</i>.</p>
<p><i>outputDevice</i> must be a valid, non-null device that is open in write mode, otherwise behavior is undefined.</p>
<p><i>outputDevice</i> must not be opened with QIODevice::Text because it will cause the output to be incorrect. This class will ensure line endings are serialized as according with the XML specification. <a href="qxmlserializer.html">QXmlSerializer</a> does not take ownership of <i>outputDevice</i>.</p>
<!-- @@@QXmlSerializer -->
<!-- $$$atomicValue[overload1]$$$atomicValueconstQVariant& -->
<h3 class="fn" id="atomicValue"><a name="atomicValue"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">atomicValue</span>(const <span class="type">QVariant</span> &<i> value</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#atomicValue">QAbstractXmlReceiver::atomicValue</a>().</p>
<!-- @@@atomicValue -->
<!-- $$$attribute[overload1]$$$attributeconstQXmlName&constQStringRef& -->
<h3 class="fn" id="attribute"><a name="attribute"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">attribute</span>(const <span class="type"><a href="qxmlname.html">QXmlName</a></span> &<i> name</i>, const <span class="type">QStringRef</span> &<i> value</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#attribute">QAbstractXmlReceiver::attribute</a>().</p>
<!-- @@@attribute -->
<!-- $$$characters[overload1]$$$charactersconstQStringRef& -->
<h3 class="fn" id="characters"><a name="characters"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">characters</span>(const <span class="type">QStringRef</span> &<i> value</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#characters">QAbstractXmlReceiver::characters</a>().</p>
<!-- @@@characters -->
<!-- $$$codec[overload1]$$$codec -->
<h3 class="fn" id="codec"><a name="codec"></a>const <span class="type">QTextCodec</span> * QXmlSerializer::<span class="name">codec</span>() const</h3>
<p>Returns the codec being used by the serializer for encoding its XML output.</p>
<p><b>See also </b><a href="qxmlserializer.html#setCodec">setCodec</a>().</p>
<!-- @@@codec -->
<!-- $$$comment[overload1]$$$commentconstQString& -->
<h3 class="fn" id="comment"><a name="comment"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">comment</span>(const <span class="type">QString</span> &<i> value</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#comment">QAbstractXmlReceiver::comment</a>().</p>
<!-- @@@comment -->
<!-- $$$endDocument[overload1]$$$endDocument -->
<h3 class="fn" id="endDocument"><a name="endDocument"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">endDocument</span>()</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#endDocument">QAbstractXmlReceiver::endDocument</a>().</p>
<!-- @@@endDocument -->
<!-- $$$endElement[overload1]$$$endElement -->
<h3 class="fn" id="endElement"><a name="endElement"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">endElement</span>()</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#endElement">QAbstractXmlReceiver::endElement</a>().</p>
<!-- @@@endElement -->
<!-- $$$endOfSequence[overload1]$$$endOfSequence -->
<h3 class="fn" id="endOfSequence"><a name="endOfSequence"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">endOfSequence</span>()</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#endOfSequence">QAbstractXmlReceiver::endOfSequence</a>().</p>
<!-- @@@endOfSequence -->
<!-- $$$namespaceBinding[overload1]$$$namespaceBindingconstQXmlName& -->
<h3 class="fn" id="namespaceBinding"><a name="namespaceBinding"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">namespaceBinding</span>(const <span class="type"><a href="qxmlname.html">QXmlName</a></span> &<i> nb</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#namespaceBinding">QAbstractXmlReceiver::namespaceBinding</a>().</p>
<!-- @@@namespaceBinding -->
<!-- $$$outputDevice[overload1]$$$outputDevice -->
<h3 class="fn" id="outputDevice"><a name="outputDevice"></a><span class="type">QIODevice</span> * QXmlSerializer::<span class="name">outputDevice</span>() const</h3>
<p>Returns a pointer to the output device. There is no corresponding function to <i>set</i> the output device, because the output device must be passed to the constructor. The serializer does not take ownership of its IO device.</p>
<!-- @@@outputDevice -->
<!-- $$$processingInstruction[overload1]$$$processingInstructionconstQXmlName&constQString& -->
<h3 class="fn" id="processingInstruction"><a name="processingInstruction"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">processingInstruction</span>(const <span class="type"><a href="qxmlname.html">QXmlName</a></span> &<i> name</i>, const <span class="type">QString</span> &<i> value</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#processingInstruction">QAbstractXmlReceiver::processingInstruction</a>().</p>
<!-- @@@processingInstruction -->
<!-- $$$setCodec[overload1]$$$setCodecconstQTextCodec* -->
<h3 class="fn" id="setCodec"><a name="setCodec"></a><span class="type">void</span> QXmlSerializer::<span class="name">setCodec</span>(const <span class="type">QTextCodec</span> *<i> outputCodec</i>)</h3>
<p>Sets the codec the serializer will use for encoding its XML output. The output codec is set to <i>outputCodec</i>. By default, the output codec is set to the one for <code>UTF-8</code>. The serializer does not take ownership of the codec.</p>
<p><b>See also </b><a href="qxmlserializer.html#codec">codec</a>().</p>
<!-- @@@setCodec -->
<!-- $$$startDocument[overload1]$$$startDocument -->
<h3 class="fn" id="startDocument"><a name="startDocument"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">startDocument</span>()</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#startDocument">QAbstractXmlReceiver::startDocument</a>().</p>
<!-- @@@startDocument -->
<!-- $$$startElement[overload1]$$$startElementconstQXmlName& -->
<h3 class="fn" id="startElement"><a name="startElement"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">startElement</span>(const <span class="type"><a href="qxmlname.html">QXmlName</a></span> &<i> name</i>)</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#startElement">QAbstractXmlReceiver::startElement</a>().</p>
<!-- @@@startElement -->
<!-- $$$startOfSequence[overload1]$$$startOfSequence -->
<h3 class="fn" id="startOfSequence"><a name="startOfSequence"></a><code>[virtual] </code><span class="type">void</span> QXmlSerializer::<span class="name">startOfSequence</span>()</h3>
<p>Reimplemented from <a href="qabstractxmlreceiver.html#startOfSequence">QAbstractXmlReceiver::startOfSequence</a>().</p>
<!-- @@@startOfSequence -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|