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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
|
<!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::XMLReader</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 XMLReader</h1>
</div>
<div class="body">
<p>
<b>Library:</b> XML<br />
<b>Package:</b> SAX<br />
<b>Header:</b> Poco/SAX/XMLReader.h</p>
<h2>Description</h2>
<div class="description">
<p>Interface for reading an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document using callbacks. <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> is the interface that an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> parser's SAX2 driver must implement. This interface allows an application to set and query features and properties in the parser, to register event handlers for document processing, and to initiate a document parse. All SAX interfaces are assumed to be synchronous: the parse methods must not return until parsing is complete, and readers must wait for an event-handler callback to return before reporting the next event. </p>
</div>
<h2>Inheritance</h2>
<p><b>Known Derived Classes: </b><a href="Poco.XML.DOMSerializer.html" title="class Poco::XML::DOMSerializer">DOMSerializer</a>, <a href="Poco.XML.XMLFilterImpl.html" title="class Poco::XML::XMLFilterImpl">XMLFilterImpl</a>, <a href="Poco.XML.SAXParser.html" title="class Poco::XML::SAXParser">SAXParser</a>, <a href="Poco.XML.WhitespaceFilter.html" title="class Poco::XML::WhitespaceFilter">WhitespaceFilter</a>, <a href="Poco.XML.XMLFilter.html" title="class Poco::XML::XMLFilter">XMLFilter</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.XML.XMLReader.html#19443" title="Poco::XML::XMLReader::getContentHandler()">getContentHandler</a>, <a href="Poco.XML.XMLReader.html#19440" title="Poco::XML::XMLReader::getDTDHandler()">getDTDHandler</a>, <a href="Poco.XML.XMLReader.html#19437" title="Poco::XML::XMLReader::getEntityResolver()">getEntityResolver</a>, <a href="Poco.XML.XMLReader.html#19446" title="Poco::XML::XMLReader::getErrorHandler()">getErrorHandler</a>, <a href="Poco.XML.XMLReader.html#19450" title="Poco::XML::XMLReader::getFeature()">getFeature</a>, <a href="Poco.XML.XMLReader.html#19458" title="Poco::XML::XMLReader::getProperty()">getProperty</a>, <a href="Poco.XML.XMLReader.html#19460" title="Poco::XML::XMLReader::parse()">parse</a>, <a href="Poco.XML.XMLReader.html#19464" title="Poco::XML::XMLReader::parseMemoryNP()">parseMemoryNP</a>, <a href="Poco.XML.XMLReader.html#19441" title="Poco::XML::XMLReader::setContentHandler()">setContentHandler</a>, <a href="Poco.XML.XMLReader.html#19438" title="Poco::XML::XMLReader::setDTDHandler()">setDTDHandler</a>, <a href="Poco.XML.XMLReader.html#19435" title="Poco::XML::XMLReader::setEntityResolver()">setEntityResolver</a>, <a href="Poco.XML.XMLReader.html#19444" title="Poco::XML::XMLReader::setErrorHandler()">setErrorHandler</a>, <a href="Poco.XML.XMLReader.html#19447" title="Poco::XML::XMLReader::setFeature()">setFeature</a>, <a href="Poco.XML.XMLReader.html#19452" title="Poco::XML::XMLReader::setProperty()">setProperty</a></p>
<h2>Destructor</h2>
<h3><a name="19475">~XMLReader</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.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a>();</p>
<div class="description">
<p></p>
</div>
<h2>Member Functions</h2>
<h3><a name="19443">getContentHandler</a> <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> * getContentHandler() const = 0;</p>
<div class="description">
<p>Return the current content handler. </p>
</div>
<h3><a name="19440">getDTDHandler</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual <a href="Poco.XML.DTDHandler.html" title="class Poco::XML::DTDHandler">DTDHandler</a> * getDTDHandler() const = 0;</p>
<div class="description">
<p>Return the current DTD handler. </p>
</div>
<h3><a name="19437">getEntityResolver</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual <a href="Poco.XML.EntityResolver.html" title="class Poco::XML::EntityResolver">EntityResolver</a> * getEntityResolver() const = 0;</p>
<div class="description">
<p>Return the current entity resolver. </p>
</div>
<h3><a name="19446">getErrorHandler</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual <a href="Poco.XML.ErrorHandler.html" title="class Poco::XML::ErrorHandler">ErrorHandler</a> * getErrorHandler() const = 0;</p>
<div class="description">
<p>Return the current error handler. </p>
</div>
<h3><a name="19450">getFeature</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual bool getFeature(<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & featureId<br />) const = 0;</p>
<div class="description">
<p>Look up the value of a feature. </p>
<p>The feature name is any fully-qualified <a href="Poco.URI.html" title="class Poco::URI">URI</a>. It is possible for an <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> to recognize a feature name but temporarily be unable to return its value. Some feature values may be available only in specific contexts, such as before, during, or after a parse. Also, some feature values may not be programmatically accessible. (In the case of an adapter for SAX1 Parser, there is no implementation-independent way to expose whether the underlying parser is performing validation, expanding external entities, and so forth.) </p>
<p>All XMLReaders are required to recognize 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> feature names. Implementors are free (and encouraged) to invent their own features, using names built on their own URIs. </p>
</div>
<h3><a name="19458">getProperty</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void * getProperty(<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & propertyId<br />) const = 0;</p>
<div class="description">
<p>Look up the value of a property. String values are returned as <a href="Poco.XML.html#19840" title="Poco::XML::XMLChar">XMLChar</a>* The property name is any fully-qualified <a href="Poco.URI.html" title="class Poco::URI">URI</a>. It is possible for an <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> to recognize a property name but temporarily be unable to return its value. Some property values may be available only in specific contexts, such as before, during, or after a parse. </p>
<p>XMLReaders are not required to recognize any specific property names, though an initial core set is documented for SAX2. </p>
<p>Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs. </p>
</div>
<h3><a name="19460">parse</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void parse(<br /> <a href="Poco.XML.InputSource.html" title="class Poco::XML::InputSource">InputSource</a> * pSource<br />) = 0;</p>
<div class="description">
<p>Parse an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document. </p>
<p>The application can use this method to instruct the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> reader to begin parsing an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document from any valid input source (a character stream, a byte stream, or a <a href="Poco.URI.html" title="class Poco::URI">URI</a>). </p>
<p>Applications may not invoke this method while a parse is in progress (they should create a new <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> instead for each nested <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document). Once a parse is complete, an application may reuse the same <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> object, possibly with a different input source. Configuration of the <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> object (such as handler bindings and values established for feature flags and properties) is unchanged by completion of a parse, unless the definition of that aspect of the configuration explicitly specifies other behavior. (For example, feature flags or properties exposing characteristics of the document being parsed.) </p>
<p>During the parse, the <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> will provide information about the <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document through the registered event handlers. </p>
<p>This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception. </p>
</div>
<h3><a name="19462">parse</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void parse(<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & systemId<br />) = 0;</p>
<div class="description">
<p>Parse an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document from a system identifier. See also <a href="Poco.XML.XMLReader.html#19460" title="Poco::XML::XMLReader::parse()">parse</a>(<a href="Poco.XML.InputSource.html" title="class Poco::XML::InputSource">InputSource</a>*). </p>
</div>
<h3><a name="19464">parseMemoryNP</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void parseMemoryNP(<br /> const char * xml,<br /> std::size_t size<br />) = 0;</p>
<div class="description">
<p>Parse an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> document from memory. See also <a href="Poco.XML.XMLReader.html#19460" title="Poco::XML::XMLReader::parse()">parse</a>(<a href="Poco.XML.InputSource.html" title="class Poco::XML::InputSource">InputSource</a>*). </p>
</div>
<h3><a name="19441">setContentHandler</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setContentHandler(<br /> <a href="Poco.XML.ContentHandler.html" title="class Poco::XML::ContentHandler">ContentHandler</a> * pContentHandler<br />) = 0;</p>
<div class="description">
<p>Allow an application to register a content event handler. </p>
<p>If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored. </p>
<p>Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately. </p>
</div>
<h3><a name="19438">setDTDHandler</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setDTDHandler(<br /> <a href="Poco.XML.DTDHandler.html" title="class Poco::XML::DTDHandler">DTDHandler</a> * pDTDHandler<br />) = 0;</p>
<div class="description">
<p>Allow an application to register a DTD event handler. </p>
<p>If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored. </p>
<p>Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately. </p>
</div>
<h3><a name="19435">setEntityResolver</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setEntityResolver(<br /> <a href="Poco.XML.EntityResolver.html" title="class Poco::XML::EntityResolver">EntityResolver</a> * pResolver<br />) = 0;</p>
<div class="description">
<p>Allow an application to register an entity resolver. </p>
<p>If the application does not register an entity resolver, the <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> will perform its own default resolution. </p>
<p>Applications may register a new or different resolver in the middle of a parse, and the SAX parser must begin using the new resolver immediately. </p>
</div>
<h3><a name="19444">setErrorHandler</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setErrorHandler(<br /> <a href="Poco.XML.ErrorHandler.html" title="class Poco::XML::ErrorHandler">ErrorHandler</a> * pErrorHandler<br />) = 0;</p>
<div class="description">
<p>Allow an application to register an error event handler. </p>
<p>If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs. </p>
<p>Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately. </p>
</div>
<h3><a name="19447">setFeature</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setFeature(<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & featureId,<br /> bool state<br />) = 0;</p>
<div class="description">
<p>Set the state of a feature. </p>
<p>The feature name is any fully-qualified <a href="Poco.URI.html" title="class Poco::URI">URI</a>. It is possible for an <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> to expose a feature value but to be unable to change the current value. Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a parse. </p>
<p>All XMLReaders are required to support setting <a href="http://xml.org/sax/features/namespaces" target="_blank">http://xml.org/sax/features/namespaces</a> to true and <a href="http://xml.org/sax/features/namespace-prefixes" target="_blank">http://xml.org/sax/features/namespace-prefixes</a> to false. </p>
</div>
<h3><a name="19452">setProperty</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setProperty(<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & propertyId,<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & value<br />) = 0;</p>
<div class="description">
<p>Set the value of a property. </p>
<p>The property name is any fully-qualified <a href="Poco.URI.html" title="class Poco::URI">URI</a>. It is possible for an <a href="Poco.XML.XMLReader.html" title="class Poco::XML::XMLReader">XMLReader</a> to recognize a property name but to be unable to change the current value. Some property values may be immutable or mutable only in specific contexts, such as before, during, or after a parse. </p>
<p>XMLReaders are not required to recognize setting any specific property names, though a core set is defined by SAX2. </p>
<p>This method is also the standard mechanism for setting extended handlers. </p>
</div>
<h3><a name="19455">setProperty</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void setProperty(<br /> const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> & propertyId,<br /> void * value<br />) = 0;</p>
<div class="description">
<p>Set the value of a property. See also <a href="Poco.XML.XMLReader.html#19452" title="Poco::XML::XMLReader::setProperty()">setProperty</a>(const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a>&, const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a>&). </p>
</div>
<h2>Variables</h2>
<h3><a name="19470">FEATURE_EXTERNAL_GENERAL_ENTITIES</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19470" title="Poco::XML::XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES">FEATURE_EXTERNAL_GENERAL_ENTITIES</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19471">FEATURE_EXTERNAL_PARAMETER_ENTITIES</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19471" title="Poco::XML::XMLReader::FEATURE_EXTERNAL_PARAMETER_ENTITIES">FEATURE_EXTERNAL_PARAMETER_ENTITIES</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19468">FEATURE_NAMESPACES</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19468" title="Poco::XML::XMLReader::FEATURE_NAMESPACES">FEATURE_NAMESPACES</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19469">FEATURE_NAMESPACE_PREFIXES</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19469" title="Poco::XML::XMLReader::FEATURE_NAMESPACE_PREFIXES">FEATURE_NAMESPACE_PREFIXES</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19472">FEATURE_STRING_INTERNING</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19472" title="Poco::XML::XMLReader::FEATURE_STRING_INTERNING">FEATURE_STRING_INTERNING</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19467">FEATURE_VALIDATION</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19467" title="Poco::XML::XMLReader::FEATURE_VALIDATION">FEATURE_VALIDATION</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19473">PROPERTY_DECLARATION_HANDLER</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19473" title="Poco::XML::XMLReader::PROPERTY_DECLARATION_HANDLER">PROPERTY_DECLARATION_HANDLER</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="19474">PROPERTY_LEXICAL_HANDLER</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const <a href="Poco.XML.html#19841" title="Poco::XML::XMLString">XMLString</a> <a href="Poco.XML.XMLReader.html#19474" title="Poco::XML::XMLReader::PROPERTY_LEXICAL_HANDLER">PROPERTY_LEXICAL_HANDLER</a>;</p>
<div class="description">
<p></p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|