196 lines
12 KiB
HTML
196 lines
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>XQilla Simple API: xercesc::XMLEntityResolver Class Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.6 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li id="current"><a href="classes.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul></div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="classes.html"><span>Alphabetical List</span></a></li>
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul></div>
|
|
<div class="nav">
|
|
<a class="el" href="namespacexercesc.html">xercesc</a>::<a class="el" href="classxercesc_1_1XMLEntityResolver.html">XMLEntityResolver</a></div>
|
|
<h1>xercesc::XMLEntityResolver Class Reference</h1><!-- doxytag: class="xercesc::XMLEntityResolver" -->Revised interface for resolving entities.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="XMLEntityResolver_8hpp-source.html">XMLEntityResolver.hpp</a>></code>
|
|
<p>
|
|
<a href="classxercesc_1_1XMLEntityResolver-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td colspan="2"><div class="groupHeader">Constructors and Destructor</div></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classxercesc_1_1XMLEntityResolver.html#1b0927abdd09757caacf970ac6ff1227">~XMLEntityResolver</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#1b0927abdd09757caacf970ac6ff1227"></a><br></td></tr>
|
|
<tr><td colspan="2"><div class="groupHeader">The XMLEntityResolver interface</div></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classxercesc_1_1InputSource.html">InputSource</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classxercesc_1_1XMLEntityResolver.html#59071a14d24f600327e85a99406c8137">resolveEntity</a> (XMLResourceIdentifier *resourceIdentifier)=0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allow the application to resolve external entities. <a href="#59071a14d24f600327e85a99406c8137"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classxercesc_1_1XMLEntityResolver.html#2663910b5939f4bc8cb71cb92a81903b">XMLEntityResolver</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default Constructor. <a href="#2663910b5939f4bc8cb71cb92a81903b"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
Revised interface for resolving entities.
|
|
<p>
|
|
If an application needs to implement customized handling for external entities, it can implement this interface and register an instance with the parser using the parser's setXMLEntityResolver method or it can use the basic SAX interface (EntityResolver). The difference between the two interfaces is the arguments to the <a class="el" href="classxercesc_1_1XMLEntityResolver.html#59071a14d24f600327e85a99406c8137">resolveEntity()</a> method. With the SAX EntityResolve the arguments are systemId and publicId. With this interface the argument is a XMLResourceIdentifier object. <em>Only one EntityResolver can be set using setEntityResolver() or setXMLEntityResolver, if both are set the last one set is used.</em><p>
|
|
The parser will then allow the application to intercept any external entities (including the external DTD subset and external parameter entities, if any) before including them.<p>
|
|
Many applications will not need to implement this interface, but it will be especially useful for applications that build XML documents from databases or other specialised input sources, or for applications that use URI types other than URLs.<p>
|
|
The following resolver would provide the application with a special character stream for the entity with the system identifier "http://www.myhost.com/today":<p>
|
|
<code> include <xercesc/util/XMLEntityResolver.hpp><br>
|
|
include <xercesc/sax/InputSource.hpp><br>
|
|
<br>
|
|
class MyResolver : public <a class="el" href="classxercesc_1_1XMLEntityResolver.html">XMLEntityResolver</a> {<br>
|
|
public:<br>
|
|
<a class="el" href="classxercesc_1_1InputSource.html">InputSource</a> resolveEntity (XMLResourceIdentifier* xmlri);<br>
|
|
...<br>
|
|
};<br>
|
|
<br>
|
|
MyResolver::resolveEntity(XMLResourceIdentifier* xmlri) {<br>
|
|
switch(xmlri->getResourceIdentifierType()) {<br>
|
|
case XMLResourceIdentifier::SystemId:<br>
|
|
if (XMLString::compareString(xmlri->getSystemId(), "http://www.myhost.com/today")) {<br>
|
|
MyReader* reader = new MyReader();<br>
|
|
return new InputSource(reader);<br>
|
|
} else {<br>
|
|
return null;<br>
|
|
}<br>
|
|
break;<br>
|
|
default:<br>
|
|
return null;<br>
|
|
}<br>
|
|
}</code><p>
|
|
The application can also use this interface to redirect system identifiers to local URIs or to look up replacements in a catalog (possibly by using the public identifier).<p>
|
|
The HandlerBase class implements the default behaviour for this interface, which is simply always to return null (to request that the parser use the default system identifier).<p>
|
|
<dl compact><dt><b>See also:</b></dt><dd>XMLResourceIdentifier <p>
|
|
Parser::setXMLEntityResolver <p>
|
|
<a class="el" href="classxercesc_1_1InputSource.html#a8a03426e60c7fea417ca87fe92cdbfe">InputSource::InputSource</a> <p>
|
|
HandlerBase::HandlerBase </dd></dl>
|
|
|
|
<p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="1b0927abdd09757caacf970ac6ff1227"></a><!-- doxytag: member="xercesc::XMLEntityResolver::~XMLEntityResolver" ref="1b0927abdd09757caacf970ac6ff1227" args="()" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">virtual xercesc::XMLEntityResolver::~XMLEntityResolver </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap><code> [inline, virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Destructor.
|
|
<p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="2663910b5939f4bc8cb71cb92a81903b"></a><!-- doxytag: member="xercesc::XMLEntityResolver::XMLEntityResolver" ref="2663910b5939f4bc8cb71cb92a81903b" args="()" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">xercesc::XMLEntityResolver::XMLEntityResolver </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap><code> [inline, protected]</code></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Default Constructor.
|
|
<p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="59071a14d24f600327e85a99406c8137"></a><!-- doxytag: member="xercesc::XMLEntityResolver::resolveEntity" ref="59071a14d24f600327e85a99406c8137" args="(XMLResourceIdentifier *resourceIdentifier)=0" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">virtual <a class="el" href="classxercesc_1_1InputSource.html">InputSource</a>* xercesc::XMLEntityResolver::resolveEntity </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">XMLResourceIdentifier * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>resourceIdentifier</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap><code> [pure virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Allow the application to resolve external entities.
|
|
<p>
|
|
The Parser will call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element): the application may request that the parser resolve the entity itself, that it use an alternative URI, or that it use an entirely different input source.<p>
|
|
Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box).<p>
|
|
If the system identifier is a URL, the SAX parser must resolve it fully before reporting it to the application.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>resourceIdentifier</em> </td><td>An object containing the type of resource to be resolved and the associated data members corresponding to this type. </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>An <a class="el" href="classxercesc_1_1InputSource.html">InputSource</a> object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier. The returned <a class="el" href="classxercesc_1_1InputSource.html">InputSource</a> is owned by the parser which is responsible to clean up the memory. </dd></dl>
|
|
<dl compact><dt><b>Exceptions:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>SAXException</em> </td><td>Any SAX exception, possibly wrapping another exception. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>IOException</em> </td><td>An IO exception, possibly the result of creating a new InputStream or Reader for the <a class="el" href="classxercesc_1_1InputSource.html">InputSource</a>.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classxercesc_1_1InputSource.html#a8a03426e60c7fea417ca87fe92cdbfe">InputSource::InputSource</a> <p>
|
|
XMLResourceIdentifier </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="XMLEntityResolver_8hpp-source.html">XMLEntityResolver.hpp</a></ul>
|
|
<hr size="1"><address style="align: right;"><small>Generated on Tue Dec 12 00:18:57 2006 for XQilla Simple API by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
|
|
</body>
|
|
</html>
|