182 lines
12 KiB
HTML
182 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 Documentation</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<a style="float:right;" href="http://sourceforge.net/projects/xqilla"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=152021&type=2" border="0" alt="SourceForge.net Logo" /></a>
|
|
<!-- Generated by Doxygen 1.3.9.1 -->
|
|
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="examples.html">Examples</a></div>
|
|
<h1>xercesc::XMLEntityResolver Class Reference</h1>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#z63_0">~XMLEntityResolver</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#z63_0"></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#z65_0">resolveEntity</a> (<a class="el" href="classxercesc_1_1XMLResourceIdentifier.html">XMLResourceIdentifier</a> *resourceIdentifier)=0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allow the application to resolve external entities. <a href="#z65_0"></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#b0">XMLEntityResolver</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default Constructor. <a href="#b0"></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#z65_0">resolveEntity()</a> method. With the SAX EntityResolve the arguments are systemId and publicId. With this interface the argument is a <a class="el" href="classxercesc_1_1XMLResourceIdentifier.html">XMLResourceIdentifier</a> 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><a class="el" href="classxercesc_1_1XMLResourceIdentifier.html">XMLResourceIdentifier</a> <p>
|
|
Parser#setXMLEntityResolver <p>
|
|
<a class="el" href="classxercesc_1_1InputSource.html#z103_0">InputSource::InputSource</a> <p>
|
|
HandlerBase#HandlerBase </dd></dl>
|
|
|
|
<p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="z63_0" doxytag="xercesc::XMLEntityResolver::~XMLEntityResolver"></a><p>
|
|
<table class="mdTable" width="100%" 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::~<a class="el" href="classxercesc_1_1XMLEntityResolver.html">XMLEntityResolver</a> </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="b0" doxytag="xercesc::XMLEntityResolver::XMLEntityResolver"></a><p>
|
|
<table class="mdTable" width="100%" 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="z65_0" doxytag="xercesc::XMLEntityResolver::resolveEntity"></a><p>
|
|
<table class="mdTable" width="100%" 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"><a class="el" href="classxercesc_1_1XMLResourceIdentifier.html">XMLResourceIdentifier</a> * </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#z103_0">InputSource::InputSource</a> <p>
|
|
<a class="el" href="classxercesc_1_1XMLResourceIdentifier.html">XMLResourceIdentifier</a> </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 Fri Sep 25 06:55:42 2009 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.3.9.1 </small></address>
|
|
</body>
|
|
</html>
|