6
6
td.postheader { font-family: sans-serif }
7
7
tr.address { font-family: sans-serif }
8
8
body { background: #ffffff; color: black; }
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QXmlStreamWriter Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QXmlStreamWriter class provides an XML writer with a simple streaming API. <a href="#details">More...</a></p>
10
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-2">__init__</a></b> (<i>self</i>, QIODevice)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-3">__init__</a></b> (<i>self</i>, QByteArray)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-4">__init__</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qxmlstreamwriter.html#autoFormatting">autoFormatting</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qxmlstreamwriter.html#autoFormattingIndent">autoFormattingIndent</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCodec <b><a href="qxmlstreamwriter.html#codec">codec</a></b> (<i>self</i>)</li><li><div class="fn" />QIODevice <b><a href="qxmlstreamwriter.html#device">device</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setAutoFormatting">setAutoFormatting</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setAutoFormattingIndent">setAutoFormattingIndent</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setCodec">setCodec</a></b> (<i>self</i>, QTextCodec)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setCodec-2">setCodec</a></b> (<i>self</i>, str)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setDevice">setDevice</a></b> (<i>self</i>, QIODevice)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttribute-2">writeAttribute</a></b> (<i>self</i>, QString, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttribute-3">writeAttribute</a></b> (<i>self</i>, QXmlStreamAttribute)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a></b> (<i>self</i>, QXmlStreamAttributes)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeCDATA">writeCDATA</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeComment">writeComment</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeCurrentToken">writeCurrentToken</a></b> (<i>self</i>, QXmlStreamReader)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeDefaultNamespace">writeDefaultNamespace</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeDTD">writeDTD</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEmptyElement-2">writeEmptyElement</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a></b> (<i>self</i>, QString, QString <i>prefix</i> = QString())</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeProcessingInstruction">writeProcessingInstruction</a></b> (<i>self</i>, QString, QString <i>data</i> = QString())</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartDocument-2">writeStartDocument</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartDocument-3">writeStartDocument</a></b> (<i>self</i>, QString, bool)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartElement-2">writeStartElement</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeTextElement">writeTextElement</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeTextElement-2">writeTextElement</a></b> (<i>self</i>, QString, QString, QString)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QXmlStreamWriter class provides an XML writer with a simple streaming API.</p>
11
<p>QXmlStreamWriter is the counterpart to <a href="qxmlstreamreader.html">QXmlStreamReader</a> for writing XML. Like its related class, it operates on a <a href="qiodevice.html">QIODevice</a> specified with <a href="qxmlstreamwriter.html#setDevice">setDevice</a>(). The API is simple and straightforward: for every XML token or event you want to write, the writer provides a specialized function.</p>
12
<p>You start a document with <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>() and end it with <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>(). This will implicitly close all remaining open tags.</p>
13
<p>Element tags are opened with <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() followed by <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() or <a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a>(), element content, and then <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>(). A shorter form <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>() can be used to write empty elements, followed by <a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a>().</p>
14
<p>Element content consists of either characters, entity references or nested elements. It is written with <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>(), which also takes care of escaping all forbidden characters and character sequences, <a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a>(), or subsequent calls to <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>(). A convenience method <a href="qxmlstreamwriter.html#writeTextElement">writeTextElement</a>() can be used for writing terminal elements that contain nothing but text.</p>
15
<p>The following abridged code snippet shows the basic use of the class to write formatted XML with indentation:</p>
16
<pre> QXmlStreamWriter stream(&output);
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QXmlStreamWriter Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QXmlStreamWriter class provides an XML writer with a simple
10
streaming API. <a href="#details">More...</a></p>
12
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-2">__init__</a></b> (<i>self</i>, QIODevice)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-3">__init__</a></b> (<i>self</i>, QByteArray)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#QXmlStreamWriter-4">__init__</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qxmlstreamwriter.html#autoFormatting">autoFormatting</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qxmlstreamwriter.html#autoFormattingIndent">autoFormattingIndent</a></b> (<i>self</i>)</li><li><div class="fn" />QTextCodec <b><a href="qxmlstreamwriter.html#codec">codec</a></b> (<i>self</i>)</li><li><div class="fn" />QIODevice <b><a href="qxmlstreamwriter.html#device">device</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setAutoFormatting">setAutoFormatting</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setAutoFormattingIndent">setAutoFormattingIndent</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setCodec">setCodec</a></b> (<i>self</i>, QTextCodec)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setCodec-2">setCodec</a></b> (<i>self</i>, str)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#setDevice">setDevice</a></b> (<i>self</i>, QIODevice)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttribute-2">writeAttribute</a></b> (<i>self</i>, QString, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttribute-3">writeAttribute</a></b> (<i>self</i>, QXmlStreamAttribute)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a></b> (<i>self</i>, QXmlStreamAttributes)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeCDATA">writeCDATA</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeComment">writeComment</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeCurrentToken">writeCurrentToken</a></b> (<i>self</i>, QXmlStreamReader)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeDefaultNamespace">writeDefaultNamespace</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeDTD">writeDTD</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEmptyElement-2">writeEmptyElement</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a></b> (<i>self</i>, QString, QString <i>prefix</i> = QString())</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeProcessingInstruction">writeProcessingInstruction</a></b> (<i>self</i>, QString, QString <i>data</i> = QString())</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartDocument-2">writeStartDocument</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartDocument-3">writeStartDocument</a></b> (<i>self</i>, QString, bool)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeStartElement-2">writeStartElement</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeTextElement">writeTextElement</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qxmlstreamwriter.html#writeTextElement-2">writeTextElement</a></b> (<i>self</i>, QString, QString, QString)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QXmlStreamWriter class provides an XML writer with a simple
14
<p>QXmlStreamWriter is the counterpart to <a href="qxmlstreamreader.html">QXmlStreamReader</a> for writing XML. Like
15
its related class, it operates on a <a href="qiodevice.html">QIODevice</a> specified with <a href="qxmlstreamwriter.html#setDevice">setDevice</a>(). The API is
16
simple and straightforward: for every XML token or event you want
17
to write, the writer provides a specialized function.</p>
18
<p>You start a document with <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>()
19
and end it with <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>().
20
This will implicitly close all remaining open tags.</p>
21
<p>Element tags are opened with <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
22
followed by <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() or
23
<a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a>(),
24
element content, and then <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>(). A
25
shorter form <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>()
26
can be used to write empty elements, followed by <a href="qxmlstreamwriter.html#writeAttributes">writeAttributes</a>().</p>
27
<p>Element content consists of either characters, entity references
28
or nested elements. It is written with <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>(),
29
which also takes care of escaping all forbidden characters and
30
character sequences, <a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a>(),
31
or subsequent calls to <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>().
32
A convenience method <a href="qxmlstreamwriter.html#writeTextElement">writeTextElement</a>() can
33
be used for writing terminal elements that contain nothing but
35
<p>The following abridged code snippet shows the basic use of the
36
class to write formatted XML with indentation:</p>
37
<pre class="highlightedCode brush: cpp">
38
QXmlStreamWriter stream(&output);
17
39
stream.setAutoFormatting(true);
18
40
stream.writeStartDocument();
20
42
stream.writeStartElement("bookmark");
21
stream.writeAttribute("href", "http:<span class="comment">//qt.nokia.com/");</span>
43
stream.writeAttribute("href", "http://qt.nokia.com/");
22
44
stream.writeTextElement("title", "Qt Home");
23
45
stream.writeEndElement(); <span class="comment">// bookmark</span>
25
stream.writeEndDocument();</pre>
26
<p>QXmlStreamWriter takes care of prefixing namespaces, all you have to do is specify the <tt>namespaceUri</tt> when writing elements or attributes. If you must conform to certain prefixes, you can force the writer to use them by declaring the namespaces manually with either <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>() or <a href="qxmlstreamwriter.html#writeDefaultNamespace">writeDefaultNamespace</a>(). Alternatively, you can bypass the stream writer's namespace support and use overloaded methods that take a qualified name instead. The namespace <i>http://www.w3.org/XML/1998/namespace</i> is implicit and mapped to the prefix <i>xml</i>.</p>
27
<p>The stream writer can automatically format the generated XML data by adding line-breaks and indentation to empty sections between elements, making the XML data more readable for humans and easier to work with for most source code management systems. The feature can be turned on with the <a href="qxmlstreamwriter.html#autoFormatting-prop">autoFormatting</a> property, and customized with the <a href="qxmlstreamwriter.html#autoFormattingIndent-prop">autoFormattingIndent</a> property.</p>
28
<p>Other functions are <a href="qxmlstreamwriter.html#writeCDATA">writeCDATA</a>(), <a href="qxmlstreamwriter.html#writeComment">writeComment</a>(), <a href="qxmlstreamwriter.html#writeProcessingInstruction">writeProcessingInstruction</a>(), and <a href="qxmlstreamwriter.html#writeDTD">writeDTD</a>(). Chaining of XML streams is supported with <a href="qxmlstreamwriter.html#writeCurrentToken">writeCurrentToken</a>().</p>
29
<p>By default, QXmlStreamWriter encodes XML in UTF-8. Different encodings can be enforced using <a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
30
<p>The <a href="xml-streambookmarks.html">QXmlStream Bookmarks Example</a> illustrates how to use a stream writer to write an XML bookmark file (XBEL) that was previously read in by a <a href="qxmlstreamreader.html">QXmlStreamReader</a>.</p>
47
stream.writeEndDocument();
49
<p>QXmlStreamWriter takes care of prefixing namespaces, all you
50
have to do is specify the <tt>namespaceUri</tt> when writing
51
elements or attributes. If you must conform to certain prefixes,
52
you can force the writer to use them by declaring the namespaces
53
manually with either <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>() or
54
<a href="qxmlstreamwriter.html#writeDefaultNamespace">writeDefaultNamespace</a>().
55
Alternatively, you can bypass the stream writer's namespace support
56
and use overloaded methods that take a qualified name instead. The
57
namespace <i>http://www.w3.org/XML/1998/namespace</i> is implicit
58
and mapped to the prefix <i>xml</i>.</p>
59
<p>The stream writer can automatically format the generated XML
60
data by adding line-breaks and indentation to empty sections
61
between elements, making the XML data more readable for humans and
62
easier to work with for most source code management systems. The
63
feature can be turned on with the <a href="qxmlstreamwriter.html#autoFormatting-prop">autoFormatting</a>
64
property, and customized with the <a href="qxmlstreamwriter.html#autoFormattingIndent-prop">autoFormattingIndent</a>
66
<p>Other functions are <a href="qxmlstreamwriter.html#writeCDATA">writeCDATA</a>(), <a href="qxmlstreamwriter.html#writeComment">writeComment</a>(), <a href="qxmlstreamwriter.html#writeProcessingInstruction">writeProcessingInstruction</a>(),
67
and <a href="qxmlstreamwriter.html#writeDTD">writeDTD</a>().
68
Chaining of XML streams is supported with <a href="qxmlstreamwriter.html#writeCurrentToken">writeCurrentToken</a>().</p>
69
<p>By default, QXmlStreamWriter encodes XML in UTF-8. Different
70
encodings can be enforced using <a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
71
<p>The <a href="xml-streambookmarks.html">QXmlStream Bookmarks
72
Example</a> illustrates how to use a stream writer to write an XML
73
bookmark file (XBEL) that was previously read in by a <a href="qxmlstreamreader.html">QXmlStreamReader</a>.</p>
31
74
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QXmlStreamWriter" />QXmlStreamWriter.__init__ (<i>self</i>)</h3><p>Constructs a stream writer.</p>
32
75
<p>See also <a href="qxmlstreamwriter.html#setDevice">setDevice</a>().</p>
33
78
<h3 class="fn"><a name="QXmlStreamWriter-2" />QXmlStreamWriter.__init__ (<i>self</i>, <a href="qiodevice.html">QIODevice</a>)</h3><p>Constructs a stream writer that writes into <i>device</i>;</p>
34
<h3 class="fn"><a name="QXmlStreamWriter-3" />QXmlStreamWriter.__init__ (<i>self</i>, <a href="qbytearray.html">QByteArray</a>)</h3><p>Constructs a stream writer that writes into <i>array</i>. This is the same as creating an xml writer that operates on a <a href="qbuffer.html">QBuffer</a> device which in turn operates on <i>array</i>.</p>
81
<h3 class="fn"><a name="QXmlStreamWriter-3" />QXmlStreamWriter.__init__ (<i>self</i>, <a href="qbytearray.html">QByteArray</a>)</h3><p>Constructs a stream writer that writes into <i>array</i>. This
82
is the same as creating an xml writer that operates on a <a href="qbuffer.html">QBuffer</a> device which in turn operates on
35
86
<h3 class="fn"><a name="QXmlStreamWriter-4" />QXmlStreamWriter.__init__ (<i>self</i>, QString)</h3><p>Constructs a stream writer that writes into <i>string</i>.</p>
36
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/~QXmlStreamWriter" />
37
89
<h3 class="fn"><a name="autoFormatting" />bool QXmlStreamWriter.autoFormatting (<i>self</i>)</h3><h3 class="fn"><a name="autoFormattingIndent" />int QXmlStreamWriter.autoFormattingIndent (<i>self</i>)</h3><h3 class="fn"><a name="codec" /><a href="qtextcodec.html">QTextCodec</a> QXmlStreamWriter.codec (<i>self</i>)</h3><p>Returns the codec that is currently assigned to the stream.</p>
38
90
<p>See also <a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
39
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/device" />
40
<h3 class="fn"><a name="device" /><a href="qiodevice.html">QIODevice</a> QXmlStreamWriter.device (<i>self</i>)</h3><p>Returns the current device associated with the <a href="qxmlstreamwriter.html">QXmlStreamWriter</a>, or 0 if no device has been assigned.</p>
93
<h3 class="fn"><a name="device" /><a href="qiodevice.html">QIODevice</a> QXmlStreamWriter.device (<i>self</i>)</h3><p>Returns the current device associated with the <a href="qxmlstreamwriter.html">QXmlStreamWriter</a>, or 0 if no device has
41
95
<p>See also <a href="qxmlstreamwriter.html#setDevice">setDevice</a>().</p>
42
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/setCodec" />
43
<h3 class="fn"><a name="setAutoFormatting" />QXmlStreamWriter.setAutoFormatting (<i>self</i>, bool)</h3><h3 class="fn"><a name="setAutoFormattingIndent" />QXmlStreamWriter.setAutoFormattingIndent (<i>self</i>, int)</h3><h3 class="fn"><a name="setCodec" />QXmlStreamWriter.setCodec (<i>self</i>, <a href="qtextcodec.html">QTextCodec</a>)</h3><p>Sets the codec for this stream to <i>codec</i>. The codec is used for encoding any data that is written. By default, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> uses UTF-8.</p>
44
<p>The encoding information is stored in the initial xml tag which gets written when you call <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>(). Call this function before calling <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>().</p>
98
<h3 class="fn"><a name="setAutoFormatting" />QXmlStreamWriter.setAutoFormatting (<i>self</i>, bool)</h3><h3 class="fn"><a name="setAutoFormattingIndent" />QXmlStreamWriter.setAutoFormattingIndent (<i>self</i>, int)</h3><h3 class="fn"><a name="setCodec" />QXmlStreamWriter.setCodec (<i>self</i>, <a href="qtextcodec.html">QTextCodec</a>)</h3><p>Sets the codec for this stream to <i>codec</i>. The codec is
99
used for encoding any data that is written. By default, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> uses UTF-8.</p>
100
<p>The encoding information is stored in the initial xml tag which
101
gets written when you call <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>().
102
Call this function before calling <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>().</p>
45
103
<p>See also <a href="qxmlstreamwriter.html#codec">codec</a>().</p>
46
<h3 class="fn"><a name="setCodec-2" />QXmlStreamWriter.setCodec (<i>self</i>, str)</h3><p>Sets the codec for this stream to the <a href="qtextcodec.html">QTextCodec</a> for the encoding specified by <i>codecName</i>. Common values for <tt>codecName</tt> include "ISO 8859-1", "UTF-8", and "UTF-16". If the encoding isn't recognized, nothing happens.</p>
106
<h3 class="fn"><a name="setCodec-2" />QXmlStreamWriter.setCodec (<i>self</i>, str)</h3><p>Sets the codec for this stream to the <a href="qtextcodec.html">QTextCodec</a> for the encoding specified by
107
<i>codecName</i>. Common values for <tt>codecName</tt> include "ISO
108
8859-1", "UTF-8", and "UTF-16". If the encoding isn't recognized,
47
110
<p>See also <a href="qtextcodec.html#codecForName">QTextCodec.codecForName</a>().</p>
48
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/setDevice" />
49
<h3 class="fn"><a name="setDevice" />QXmlStreamWriter.setDevice (<i>self</i>, <a href="qiodevice.html">QIODevice</a>)</h3><p>Sets the current device to <i>device</i>. If you want the stream to write into a <a href="qbytearray.html">QByteArray</a>, you can create a <a href="qbuffer.html">QBuffer</a> device.</p>
113
<h3 class="fn"><a name="setDevice" />QXmlStreamWriter.setDevice (<i>self</i>, <a href="qiodevice.html">QIODevice</a>)</h3><p>Sets the current device to <i>device</i>. If you want the stream
114
to write into a <a href="qbytearray.html">QByteArray</a>, you can
115
create a <a href="qbuffer.html">QBuffer</a> device.</p>
50
116
<p>See also <a href="qxmlstreamwriter.html#device">device</a>().</p>
51
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeAttribute" />
52
<h3 class="fn"><a name="writeAttribute" />QXmlStreamWriter.writeAttribute (<i>self</i>, QString, QString)</h3><p>Writes an attribute with <i>name</i> and <i>value</i>, prefixed for the specified <i>namespaceUri</i>. If the namespace has not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it.</p>
53
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
119
<h3 class="fn"><a name="writeAttribute" />QXmlStreamWriter.writeAttribute (<i>self</i>, QString, QString)</h3><p>Writes an attribute with <i>name</i> and <i>value</i>, prefixed
120
for the specified <i>namespaceUri</i>. If the namespace has not
121
been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a
122
namespace declaration for it.</p>
123
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
124
before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
54
127
<h3 class="fn"><a name="writeAttribute-2" />QXmlStreamWriter.writeAttribute (<i>self</i>, QString, QString, QString)</h3><p>This is an overloaded function.</p>
55
<p>Writes an attribute with <i>qualifiedName</i> and <i>value</i>.</p>
56
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
128
<p>Writes an attribute with <i>qualifiedName</i> and
130
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
131
before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
57
134
<h3 class="fn"><a name="writeAttribute-3" />QXmlStreamWriter.writeAttribute (<i>self</i>, <a href="qxmlstreamattribute.html">QXmlStreamAttribute</a>)</h3><p>This is an overloaded function.</p>
58
135
<p>Writes the <i>attribute</i>.</p>
59
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
60
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeAttributes" />
61
<h3 class="fn"><a name="writeAttributes" />QXmlStreamWriter.writeAttributes (<i>self</i>, <a href="qxmlstreamattributes.html">QXmlStreamAttributes</a>)</h3><p>Writes the attribute vector <i>attributes</i>. If a namespace referenced in an attribute not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it.</p>
62
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
63
<p>See also <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() and <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>().</p>
64
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeCDATA" />
65
<h3 class="fn"><a name="writeCDATA" />QXmlStreamWriter.writeCDATA (<i>self</i>, QString)</h3><p>Writes <i>text</i> as CDATA section. If <i>text</i> contains the forbidden character sequence "]]>", it is split into different CDATA sections.</p>
66
<p>This function mainly exists for completeness. Normally you should not need use it, because <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>() automatically escapes all non-content characters.</p>
67
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeCharacters" />
68
<h3 class="fn"><a name="writeCharacters" />QXmlStreamWriter.writeCharacters (<i>self</i>, QString)</h3><p>Writes <i>text</i>. The characters "<", "&", and """ are escaped as entity references "&lt;", "&amp;, and "&quot;". To avoid the forbidden sequence "]]>", ">" is also escaped as "&gt;".</p>
136
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
137
before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
140
<h3 class="fn"><a name="writeAttributes" />QXmlStreamWriter.writeAttributes (<i>self</i>, <a href="qxmlstreamattributes.html">QXmlStreamAttributes</a>)</h3><p>Writes the attribute vector <i>attributes</i>. If a namespace
141
referenced in an attribute not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a
142
namespace declaration for it.</p>
143
<p>This function can only be called after <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
144
before any content is written, or after <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
145
<p>See also <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() and
146
<a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>().</p>
149
<h3 class="fn"><a name="writeCDATA" />QXmlStreamWriter.writeCDATA (<i>self</i>, QString)</h3><p>Writes <i>text</i> as CDATA section. If <i>text</i> contains the
150
forbidden character sequence "]]>", it is split into different
152
<p>This function mainly exists for completeness. Normally you
153
should not need use it, because <a href="qxmlstreamwriter.html#writeCharacters">writeCharacters</a>()
154
automatically escapes all non-content characters.</p>
157
<h3 class="fn"><a name="writeCharacters" />QXmlStreamWriter.writeCharacters (<i>self</i>, QString)</h3><p>Writes <i>text</i>. The characters "<", "&", and """ are
158
escaped as entity references "&lt;", "&amp;, and
159
"&quot;". To avoid the forbidden sequence "]]>", ">" is
160
also escaped as "&gt;".</p>
69
161
<p>See also <a href="qxmlstreamwriter.html#writeEntityReference">writeEntityReference</a>().</p>
70
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeComment" />
71
<h3 class="fn"><a name="writeComment" />QXmlStreamWriter.writeComment (<i>self</i>, QString)</h3><p>Writes <i>text</i> as XML comment, where <i>text</i> must not contain the forbidden sequence "--" or end with "-". Note that XML does not provide any way to escape "-" in a comment.</p>
72
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeCurrentToken" />
73
<h3 class="fn"><a name="writeCurrentToken" />QXmlStreamWriter.writeCurrentToken (<i>self</i>, <a href="qxmlstreamreader.html">QXmlStreamReader</a>)</h3><p>Writes the current state of the <i>reader</i>. All possible valid states are supported.</p>
74
<p>The purpose of this function is to support chained processing of XML data.</p>
164
<h3 class="fn"><a name="writeComment" />QXmlStreamWriter.writeComment (<i>self</i>, QString)</h3><p>Writes <i>text</i> as XML comment, where <i>text</i> must not
165
contain the forbidden sequence "--" or end with "-". Note that XML
166
does not provide any way to escape "-" in a comment.</p>
169
<h3 class="fn"><a name="writeCurrentToken" />QXmlStreamWriter.writeCurrentToken (<i>self</i>, <a href="qxmlstreamreader.html">QXmlStreamReader</a>)</h3><p>Writes the current state of the <i>reader</i>. All possible
170
valid states are supported.</p>
171
<p>The purpose of this function is to support chained processing of
75
173
<p>See also <a href="qxmlstreamreader.html#tokenType">QXmlStreamReader.tokenType</a>().</p>
76
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeDTD" />
77
<h3 class="fn"><a name="writeDefaultNamespace" />QXmlStreamWriter.writeDefaultNamespace (<i>self</i>, QString)</h3><p>Writes a default namespace declaration for <i>namespaceUri</i>.</p>
78
<p>If <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() or <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>() was called, the declaration applies to the current element; otherwise it applies to the next child element.</p>
79
<p>Note that the namespaces <i>http://www.w3.org/XML/1998/namespace</i> (bound to <i>xmlns</i>) and <i>http://www.w3.org/2000/xmlns/</i> (bound to <i>xml</i>) by definition cannot be declared as default.</p>
80
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeEmptyElement" />
81
<h3 class="fn"><a name="writeDTD" />QXmlStreamWriter.writeDTD (<i>self</i>, QString)</h3><p>Writes a DTD section. The <i>dtd</i> represents the entire doctypedecl production from the XML 1.0 specification.</p>
82
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeDefaultNamespace" />
83
<h3 class="fn"><a name="writeEmptyElement" />QXmlStreamWriter.writeEmptyElement (<i>self</i>, QString)</h3><p>Writes an empty element with <i>name</i>, prefixed for the specified <i>namespaceUri</i>. If the namespace has not been declared, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
176
<h3 class="fn"><a name="writeDefaultNamespace" />QXmlStreamWriter.writeDefaultNamespace (<i>self</i>, QString)</h3><p>Writes a default namespace declaration for
177
<i>namespaceUri</i>.</p>
178
<p>If <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
179
or <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>()
180
was called, the declaration applies to the current element;
181
otherwise it applies to the next child element.</p>
182
<p>Note that the namespaces
183
<i>http://www.w3.org/XML/1998/namespace</i> (bound to <i>xmlns</i>)
184
and <i>http://www.w3.org/2000/xmlns/</i> (bound to <i>xml</i>) by
185
definition cannot be declared as default.</p>
188
<h3 class="fn"><a name="writeDTD" />QXmlStreamWriter.writeDTD (<i>self</i>, QString)</h3><p>Writes a DTD section. The <i>dtd</i> represents the entire
189
doctypedecl production from the XML 1.0 specification.</p>
192
<h3 class="fn"><a name="writeEmptyElement" />QXmlStreamWriter.writeEmptyElement (<i>self</i>, QString)</h3><p>Writes an empty element with <i>name</i>, prefixed for the
193
specified <i>namespaceUri</i>. If the namespace has not been
194
declared, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will
195
generate a namespace declaration for it. Subsequent calls to
196
<a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>()
197
will add attributes to this element.</p>
84
198
<p>See also <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>().</p>
85
201
<h3 class="fn"><a name="writeEmptyElement-2" />QXmlStreamWriter.writeEmptyElement (<i>self</i>, QString, QString)</h3><p>This is an overloaded function.</p>
86
<p>Writes an empty element with qualified name <i>qualifiedName</i>. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
87
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeEndDocument" />
88
<h3 class="fn"><a name="writeEndDocument" />QXmlStreamWriter.writeEndDocument (<i>self</i>)</h3><p>Closes all remaining open start elements and writes a newline.</p>
202
<p>Writes an empty element with qualified name
203
<i>qualifiedName</i>. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will
204
add attributes to this element.</p>
207
<h3 class="fn"><a name="writeEndDocument" />QXmlStreamWriter.writeEndDocument (<i>self</i>)</h3><p>Closes all remaining open start elements and writes a
89
209
<p>See also <a href="qxmlstreamwriter.html#writeStartDocument">writeStartDocument</a>().</p>
90
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeEndElement" />
91
212
<h3 class="fn"><a name="writeEndElement" />QXmlStreamWriter.writeEndElement (<i>self</i>)</h3><p>Closes the previous start element.</p>
92
213
<p>See also <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>().</p>
93
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeEntityReference" />
94
<h3 class="fn"><a name="writeEntityReference" />QXmlStreamWriter.writeEntityReference (<i>self</i>, QString)</h3><p>Writes the entity reference <i>name</i> to the stream, as "&<i>name</i>;".</p>
95
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeNamespace" />
96
<h3 class="fn"><a name="writeNamespace" />QXmlStreamWriter.writeNamespace (<i>self</i>, QString, QString <i>prefix</i> = QString())</h3><p>Writes a namespace declaration for <i>namespaceUri</i> with <i>prefix</i>. If <i>prefix</i> is empty, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> assigns a unique prefix consisting of the letter 'n' followed by a number.</p>
97
<p>If <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>() or <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>() was called, the declaration applies to the current element; otherwise it applies to the next child element.</p>
98
<p>Note that the prefix <i>xml</i> is both predefined and reserved for <i>http://www.w3.org/XML/1998/namespace</i>, which in turn cannot be bound to any other prefix. The prefix <i>xmlns</i> and its URI <i>http://www.w3.org/2000/xmlns/</i> are used for the namespace mechanism itself and thus completely forbidden in declarations.</p>
99
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeProcessingInstruction" />
100
<h3 class="fn"><a name="writeProcessingInstruction" />QXmlStreamWriter.writeProcessingInstruction (<i>self</i>, QString, QString <i>data</i> = QString())</h3><p>Writes an XML processing instruction with <i>target</i> and <i>data</i>, where <i>data</i> must not contain the sequence "?>".</p>
101
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeStartDocument" />
102
<h3 class="fn"><a name="writeStartDocument" />QXmlStreamWriter.writeStartDocument (<i>self</i>)</h3><p>Writes a document start with the XML version number <i>version</i>.</p>
216
<h3 class="fn"><a name="writeEntityReference" />QXmlStreamWriter.writeEntityReference (<i>self</i>, QString)</h3><p>Writes the entity reference <i>name</i> to the stream, as
217
"&<i>name</i>;".</p>
220
<h3 class="fn"><a name="writeNamespace" />QXmlStreamWriter.writeNamespace (<i>self</i>, QString, QString <i>prefix</i> = QString())</h3><p>Writes a namespace declaration for <i>namespaceUri</i> with
221
<i>prefix</i>. If <i>prefix</i> is empty, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> assigns a unique
222
prefix consisting of the letter 'n' followed by a number.</p>
223
<p>If <a href="qxmlstreamwriter.html#writeStartElement">writeStartElement</a>()
224
or <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>()
225
was called, the declaration applies to the current element;
226
otherwise it applies to the next child element.</p>
227
<p>Note that the prefix <i>xml</i> is both predefined and reserved
228
for <i>http://www.w3.org/XML/1998/namespace</i>, which in turn
229
cannot be bound to any other prefix. The prefix <i>xmlns</i> and
230
its URI <i>http://www.w3.org/2000/xmlns/</i> are used for the
231
namespace mechanism itself and thus completely forbidden in
235
<h3 class="fn"><a name="writeProcessingInstruction" />QXmlStreamWriter.writeProcessingInstruction (<i>self</i>, QString, QString <i>data</i> = QString())</h3><p>Writes an XML processing instruction with <i>target</i> and
236
<i>data</i>, where <i>data</i> must not contain the sequence
240
<h3 class="fn"><a name="writeStartDocument" />QXmlStreamWriter.writeStartDocument (<i>self</i>)</h3><p>Writes a document start with the XML version number
103
242
<p>See also <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>().</p>
104
<h3 class="fn"><a name="writeStartDocument-2" />QXmlStreamWriter.writeStartDocument (<i>self</i>, QString)</h3><p>Writes a document start with the XML version number <i>version</i> and a standalone attribute <i>standalone</i>.</p>
245
<h3 class="fn"><a name="writeStartDocument-2" />QXmlStreamWriter.writeStartDocument (<i>self</i>, QString)</h3><p>Writes a document start with the XML version number
246
<i>version</i> and a standalone attribute <i>standalone</i>.</p>
105
247
<p>This function was introduced in Qt 4.5.</p>
106
248
<p>See also <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>().</p>
107
251
<h3 class="fn"><a name="writeStartDocument-3" />QXmlStreamWriter.writeStartDocument (<i>self</i>, QString, bool)</h3><p>This is an overloaded function.</p>
108
<p>Writes a document start with XML version number "1.0". This also writes the encoding information.</p>
252
<p>Writes a document start with XML version number "1.0". This also
253
writes the encoding information.</p>
109
254
<p>This function was introduced in Qt 4.5.</p>
110
<p>See also <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>() and <a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
111
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeStartElement" />
112
<h3 class="fn"><a name="writeStartElement" />QXmlStreamWriter.writeStartElement (<i>self</i>, QString)</h3><p>Writes a start element with <i>name</i>, prefixed for the specified <i>namespaceUri</i>. If the namespace has not been declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
113
<p>See also <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>(), <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>(), and <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
255
<p>See also <a href="qxmlstreamwriter.html#writeEndDocument">writeEndDocument</a>() and
256
<a href="qxmlstreamwriter.html#setCodec">setCodec</a>().</p>
259
<h3 class="fn"><a name="writeStartElement" />QXmlStreamWriter.writeStartElement (<i>self</i>, QString)</h3><p>Writes a start element with <i>name</i>, prefixed for the
260
specified <i>namespaceUri</i>. If the namespace has not been
261
declared yet, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a>
262
will generate a namespace declaration for it. Subsequent calls to
263
<a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>()
264
will add attributes to this element.</p>
265
<p>See also <a href="qxmlstreamwriter.html#writeNamespace">writeNamespace</a>(),
266
<a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>(), and
267
<a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
114
270
<h3 class="fn"><a name="writeStartElement-2" />QXmlStreamWriter.writeStartElement (<i>self</i>, QString, QString)</h3><p>This is an overloaded function.</p>
115
<p>Writes a start element with <i>qualifiedName</i>. Subsequent calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will add attributes to this element.</p>
116
<p>See also <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>() and <a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
117
<a name="//apple_ref/cpp/instm/QXmlStreamWriter/writeTextElement" />
118
<h3 class="fn"><a name="writeTextElement" />QXmlStreamWriter.writeTextElement (<i>self</i>, QString, QString)</h3><p>Writes a text element with <i>name</i>, prefixed for the specified <i>namespaceUri</i>, and <i>text</i>. If the namespace has not been declared, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a namespace declaration for it.</p>
271
<p>Writes a start element with <i>qualifiedName</i>. Subsequent
272
calls to <a href="qxmlstreamwriter.html#writeAttribute">writeAttribute</a>() will
273
add attributes to this element.</p>
274
<p>See also <a href="qxmlstreamwriter.html#writeEndElement">writeEndElement</a>() and
275
<a href="qxmlstreamwriter.html#writeEmptyElement">writeEmptyElement</a>().</p>
278
<h3 class="fn"><a name="writeTextElement" />QXmlStreamWriter.writeTextElement (<i>self</i>, QString, QString)</h3><p>Writes a text element with <i>name</i>, prefixed for the
279
specified <i>namespaceUri</i>, and <i>text</i>. If the namespace
280
has not been declared, <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> will generate a
281
namespace declaration for it.</p>
119
282
<p>This is a convenience function equivalent to:</p>
120
<pre> writeStartElement(namespaceUri, name);
283
<pre class="highlightedCode brush: cpp">
284
writeStartElement(namespaceUri, name);
121
285
writeCharacters(text);
122
writeEndElement();</pre>
123
290
<h3 class="fn"><a name="writeTextElement-2" />QXmlStreamWriter.writeTextElement (<i>self</i>, QString, QString, QString)</h3><p>This is an overloaded function.</p>
124
<p>Writes a text element with <i>qualifiedName</i> and <i>text</i>.</p>
291
<p>Writes a text element with <i>qualifiedName</i> and
125
293
<p>This is a convenience function equivalent to:</p>
126
<pre> writeStartElement(qualifiedName);
294
<pre class="highlightedCode brush: cpp">
295
writeStartElement(qualifiedName);
127
296
writeCharacters(text);
128
writeEndElement();</pre>
129
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.7 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.3</td></tr></table></div></address></body></html>
b'\\ No newline at end of file'
299
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.8.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.7.0</td></tr></table></div></address></body></html>
b'\\ No newline at end of file'