Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 5337

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qxml.cpp -->
  <title>QXmlContentHandler Class | Qt XML 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtxml-index.html">Qt XML</a></td><td ><a href="qtxml-module.html">C++ Classes</a></td><td >QXmlContentHandler</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtxml-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </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="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QXmlContentHandler Class</h1>
<!-- $$$QXmlContentHandler-brief -->
<p>The <a href="qxmlcontenthandler.html">QXmlContentHandler</a> class provides an interface to report the logical content of XML data. <a href="#details">More...</a></p>
<!-- @@@QXmlContentHandler -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QXmlContentHandler&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += xml</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qxmldefaulthandler.html">QXmlDefaultHandler</a></p>
</td></tr></table></div><ul>
<li><a href="qxmlcontenthandler-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are reentrant.</p>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#dtor.QXmlContentHandler">~QXmlContentHandler</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#characters">characters</a></b>(const QString &amp;<i>ch</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#endDocument">endDocument</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#endElement">endElement</a></b>(const QString &amp;<i>namespaceURI</i>, const QString &amp;<i>localName</i>, const QString &amp;<i>qName</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#endPrefixMapping">endPrefixMapping</a></b>(const QString &amp;<i>prefix</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#errorString">errorString</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#ignorableWhitespace">ignorableWhitespace</a></b>(const QString &amp;<i>ch</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#processingInstruction">processingInstruction</a></b>(const QString &amp;<i>target</i>, const QString &amp;<i>data</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#setDocumentLocator">setDocumentLocator</a></b>(QXmlLocator *<i>locator</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#skippedEntity">skippedEntity</a></b>(const QString &amp;<i>name</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#startDocument">startDocument</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#startElement">startElement</a></b>(const QString &amp;<i>namespaceURI</i>, const QString &amp;<i>localName</i>, const QString &amp;<i>qName</i>, const QXmlAttributes &amp;<i>atts</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qxmlcontenthandler.html#startPrefixMapping">startPrefixMapping</a></b>(const QString &amp;<i>prefix</i>, const QString &amp;<i>uri</i>) = 0</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QXmlContentHandler-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qxmlcontenthandler.html">QXmlContentHandler</a> class provides an interface to report the logical content of XML data.</p>
<p>If the application needs to be informed of basic parsing events, it can implement this interface and activate it using <a href="qxmlreader.html#setContentHandler">QXmlReader::setContentHandler</a>(). The reader can then report basic document-related events like the start and end of elements and character data through this interface.</p>
<p>The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and sub-elements) appears, in order, between the <a href="qxmlcontenthandler.html#startElement">startElement</a>() event and the corresponding <a href="qxmlcontenthandler.html#endElement">endElement</a>() event.</p>
<p>The class <a href="qxmldefaulthandler.html">QXmlDefaultHandler</a> provides a default implementation for this interface; subclassing from the <a href="qxmldefaulthandler.html">QXmlDefaultHandler</a> class is very convenient if you only want to be informed of some parsing events.</p>
<p>The <a href="qxmlcontenthandler.html#startDocument">startDocument</a>() function is called at the start of the document, and <a href="qxmlcontenthandler.html#endDocument">endDocument</a>() is called at the end. Before parsing begins <a href="qxmlcontenthandler.html#setDocumentLocator">setDocumentLocator</a>() is called. For each element <a href="qxmlcontenthandler.html#startElement">startElement</a>() is called, with <a href="qxmlcontenthandler.html#endElement">endElement</a>() being called at the end of each element. The <a href="qxmlcontenthandler.html#characters">characters</a>() function is called with chunks of character data; <a href="qxmlcontenthandler.html#ignorableWhitespace">ignorableWhitespace</a>() is called with chunks of whitespace and <a href="qxmlcontenthandler.html#processingInstruction">processingInstruction</a>() is called with processing instructions. If an entity is skipped <a href="qxmlcontenthandler.html#skippedEntity">skippedEntity</a>() is called. At the beginning of prefix-URI scopes <a href="qxmlcontenthandler.html#startPrefixMapping">startPrefixMapping</a>() is called.</p>
</div>
<p><b>See also </b><a href="qxmldtdhandler.html">QXmlDTDHandler</a>, <a href="qxmldeclhandler.html">QXmlDeclHandler</a>, <a href="qxmlentityresolver.html">QXmlEntityResolver</a>, <a href="qxmlerrorhandler.html">QXmlErrorHandler</a>, <a href="qxmllexicalhandler.html">QXmlLexicalHandler</a>, and <a href="xml-sax.html#introduction-to-sax2">Introduction to SAX2</a>.</p>
<!-- @@@QXmlContentHandler -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$~QXmlContentHandler[overload1]$$$~QXmlContentHandler -->
<h3 class="fn" id="dtor.QXmlContentHandler"><a name="dtor.QXmlContentHandler"></a><code>[virtual] </code>QXmlContentHandler::<span class="name">~QXmlContentHandler</span>()</h3>
<p>Destroys the content handler.</p>
<!-- @@@~QXmlContentHandler -->
<!-- $$$characters[overload1]$$$charactersconstQString& -->
<h3 class="fn" id="characters"><a name="characters"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">characters</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>ch</i>)</h3>
<p>The reader calls this function when it has parsed a chunk of character data (either normal character data or character data inside a CDATA section; if you need to distinguish between those two types you must use <a href="qxmllexicalhandler.html#startCDATA">QXmlLexicalHandler::startCDATA</a>() and <a href="qxmllexicalhandler.html#endCDATA">QXmlLexicalHandler::endCDATA</a>()). The character data is reported in <i>ch</i>.</p>
<p>Some readers report whitespace in element content using the <a href="qxmlcontenthandler.html#ignorableWhitespace">ignorableWhitespace</a>() function rather than using this one.</p>
<p>A reader may report the character data of an element in more than one chunk; e.g&#x2e; a reader might want to report &quot;a&lt;b&quot; in three characters() events (&quot;a &quot;, &quot;&lt;&quot; and &quot; b&quot;).</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<!-- @@@characters -->
<!-- $$$endDocument[overload1]$$$endDocument -->
<h3 class="fn" id="endDocument"><a name="endDocument"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">endDocument</span>()</h3>
<p>The reader calls this function after it has finished parsing. It is called just once, and is the last handler function called. It is called after the reader has read all input or has abandoned parsing because of a fatal error.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<p><b>See also </b><a href="qxmlcontenthandler.html#startDocument">startDocument</a>().</p>
<!-- @@@endDocument -->
<!-- $$$endElement[overload1]$$$endElementconstQString&constQString&constQString& -->
<h3 class="fn" id="endElement"><a name="endElement"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">endElement</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>namespaceURI</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>localName</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>qName</i>)</h3>
<p>The reader calls this function when it has parsed an end element tag with the qualified name <i>qName</i>, the local name <i>localName</i> and the namespace URI <i>namespaceURI</i>.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<p><b>See also </b><a href="qxmlcontenthandler.html#startElement">startElement</a>() and <a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p>
<!-- @@@endElement -->
<!-- $$$endPrefixMapping[overload1]$$$endPrefixMappingconstQString& -->
<h3 class="fn" id="endPrefixMapping"><a name="endPrefixMapping"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">endPrefixMapping</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>prefix</i>)</h3>
<p>The reader calls this function to signal the end of a prefix mapping for the prefix <i>prefix</i>.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<p><b>See also </b><a href="qxmlcontenthandler.html#startPrefixMapping">startPrefixMapping</a>() and <a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p>
<!-- @@@endPrefixMapping -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn" id="errorString"><a name="errorString"></a><code>[pure virtual] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QXmlContentHandler::<span class="name">errorString</span>() const</h3>
<p>The reader calls this function to get an error string, e.g&#x2e; if any of the handler functions returns <code>false</code>.</p>
<!-- @@@errorString -->
<!-- $$$ignorableWhitespace[overload1]$$$ignorableWhitespaceconstQString& -->
<h3 class="fn" id="ignorableWhitespace"><a name="ignorableWhitespace"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">ignorableWhitespace</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>ch</i>)</h3>
<p>Some readers may use this function to report each chunk of whitespace in element content. The whitespace is reported in <i>ch</i>.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<!-- @@@ignorableWhitespace -->
<!-- $$$processingInstruction[overload1]$$$processingInstructionconstQString&constQString& -->
<h3 class="fn" id="processingInstruction"><a name="processingInstruction"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">processingInstruction</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>target</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>data</i>)</h3>
<p>The reader calls this function when it has parsed a processing instruction.</p>
<p><i>target</i> is the target name of the processing instruction and <i>data</i> is the data in the processing instruction.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<!-- @@@processingInstruction -->
<!-- $$$setDocumentLocator[overload1]$$$setDocumentLocatorQXmlLocator* -->
<h3 class="fn" id="setDocumentLocator"><a name="setDocumentLocator"></a><code>[pure virtual] </code><span class="type">void</span> QXmlContentHandler::<span class="name">setDocumentLocator</span>(<span class="type"><a href="qxmllocator.html">QXmlLocator</a></span> *<i>locator</i>)</h3>
<p>The reader calls this function before it starts parsing the document. The argument <i>locator</i> is a pointer to a <a href="qxmllocator.html">QXmlLocator</a> which allows the application to get the parsing position within the document.</p>
<p>Do not destroy the <i>locator</i>; it is destroyed when the reader is destroyed. (Do not use the <i>locator</i> after the reader is destroyed).</p>
<!-- @@@setDocumentLocator -->
<!-- $$$skippedEntity[overload1]$$$skippedEntityconstQString& -->
<h3 class="fn" id="skippedEntity"><a name="skippedEntity"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">skippedEntity</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Some readers may skip entities if they have not seen the declarations (e.g&#x2e; because they are in an external DTD). If they do so they report that they skipped the entity called <i>name</i> by calling this function.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<!-- @@@skippedEntity -->
<!-- $$$startDocument[overload1]$$$startDocument -->
<h3 class="fn" id="startDocument"><a name="startDocument"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">startDocument</span>()</h3>
<p>The reader calls this function when it starts parsing the document. The reader calls this function just once, after the call to <a href="qxmlcontenthandler.html#setDocumentLocator">setDocumentLocator</a>(), and before any other functions in this class or in the <a href="qxmldtdhandler.html">QXmlDTDHandler</a> class are called.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<p><b>See also </b><a href="qxmlcontenthandler.html#endDocument">endDocument</a>().</p>
<!-- @@@startDocument -->
<!-- $$$startElement[overload1]$$$startElementconstQString&constQString&constQString&constQXmlAttributes& -->
<h3 class="fn" id="startElement"><a name="startElement"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">startElement</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>namespaceURI</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>localName</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>qName</i>, const <span class="type"><a href="qxmlattributes.html">QXmlAttributes</a></span> &amp;<i>atts</i>)</h3>
<p>The reader calls this function when it has parsed a start element tag.</p>
<p>There is a corresponding <a href="qxmlcontenthandler.html#endElement">endElement</a>() call when the corresponding end element tag is read. The startElement() and <a href="qxmlcontenthandler.html#endElement">endElement</a>() calls are always nested correctly. Empty element tags (e.g&#x2e; <code>&lt;x/&gt;</code>) cause a startElement() call to be immediately followed by an <a href="qxmlcontenthandler.html#endElement">endElement</a>() call.</p>
<p>The attribute list provided only contains attributes with explicit values. The attribute list contains attributes used for namespace declaration (i.e&#x2e; attributes starting with xmlns) only if the namespace-prefix property of the reader is true.</p>
<p>The argument <i>namespaceURI</i> is the namespace URI, or an empty string if the element has no namespace URI or if no namespace processing is done. <i>localName</i> is the local name (without prefix), or an empty string if no namespace processing is done, <i>qName</i> is the qualified name (with prefix) and <i>atts</i> are the attributes attached to the element. If there are no attributes, <i>atts</i> is an empty attributes object.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<p><b>See also </b><a href="qxmlcontenthandler.html#endElement">endElement</a>() and <a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p>
<!-- @@@startElement -->
<!-- $$$startPrefixMapping[overload1]$$$startPrefixMappingconstQString&constQString& -->
<h3 class="fn" id="startPrefixMapping"><a name="startPrefixMapping"></a><code>[pure virtual] </code><span class="type">bool</span> QXmlContentHandler::<span class="name">startPrefixMapping</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>prefix</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>uri</i>)</h3>
<p>The reader calls this function to signal the begin of a prefix-URI namespace mapping scope. This information is not necessary for normal namespace processing since the reader automatically replaces prefixes for element and attribute names.</p>
<p>Note that startPrefixMapping() and <a href="qxmlcontenthandler.html#endPrefixMapping">endPrefixMapping</a>() calls are not guaranteed to be properly nested relative to each other: all startPrefixMapping() events occur before the corresponding <a href="qxmlcontenthandler.html#startElement">startElement</a>() event, and all <a href="qxmlcontenthandler.html#endPrefixMapping">endPrefixMapping</a>() events occur after the corresponding <a href="qxmlcontenthandler.html#endElement">endElement</a>() event, but their order is not otherwise guaranteed.</p>
<p>The argument <i>prefix</i> is the namespace prefix being declared and the argument <i>uri</i> is the namespace URI the prefix is mapped to.</p>
<p>If this function returns <code>false</code> the reader stops parsing and reports an error. The reader uses the function <a href="qxmlcontenthandler.html#errorString">errorString</a>() to get the error message.</p>
<p><b>See also </b><a href="qxmlcontenthandler.html#endPrefixMapping">endPrefixMapping</a>() and <a href="xml-sax.html#namespace-support-via-features">Namespace Support via Features</a>.</p>
<!-- @@@startPrefixMapping -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>