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
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QXmlReader Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</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="index.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">QXmlReader Class Reference<br /><sup><sup>[<a href="qtxml.html">QtXml</a> module]</sup></sup></h1><p>The QXmlReader class provides an interface for XML readers (i.e.
parsers). <a href="#details">More...</a></p>
<p>Inherited by <a href="qxmlsimplereader.html">QXmlSimpleReader</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qxmlreader.html#QXmlReader">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#QXmlReader-2">__init__</a></b> (<i>self</i>, QXmlReader)</li><li><div class="fn" />QXmlContentHandler <b><a href="qxmlreader.html#contentHandler">contentHandler</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlDeclHandler <b><a href="qxmlreader.html#declHandler">declHandler</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlDTDHandler <b><a href="qxmlreader.html#DTDHandler">DTDHandler</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlEntityResolver <b><a href="qxmlreader.html#entityResolver">entityResolver</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlErrorHandler <b><a href="qxmlreader.html#errorHandler">errorHandler</a></b> (<i>self</i>)</li><li><div class="fn" />(bool, bool <i>ok</i>) <b><a href="qxmlreader.html#feature">feature</a></b> (<i>self</i>, QString <i>name</i>)</li><li><div class="fn" />bool <b><a href="qxmlreader.html#hasFeature">hasFeature</a></b> (<i>self</i>, QString <i>name</i>)</li><li><div class="fn" />bool <b><a href="qxmlreader.html#hasProperty">hasProperty</a></b> (<i>self</i>, QString <i>name</i>)</li><li><div class="fn" />QXmlLexicalHandler <b><a href="qxmlreader.html#lexicalHandler">lexicalHandler</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qxmlreader.html#parse">parse</a></b> (<i>self</i>, QXmlInputSource <i>input</i>)</li><li><div class="fn" />bool <b><a href="qxmlreader.html#parse-2">parse</a></b> (<i>self</i>, QXmlInputSource <i>input</i>)</li><li><div class="fn" />(sip.voidptr, bool <i>ok</i>) <b><a href="qxmlreader.html#property">property</a></b> (<i>self</i>, QString <i>name</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setContentHandler">setContentHandler</a></b> (<i>self</i>, QXmlContentHandler <i>handler</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setDeclHandler">setDeclHandler</a></b> (<i>self</i>, QXmlDeclHandler <i>handler</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setDTDHandler">setDTDHandler</a></b> (<i>self</i>, QXmlDTDHandler <i>handler</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setEntityResolver">setEntityResolver</a></b> (<i>self</i>, QXmlEntityResolver <i>handler</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setErrorHandler">setErrorHandler</a></b> (<i>self</i>, QXmlErrorHandler <i>handler</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setFeature">setFeature</a></b> (<i>self</i>, QString <i>name</i>, bool <i>value</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setLexicalHandler">setLexicalHandler</a></b> (<i>self</i>, QXmlLexicalHandler <i>handler</i>)</li><li><div class="fn" /><b><a href="qxmlreader.html#setProperty">setProperty</a></b> (<i>self</i>, QString <i>name</i>, sip.voidptr <i>value</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QXmlReader class provides an interface for XML readers (i.e.
parsers).</p>
<p>This abstract class provides an interface for all of Qt's XML
readers. Currently there is only one implementation of a reader
included in Qt's XML module: <a href="qxmlsimplereader.html">QXmlSimpleReader</a>. In future releases
there might be more readers with different properties available
(e.g. a validating parser).</p>
<p>The design of the XML classes follows the <a href="http://www.saxproject.org/">SAX2 Java interface</a>, with the
names adapted to fit Qt naming conventions. It should be very easy
for anybody who has worked with SAX2 to get started with the Qt XML
classes.</p>
<p>All readers use the class <a href="qxmlinputsource.html">QXmlInputSource</a> to read the input
document. Since you are normally interested in particular content
in the XML document, the reader reports the content through special
handler classes (<a href="qxmldtdhandler.html">QXmlDTDHandler</a>,
<a href="qxmldeclhandler.html">QXmlDeclHandler</a>, <a href="qxmlcontenthandler.html">QXmlContentHandler</a>, <a href="qxmlentityresolver.html">QXmlEntityResolver</a>, <a href="qxmlerrorhandler.html">QXmlErrorHandler</a> and <a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>), which you must
subclass, if you want to process the contents.</p>
<p>Since the handler classes only describe interfaces you must
implement all the functions. We provide the <a href="qxmldefaulthandler.html">QXmlDefaultHandler</a> class to make this
easier: it implements a default behavior (do nothing) for all
functions, so you can subclass it and just implement the functions
you are interested in.</p>
<p>Features and properties of the reader can be set with <a href="qxmlreader.html#setFeature">setFeature</a>() and <a href="qxmlreader.html#setProperty">setProperty</a>() respectively. You
can set the reader to use your own subclasses with <a href="qxmlreader.html#setEntityResolver">setEntityResolver</a>(),
<a href="qxmlreader.html#setDTDHandler">setDTDHandler</a>(),
<a href="qxmlreader.html#setContentHandler">setContentHandler</a>(),
<a href="qxmlreader.html#setErrorHandler">setErrorHandler</a>(),
<a href="qxmlreader.html#setLexicalHandler">setLexicalHandler</a>()
and <a href="qxmlreader.html#setDeclHandler">setDeclHandler</a>().
The parse itself is started with a call to <a href="qxmlreader.html#parse">parse</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QXmlReader" />QXmlReader.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QXmlReader-2" />QXmlReader.__init__ (<i>self</i>, <a href="qxmlreader.html">QXmlReader</a>)</h3><h3 class="fn"><a name="contentHandler" /><a href="qxmlcontenthandler.html">QXmlContentHandler</a> QXmlReader.contentHandler (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the content handler or 0 if none was set.</p>
<p><b>See also</b> <a href="qxmlreader.html#setContentHandler">setContentHandler</a>().</p>
<h3 class="fn"><a name="declHandler" /><a href="qxmldeclhandler.html">QXmlDeclHandler</a> QXmlReader.declHandler (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the declaration handler or 0 if none was set.</p>
<p><b>See also</b> <a href="qxmlreader.html#setDeclHandler">setDeclHandler</a>().</p>
<h3 class="fn"><a name="DTDHandler" /><a href="qxmldtdhandler.html">QXmlDTDHandler</a> QXmlReader.DTDHandler (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the DTD handler or 0 if none was set.</p>
<p><b>See also</b> <a href="qxmlreader.html#setDTDHandler">setDTDHandler</a>().</p>
<h3 class="fn"><a name="entityResolver" /><a href="qxmlentityresolver.html">QXmlEntityResolver</a> QXmlReader.entityResolver (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the entity resolver or 0 if none was set.</p>
<p><b>See also</b> <a href="qxmlreader.html#setEntityResolver">setEntityResolver</a>().</p>
<h3 class="fn"><a name="errorHandler" /><a href="qxmlerrorhandler.html">QXmlErrorHandler</a> QXmlReader.errorHandler (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the error handler or 0 if none is set.</p>
<p><b>See also</b> <a href="qxmlreader.html#setErrorHandler">setErrorHandler</a>().</p>
<h3 class="fn"><a name="feature" />(bool, bool <i>ok</i>) QXmlReader.feature (<i>self</i>, QString <i>name</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>If the reader has the feature called <i>name</i>, the feature's
value is returned. If no such feature exists the return value is
undefined.</p>
<p>If <i>ok</i> is not 0: <tt>*</tt><i>ok</i> is set to true if the
reader has the feature called <i>name</i>; otherwise
<tt>*</tt><i>ok</i> is set to false.</p>
<p><b>See also</b> <a href="qxmlreader.html#setFeature">setFeature</a>() and <a href="qxmlreader.html#hasFeature">hasFeature</a>().</p>
<h3 class="fn"><a name="hasFeature" />bool QXmlReader.hasFeature (<i>self</i>, QString <i>name</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns <tt>true</tt> if the reader has the feature called
<i>name</i>; otherwise returns false.</p>
<p><b>See also</b> <a href="qxmlreader.html#feature">feature</a>()
and <a href="qxmlreader.html#setFeature">setFeature</a>().</p>
<h3 class="fn"><a name="hasProperty" />bool QXmlReader.hasProperty (<i>self</i>, QString <i>name</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns true if the reader has the property <i>name</i>;
otherwise returns false.</p>
<p><b>See also</b> <a href="qxmlreader.html#property">property</a>() and <a href="qxmlreader.html#setProperty">setProperty</a>().</p>
<h3 class="fn"><a name="lexicalHandler" /><a href="qxmllexicalhandler.html">QXmlLexicalHandler</a> QXmlReader.lexicalHandler (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the lexical handler or 0 if none was set.</p>
<p><b>See also</b> <a href="qxmlreader.html#setLexicalHandler">setLexicalHandler</a>().</p>
<h3 class="fn"><a name="parse" />bool QXmlReader.parse (<i>self</i>, <a href="qxmlinputsource.html">QXmlInputSource</a> <i>input</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Reads an XML document from <i>input</i> and parses it. Returns
true if the parsing was successful; otherwise returns false.</p>
<h3 class="fn"><a name="parse-2" />bool QXmlReader.parse (<i>self</i>, <a href="qxmlinputsource.html">QXmlInputSource</a> <i>input</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><h3 class="fn"><a name="property" />(sip.voidptr, bool <i>ok</i>) QXmlReader.property (<i>self</i>, QString <i>name</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>If the reader has the property <i>name</i>, this function
returns the value of the property; otherwise the return value is
undefined.</p>
<p>If <i>ok</i> is not 0: if the reader has the <i>name</i>
property <tt>*</tt><i>ok</i> is set to true; otherwise
<tt>*</tt><i>ok</i> is set to false.</p>
<p><b>See also</b> <a href="qxmlreader.html#setProperty">setProperty</a>() and <a href="qxmlreader.html#hasProperty">hasProperty</a>().</p>
<h3 class="fn"><a name="setContentHandler" />QXmlReader.setContentHandler (<i>self</i>, <a href="qxmlcontenthandler.html">QXmlContentHandler</a> <i>handler</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the content handler to <i>handler</i>.</p>
<p><b>See also</b> <a href="qxmlreader.html#contentHandler">contentHandler</a>().</p>
<h3 class="fn"><a name="setDeclHandler" />QXmlReader.setDeclHandler (<i>self</i>, <a href="qxmldeclhandler.html">QXmlDeclHandler</a> <i>handler</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the declaration handler to <i>handler</i>.</p>
<p><b>See also</b> <a href="qxmlreader.html#declHandler">declHandler</a>().</p>
<h3 class="fn"><a name="setDTDHandler" />QXmlReader.setDTDHandler (<i>self</i>, <a href="qxmldtdhandler.html">QXmlDTDHandler</a> <i>handler</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the DTD handler to <i>handler</i>.</p>
<p><b>See also</b> <a href="qxmlreader.html#DTDHandler">DTDHandler</a>().</p>
<h3 class="fn"><a name="setEntityResolver" />QXmlReader.setEntityResolver (<i>self</i>, <a href="qxmlentityresolver.html">QXmlEntityResolver</a> <i>handler</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the entity resolver to <i>handler</i>.</p>
<p><b>See also</b> <a href="qxmlreader.html#entityResolver">entityResolver</a>().</p>
<h3 class="fn"><a name="setErrorHandler" />QXmlReader.setErrorHandler (<i>self</i>, <a href="qxmlerrorhandler.html">QXmlErrorHandler</a> <i>handler</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the error handler to <i>handler</i>. Clears the error
handler if <i>handler</i> is 0.</p>
<p><b>See also</b> <a href="qxmlreader.html#errorHandler">errorHandler</a>().</p>
<h3 class="fn"><a name="setFeature" />QXmlReader.setFeature (<i>self</i>, QString <i>name</i>, bool <i>value</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the feature called <i>name</i> to the given <i>value</i>.
If the reader doesn't have the feature nothing happens.</p>
<p><b>See also</b> <a href="qxmlreader.html#feature">feature</a>()
and <a href="qxmlreader.html#hasFeature">hasFeature</a>().</p>
<h3 class="fn"><a name="setLexicalHandler" />QXmlReader.setLexicalHandler (<i>self</i>, <a href="qxmllexicalhandler.html">QXmlLexicalHandler</a> <i>handler</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the lexical handler to <i>handler</i>.</p>
<p><b>See also</b> <a href="qxmlreader.html#lexicalHandler">lexicalHandler</a>().</p>
<h3 class="fn"><a name="setProperty" />QXmlReader.setProperty (<i>self</i>, QString <i>name</i>, sip.voidptr <i>value</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the property <i>name</i> to <i>value</i>. If the reader
doesn't have the property nothing happens.</p>
<p><b>See also</b> <a href="qxmlreader.html#property">property</a>() and <a href="qxmlreader.html#hasProperty">hasProperty</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.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.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|