Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > d4089b27bfd3289c6baf8b0975a53f9e > files > 748

poco-doc-1.3.6p1-1.fc13.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::XML::ContentHandler</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.XML.html" class="namespace">Poco::XML</a></h1>
<h1 class="symbol">class ContentHandler</h1>
</div>
<div class="body">
<p>
<b>Library:</b> XML<br />
<b>Package:</b> SAX<br />
<b>Header:</b> Poco/SAX/ContentHandler.h</p>
<h2>Description</h2>
<div class="description">
<p>Receive notification of the logical content of a document.  </p>
<p>This is the main interface that most SAX applications implement: if the application needs to be informed of basic parsing events, it implements this interface and registers an instance with the SAX parser using the setContentHandler method. The parser uses the instance to report basic document-related events like the start and end of elements and character data. </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/or subelements) will appear, in order, between the startElement event and the corresponding endElement event. </p>
<p>This interface is similar to the now-deprecated SAX 1.0 DocumentHandler interface, but it adds support for Namespaces and for reporting skipped entities (in non-validating <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> processors). Receive notification of the logical content of a document. </p>
</div>
<h2>Inheritance</h2>
<p><b>Known Derived Classes: </b><a href="Poco.XML.DOMBuilder.html" title="class Poco::XML::DOMBuilder">DOMBuilder</a>, <a href="Poco.XML.DefaultHandler.html" title="class Poco::XML::DefaultHandler">DefaultHandler</a>, <a href="Poco.XML.XMLFilterImpl.html" title="class Poco::XML::XMLFilterImpl">XMLFilterImpl</a>, <a href="Poco.XML.WhitespaceFilter.html" title="class Poco::XML::WhitespaceFilter">WhitespaceFilter</a>, <a href="Poco.XML.XMLWriter.html" title="class Poco::XML::XMLWriter">XMLWriter</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.XML.ContentHandler.html#18865" title="Poco::XML::ContentHandler::characters()">characters</a>, <a href="Poco.XML.ContentHandler.html#18855" title="Poco::XML::ContentHandler::endDocument()">endDocument</a>, <a href="Poco.XML.ContentHandler.html#18861" title="Poco::XML::ContentHandler::endElement()">endElement</a>, <a href="Poco.XML.ContentHandler.html#18879" title="Poco::XML::ContentHandler::endPrefixMapping()">endPrefixMapping</a>, <a href="Poco.XML.ContentHandler.html#18869" title="Poco::XML::ContentHandler::ignorableWhitespace()">ignorableWhitespace</a>, <a href="Poco.XML.ContentHandler.html#18873" title="Poco::XML::ContentHandler::processingInstruction()">processingInstruction</a>, <a href="Poco.XML.ContentHandler.html#18852" title="Poco::XML::ContentHandler::setDocumentLocator()">setDocumentLocator</a>, <a href="Poco.XML.ContentHandler.html#18881" title="Poco::XML::ContentHandler::skippedEntity()">skippedEntity</a>, <a href="Poco.XML.ContentHandler.html#18854" title="Poco::XML::ContentHandler::startDocument()">startDocument</a>, <a href="Poco.XML.ContentHandler.html#18856" title="Poco::XML::ContentHandler::startElement()">startElement</a>, <a href="Poco.XML.ContentHandler.html#18876" title="Poco::XML::ContentHandler::startPrefixMapping()">startPrefixMapping</a></p>
<h2>Destructor</h2>
<h3><a name="18883">~ContentHandler</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.XML.ContentHandler.html" title="class Poco::XML::ContentHandler">ContentHandler</a>();</p>
<div class="description">
<p></p>
</div>
<h2>Member Functions</h2>
<h3><a name="18865">characters</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void characters(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19840" title="Poco::XML::XMLChar">XMLChar</a> ch[],<br />&nbsp;&nbsp;&nbsp;&nbsp;int start,<br />&nbsp;&nbsp;&nbsp;&nbsp;int length<br />) = 0;</p>
<div class="description">
<p>Receive notification of character data. </p>
<p>The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the <a href="Poco.XML.Locator.html" title="class Poco::XML::Locator">Locator</a> provides useful information. </p>
<p>The application must not attempt to read from the array outside of the specified range. </p>
<p>Individual characters may consist of more than one <a href="Poco.XML.html#19840" title="Poco::XML::XMLChar">XMLChar</a> value. There are three important cases where this happens, because characters can't be represented in just sixteen bits. In one case, characters are represented in a Surrogate Pair, using two special <a href="Poco.Unicode.html" title="class Poco::Unicode">Unicode</a> values. Such characters are in the so-called &quot;Astral Planes&quot;, with a code point above U+FFFF. A second case involves composite characters, such as a base character combining with one or more accent characters. And most important, if <a href="Poco.XML.html#19840" title="Poco::XML::XMLChar">XMLChar</a> is a plain char, characters are encoded in UTF-8. </p>
<p>Your code should not assume that algorithms using char-at-a-time idioms will be working in character units; in some cases they will split characters. This is relevant wherever <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> permits arbitrary characters, such as attribute values, processing instruction data, and comments as well as in data reported from this method. It's also generally relevant whenever C++ code manipulates internationalized text; the issue isn't unique to <a href="Poco.XML.html" title="namespace Poco::XML">XML</a>. </p>
<p>Note that some parsers will report whitespace in element content using the ignorableWhitespace method rather than this one (validating parsers must do so). </p>
</div>
<h3><a name="18855">endDocument</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void endDocument() = 0;</p>
<div class="description">
<p>Receive notification of the end of a document. </p>
<p>The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input. </p>
</div>
<h3><a name="18861">endElement</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void endElement(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; uri,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; localName,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; qname<br />) = 0;</p>
<div class="description">
<p>Receive notification of the end of an element. </p>
<p>The SAX parser will invoke this method at the end of every element in the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document; there will be a corresponding startElement event for every endElement event (even when the element is empty). </p>
<p>For information on the names, see startElement. </p>
</div>
<h3><a name="18879">endPrefixMapping</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void endPrefixMapping(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; prefix<br />) = 0;</p>
<div class="description">
<p>End the scope of a prefix-<a href="Poco.URI.html" title="class Poco::URI">URI</a> mapping. </p>
<p>See startPrefixMapping for details. These events will always occur immediately after the corresponding endElement event, but the order of endPrefixMapping events is not otherwise guaranteed. </p>
</div>
<h3><a name="18869">ignorableWhitespace</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void ignorableWhitespace(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19840" title="Poco::XML::XMLChar">XMLChar</a> ch[],<br />&nbsp;&nbsp;&nbsp;&nbsp;int start,<br />&nbsp;&nbsp;&nbsp;&nbsp;int length<br />) = 0;</p>
<div class="description">
<p>Receive notification of ignorable whitespace in element content. </p>
<p>Validating Parsers must use this method to report each chunk of whitespace in element content (see the W3C <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models. </p>
<p>SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the <a href="Poco.XML.Locator.html" title="class Poco::XML::Locator">Locator</a> provides useful information. </p>
<p>The application must not attempt to read from the array outside of the specified range. </p>
</div>
<h3><a name="18873">processingInstruction</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void processingInstruction(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; target,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; data<br />) = 0;</p>
<div class="description">
<p>Receive notification of a processing instruction. </p>
<p>The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element. </p>
<p>A SAX parser must never report an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> declaration (<a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0, section 2.8) or a text declaration (<a href="Poco.XML.html" title="namespace Poco::XML">XML</a> 1.0, section 4.3.1) using this method. </p>
<p>Like <a href="Poco.XML.ContentHandler.html#18865" title="Poco::XML::ContentHandler::characters()">characters</a>(), processing instruction data may have characters that need more than one char value. </p>
</div>
<h3><a name="18852">setDocumentLocator</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setDocumentLocator(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.Locator.html" title="class Poco::XML::Locator">Locator</a> * loc<br />) = 0;</p>
<div class="description">
<p>Receive an object for locating the origin of SAX document events. </p>
<p>SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the <a href="Poco.XML.ContentHandler.html" title="class Poco::XML::ContentHandler">ContentHandler</a> interface. </p>
<p>The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine. </p>
<p>Note that the locator will return correct information only during the invocation SAX event callbacks after startDocument returns and before endDocument is called. The application should not attempt to use it at any other time. </p>
</div>
<h3><a name="18881">skippedEntity</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void skippedEntity(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; name<br />) = 0;</p>
<div class="description">
<p>Receive notification of a skipped entity. This is not called for entity references within markup constructs such as element start tags or markup declarations. (The <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> recommendation requires reporting skipped external entities. SAX also reports internal entity expansion/non-expansion, except within markup constructs.) </p>
<p>The Parser will invoke this method each time the entity is skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the <a href="http://xml.org/sax/features/external-general-entities" target="_blank">http://xml.org/sax/features/external-general-entities</a> and the <a href="http://xml.org/sax/features/external-parameter-entities" target="_blank">http://xml.org/sax/features/external-parameter-entities</a> properties. </p>
</div>
<h3><a name="18854">startDocument</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void startDocument() = 0;</p>
<div class="description">
<p>Receive notification of the beginning of a document. </p>
<p>The SAX parser calls this function one time before calling all other  functions of this class (except SetDocumentLocator). </p>
</div>
<h3><a name="18856">startElement</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void startElement(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; uri,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; localName,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; qname,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.Attributes.html" title="class Poco::XML::Attributes">Attributes</a> &amp; attrList<br />) = 0;</p>
<div class="description">
<p>Receive notification of the beginning of an element. </p>
<p>The Parser will invoke this method at the beginning of every element in the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document; there will be a corresponding endElement event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event. </p>
<p>This event allows up to three name components for each element: </p>
<ol>
<li>the Namespace <a href="Poco.URI.html" title="class Poco::URI">URI</a>; </li>
<li>the local name; and </li>
<li>the qualified (prefixed) name. </li>
</ol>
<p><a href="Poco.Any.html" title="class Poco::Any">Any</a> or all of these may be provided, depending on the values of the <a href="http://xml.org/sax/features/namespaces" target="_blank">http://xml.org/sax/features/namespaces</a> and the <a href="http://xml.org/sax/features/namespace-prefixes" target="_blank">http://xml.org/sax/features/namespace-prefixes</a> properties: </p>
<ul>
<li>the Namespace <a href="Poco.URI.html" title="class Poco::URI">URI</a> and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be); </li>
<li>the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default). </li>
</ul>
<p>Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the <a href="http://xml.org/sax/features/namespace-prefixes" target="_blank">http://xml.org/sax/features/namespace-prefixes</a> property is true (it is false by default, and support for a true value is optional). </p>
<p>Like <a href="Poco.XML.ContentHandler.html#18865" title="Poco::XML::ContentHandler::characters()">characters</a>(), attribute values may have characters that need more than one char value. </p>
</div>
<h3><a name="18876">startPrefixMapping</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void startPrefixMapping(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; prefix,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> &amp; uri<br />) = 0;</p>
<div class="description">
<p>Begin the scope of a prefix-<a href="Poco.URI.html" title="class Poco::URI">URI</a> Namespace mapping. </p>
<p>The information from this event is not necessary for normal Namespace processing: the SAX <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> reader will automatically replace prefixes for element and attribute names when the <a href="http://xml.org/sax/features/namespaces" target="_blank">http://xml.org/sax/features/namespaces</a> feature is true (the default). </p>
<p>There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary. </p>
<p>Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each other: all startPrefixMapping events will occur immediately before the corresponding startElement event, and all endPrefixMapping events will occur immediately after the corresponding endElement event, but their order is not otherwise guaranteed. </p>
<p>There should never be start/endPrefixMapping events for the &quot;xml&quot; prefix, since it is predeclared and immutable. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>