📄 qxmlcontenthandler.html
字号:
<p>Example: <a href="xml-sax-walkthrough.html#x2136">xml/tagreader/structureparser.cpp</a>.<h3 class=fn>bool <a name="endPrefixMapping"></a>QXmlContentHandler::endPrefixMapping ( const <a href="qstring.html">QString</a> & prefix )<tt> [pure virtual]</tt></h3><p> The reader calls this function to signal the end of a prefix mapping for theprefix <em>prefix</em>.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.<p> <p>See also <a href="#startPrefixMapping">startPrefixMapping</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="errorString"></a>QXmlContentHandler::errorString ()<tt> [pure virtual]</tt></h3><p> The reader calls this function to get an error string, e.g. if anyof the handler functions returns FALSE.<h3 class=fn>bool <a name="ignorableWhitespace"></a>QXmlContentHandler::ignorableWhitespace ( const <a href="qstring.html">QString</a> & ch )<tt> [pure virtual]</tt></h3><p> Some readers may use this function to report each chunk of whitespace inelement content. The whitespace reported in <em>ch</em>.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<h3 class=fn>bool <a name="processingInstruction"></a>QXmlContentHandler::processingInstruction ( const <a href="qstring.html">QString</a> & target, const <a href="qstring.html">QString</a> & data )<tt> [pure virtual]</tt></h3><p> The reader calls this function when it has parsed a processinginstruction.<p> <em>target</em> is the target name of the processing instruction and <em>data</em> is thedata in the processing instruction.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<h3 class=fn>void <a name="setDocumentLocator"></a>QXmlContentHandler::setDocumentLocator ( <a href="qxmllocator.html">QXmlLocator</a> * locator )<tt> [pure virtual]</tt></h3><p> The reader calls this function before it starts parsing the document. Theargument <em>locator</em> is a pointer to a <a href="qxmllocator.html">QXmlLocator</a> which allows theapplication to get the parsing position within the document.<p> Do not destroy the <em>locator</em>; it is destroyed when the reader is destroyed(do not use the <em>locator</em> after the reader is destroyed).<h3 class=fn>bool <a name="skippedEntity"></a>QXmlContentHandler::skippedEntity ( const <a href="qstring.html">QString</a> & name )<tt> [pure virtual]</tt></h3><p> Some readers may skip entities if they have not seen the declarations (e.g.because they are in an external DTD). If they do so they report that theyskipped the entity called <em>name</em> by calling this function.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<h3 class=fn>bool <a name="startDocument"></a>QXmlContentHandler::startDocument ()<tt> [pure virtual]</tt></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="#setDocumentLocator">setDocumentLocator</a>(), and before any other functions inthis class or in the <a href="qxmldtdhandler.html">QXmlDTDHandler</a> class are called.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<p> <p>See also <a href="#endDocument">endDocument</a>().<p>Example: <a href="xml-sax-walkthrough.html#x2137">xml/tagreader/structureparser.cpp</a>.<h3 class=fn>bool <a name="startElement"></a>QXmlContentHandler::startElement ( const <a href="qstring.html">QString</a> & namespaceURI, const <a href="qstring.html">QString</a> & localName, const <a href="qstring.html">QString</a> & qName, const <a href="qxmlattributes.html">QXmlAttributes</a> & atts )<tt> [pure virtual]</tt></h3><p> The reader calls this function when it has parsed a start element tag.<p> There is a corresponding <a href="#endElement">endElement</a>() call when the corresponding endelement tag is read. The <a href="#startElement">startElement</a>() and endElement() calls are alwaysnested correctly. Empty element tags (e.g. <tt><x/></tt>) cause astartElement() call immediately followed by an endElement() call.<p> The attribute list provided contains only attributes with explicitvalues. The attribute list contains attributes used for namespacedeclaration (i.e. attributes starting with xmlns) only if thenamespace-prefix property of the reader is TRUE.<p> The argument <em>namespaceURI</em> is the namespace URI, or a null string if theelement has no namespace URI or if no namespace processing is done. <em>localName</em> is the local name (without prefix), or a null string if nonamespace processing is done, <em>qName</em> is the qualified name (with prefix)and <em>atts</em> are the attributes attached to the element. If there are noattributes, <em>atts</em> is an empty attributes object.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.<p> <p>See also <a href="#endElement">endElement</a>().<p>Example: <a href="xml-sax-walkthrough.html#x2138">xml/tagreader/structureparser.cpp</a>.<h3 class=fn>bool <a name="startPrefixMapping"></a>QXmlContentHandler::startPrefixMapping ( const <a href="qstring.html">QString</a> & prefix, const <a href="qstring.html">QString</a> & uri )<tt> [pure virtual]</tt></h3><p> The reader calls this function to signal the begin of a prefix-URInamespace mapping scope. This information is not necessary for normalnamespace processing since the reader automatically replaces prefixes forelement and attribute names.<p> Note that <a href="#startPrefixMapping">startPrefixMapping</a>() and <a href="#endPrefixMapping">endPrefixMapping</a>() calls are notguaranteed to be properly nested relative to each other: allstartPrefixMapping() events occur before the corresponding<a href="#startElement">startElement</a>() event, and all endPrefixMapping() events occur afterthe corresponding <a href="#endElement">endElement</a>() event, but their order is nototherwise guaranteed.<p> The argument <em>prefix</em> is the namespace prefix being declared and theargument <em>uri</em> is the namespace URI the prefix is mapped to.<p> If this function returns FALSE the reader stops parsing and reportsan error. The reader uses the function <a href="#errorString">errorString</a>() to get the errormessage.<p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.<p> <p>See also <a href="#endPrefixMapping">endPrefixMapping</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -