Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 2092

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/xml/qxml.cpp:1162 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QXmlContentHandler Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QXmlContentHandler Class Reference<br><small>[<a href="xml.html">XML module</a>]</small></h1>

<p>The QXmlContentHandler class provides an interface to report
the logical content of XML data.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qxml-h.html">qxml.h</a>&gt;</tt>
<p>Inherited by <a href="qxmldefaulthandler.html">QXmlDefaultHandler</a>.
<p><a href="qxmlcontenthandler-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn>virtual void <a href="#setDocumentLocator"><b>setDocumentLocator</b></a> ( QXmlLocator&nbsp;*&nbsp;locator ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#startDocument"><b>startDocument</b></a> () = 0</div></li>
<li><div class=fn>virtual bool <a href="#endDocument"><b>endDocument</b></a> () = 0</div></li>
<li><div class=fn>virtual bool <a href="#startPrefixMapping"><b>startPrefixMapping</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;prefix, const&nbsp;QString&nbsp;&amp;&nbsp;uri ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#endPrefixMapping"><b>endPrefixMapping</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;prefix ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#startElement"><b>startElement</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;namespaceURI, const&nbsp;QString&nbsp;&amp;&nbsp;localName, const&nbsp;QString&nbsp;&amp;&nbsp;qName, const&nbsp;QXmlAttributes&nbsp;&amp;&nbsp;atts ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#endElement"><b>endElement</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;namespaceURI, const&nbsp;QString&nbsp;&amp;&nbsp;localName, const&nbsp;QString&nbsp;&amp;&nbsp;qName ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#characters"><b>characters</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;ch ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#ignorableWhitespace"><b>ignorableWhitespace</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;ch ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#processingInstruction"><b>processingInstruction</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;target, const&nbsp;QString&nbsp;&amp;&nbsp;data ) = 0</div></li>
<li><div class=fn>virtual bool <a href="#skippedEntity"><b>skippedEntity</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name ) = 0</div></li>
<li><div class=fn>virtual QString <a href="#errorString"><b>errorString</b></a> () = 0</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>



The QXmlContentHandler 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
implements this interface and sets it with <a href="qxmlreader.html#setContentHandler">QXmlReader::setContentHandler</a>().
The reader reports basic document-related events like the start and end of
elements and character data through this interface.
<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/or sub-elements)
appears, in order, between the <a href="#startElement">startElement</a>() event and the corresponding
<a href="#endElement">endElement</a>() event.
<p> The class <a href="qxmldefaulthandler.html">QXmlDefaultHandler</a> provides a default implementation for
this interface; subclassing from the QXmlDefaultHandler class is
very convenient if you only want to be informed of some parsing events.
<p> The <a href="#startDocument">startDocument</a>() function is called at the start of the document,
and <a href="#endDocument">endDocument</a>() is called at the end. Before parsing begins
<a href="#setDocumentLocator">setDocumentLocator</a>() is called. For each element
startElement() is called, with endElement() being called at the end
of each element. The <a href="#characters">characters</a>() function is called with chunks of
character data; <a href="#ignorableWhitespace">ignorableWhitespace</a>() is called
with chunks of whitespace and <a href="#processingInstruction">processingInstruction</a>() is called with
processing instructions. If an entity is skipped <a href="#skippedEntity">skippedEntity</a>() is
called. At the beginning of prefix-URI scopes <a href="#startPrefixMapping">startPrefixMapping</a>()
is called.
<p> See also the <a href="xml.html#sax2Intro">Introduction to SAX2</a>.
<p> <p>See also <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-tools.html">XML</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn>bool <a name="characters"></a>QXmlContentHandler::characters ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;ch )<tt> [pure virtual]</tt>
</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 have 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 <em>ch</em>.
<p> Some readers report whitespace in element content using the
<a href="#ignorableWhitespace">ignorableWhitespace</a>() function rather than using this one.
<p> A reader may report the character data of an element in more than
one chunk; e.g. a reader might want to report "a&lt;b" in three
<a href="#characters">characters</a>() events ("a ", "&lt;" and " b").
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.

<h3 class=fn>bool <a name="endDocument"></a>QXmlContentHandler::endDocument ()<tt> [pure virtual]</tt>
</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> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.
<p> <p>See also <a href="#startDocument">startDocument</a>().

<h3 class=fn>bool <a name="endElement"></a>QXmlContentHandler::endElement ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;namespaceURI, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;localName, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;qName )<tt> [pure virtual]</tt>
</h3>

<p> The reader calls this function when it has parsed an end element tag
with the qualified name <em>qName</em>, the local name <em>localName</em> and
the namespace URI <em>namespaceURI</em>.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.
<p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
<p> <p>See also <a href="#startElement">startElement</a>().

<p>Examples: <a href="tagreader-with-features-example.html#x42">xml/tagreader-with-features/structureparser.cpp</a> and <a href="xml-sax-walkthrough.html#x2091">xml/tagreader/structureparser.cpp</a>.
<h3 class=fn>bool <a name="endPrefixMapping"></a>QXmlContentHandler::endPrefixMapping ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;prefix )<tt> [pure virtual]</tt>
</h3>

<p> The reader calls this function to signal the end of a prefix mapping for the
prefix <em>prefix</em>.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.
<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 any
of the handler functions returns FALSE.

<h3 class=fn>bool <a name="ignorableWhitespace"></a>QXmlContentHandler::ignorableWhitespace ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;ch )<tt> [pure virtual]</tt>
</h3>

<p> Some readers may use this function to report each chunk of whitespace in
element content. The whitespace reported in <em>ch</em>.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.

<h3 class=fn>bool <a name="processingInstruction"></a>QXmlContentHandler::processingInstruction ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;target, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;data )<tt> [pure virtual]</tt>
</h3>

<p> The reader calls this function when it has parsed a processing
instruction.
<p> <em>target</em> is the target name of the processing instruction and <em>data</em> is the
data in the processing instruction.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.

<h3 class=fn>void <a name="setDocumentLocator"></a>QXmlContentHandler::setDocumentLocator ( <a href="qxmllocator.html">QXmlLocator</a>&nbsp;*&nbsp;locator )<tt> [pure virtual]</tt>
</h3>

<p> The reader calls this function before it starts parsing the document. The
argument <em>locator</em> is a pointer to a <a href="qxmllocator.html">QXmlLocator</a> which allows the
application 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&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;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 they
skipped the entity called <em>name</em> by calling this function.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.

<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 in
this class or in the <a href="qxmldtdhandler.html">QXmlDTDHandler</a> class are called.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.
<p> <p>See also <a href="#endDocument">endDocument</a>().

<p>Example: <a href="xml-sax-walkthrough.html#x2092">xml/tagreader/structureparser.cpp</a>.
<h3 class=fn>bool <a name="startElement"></a>QXmlContentHandler::startElement ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;namespaceURI, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;localName, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;qName, const&nbsp;<a href="qxmlattributes.html">QXmlAttributes</a>&nbsp;&amp;&nbsp;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 end
element tag is read. The <a href="#startElement">startElement</a>() and endElement() calls are always
nested correctly. Empty element tags (e.g. <tt>&lt;x/&gt;</tt>) cause a
startElement() call immediately followed by an endElement() call.
<p> The attribute list provided contains only attributes with explicit
values. The attribute list contains attributes used for namespace
declaration (i.e. attributes starting with xmlns) only if the
namespace-prefix property of the reader is TRUE.
<p> The argument <em>namespaceURI</em> is the namespace URI, or a null string if the
element 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 no
namespace 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 no
attributes, <em>atts</em> is an empty attributes object.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.
<p> See also the <a href="xml.html#sax2Namespaces">namespace description</a>.
<p> <p>See also <a href="#endElement">endElement</a>().

<p>Examples: <a href="tagreader-with-features-example.html#x43">xml/tagreader-with-features/structureparser.cpp</a> and <a href="xml-sax-walkthrough.html#x2093">xml/tagreader/structureparser.cpp</a>.
<h3 class=fn>bool <a name="startPrefixMapping"></a>QXmlContentHandler::startPrefixMapping ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;prefix, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;uri )<tt> [pure virtual]</tt>
</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> Note that <a href="#startPrefixMapping">startPrefixMapping</a>() and <a href="#endPrefixMapping">endPrefixMapping</a>() calls are not
guaranteed to be properly nested relative to each other: all
startPrefixMapping() events occur before the corresponding
<a href="#startElement">startElement</a>() event, and all endPrefixMapping() events occur after
the corresponding <a href="#endElement">endElement</a>() event, but their order is not
otherwise guaranteed.
<p> The argument <em>prefix</em> is the namespace prefix being declared and the
argument <em>uri</em> is the namespace URI the prefix is mapped to.
<p> If this function returns FALSE the reader stops parsing and reports
an error. The reader uses the function <a href="#errorString">errorString</a>() to get the error
message.
<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 &copy; 1995-2001
<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 &copy; 2001 
<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.2</div>
</table></div></address></body>
</html>