Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > by-pkgid > 59e136c5713357bec32fa00e9f43af8f > files > 572

xerces-c-doc-3.1.0-2mdv2010.1.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xerces-C++: EntityResolver 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.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li class="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&nbsp;List</span></a></li>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>EntityResolver Class Reference</h1><!-- doxytag: class="EntityResolver" -->Basic interface for resolving entities.  
<a href="#_details">More...</a>
<p>
<div class="dynheader">
Inheritance diagram for EntityResolver:</div>
<div class="dynsection">

<p><center><img src="classEntityResolver.png" usemap="#EntityResolver_map" border="0" alt=""></center>
<map name="EntityResolver_map">
<area href="classDefaultHandler.html" alt="DefaultHandler" shape="rect" coords="0,56,97,80">
<area href="classHandlerBase.html" alt="HandlerBase" shape="rect" coords="107,56,204,80">
</map>
</div>

<p>
<a href="classEntityResolver-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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEntityResolver.html#14e534eb2170015056ccd71458e1058c">EntityResolver</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default Constructor.  <a href="#14e534eb2170015056ccd71458e1058c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEntityResolver.html#0d5de369cdaff0d67cfaaa63029187aa">~EntityResolver</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#0d5de369cdaff0d67cfaaa63029187aa"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">The EntityResolver interface</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classInputSource.html">InputSource</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEntityResolver.html#f6e630429ea35de71acda7287846911e">resolveEntity</a> (const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const publicId, const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const systemId)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allow the application to resolve external entities.  <a href="#f6e630429ea35de71acda7287846911e"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Basic interface for resolving entities. 
<p>
If a SAX application needs to implement customized handling for external entities, it must implement this interface and register an instance with the SAX parser using the parser's setEntityResolver method.<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 SAX 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 &lt;<a class="el" href="EntityResolver_8hpp.html">xercesc/sax/EntityResolver.hpp</a>&gt;<br>
 #include &lt;<a class="el" href="InputSource_8hpp.html">xercesc/sax/InputSource.hpp</a>&gt;<br>
 <br>
 class MyResolver : public <a class="el" href="classEntityResolver.html" title="Basic interface for resolving entities.">EntityResolver</a> {<br>
 public:<br>
&nbsp; <a class="el" href="classInputSource.html" title="A single input source for an XML entity.">InputSource</a> resolveEntity (const XMLCh* const publicId, const XMLCh* const systemId);<br>
&nbsp;&nbsp; <br>
 ...<br>
&nbsp;&nbsp; };<br>
&nbsp; <br>
 &nbsp;MyResolver::resolveEntity {<br>
 &nbsp;&nbsp;if (<a class="el" href="classXMLString.html#7ac8e671c8b93126d67ded235174e257" title="Lexicographically compares str1 and str2 and returns a value indicating their relationship...">XMLString::compareString</a>(systemId, "http://www.myhost.com/today")) {<br>
 &nbsp;&nbsp;&nbsp;MyReader* reader = new MyReader();<br>
 &nbsp;&nbsp;&nbsp;return new InputSource(reader);<br>
 &nbsp;&nbsp;} else {<br>
 &nbsp;&nbsp;&nbsp;return null;<br>
 &nbsp;&nbsp;}<br>
 &nbsp;}<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 <a class="el" href="classHandlerBase.html" title="Default base class for handlers.">HandlerBase</a> 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 class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classParser.html#62435895e0615380f3017090ac232594" title="Allow an application to register a custom entity resolver.">Parser::setEntityResolver</a> <p>
<a class="el" href="classInputSource.html#601a7aa7124e2d8e9664eda9aea6b622" title="Default constructor.">InputSource::InputSource</a> <p>
<a class="el" href="classHandlerBase.html#a9bbcdb7958bace9296940ab702ef367">HandlerBase::HandlerBase</a> </dd></dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="14e534eb2170015056ccd71458e1058c"></a><!-- doxytag: member="EntityResolver::EntityResolver" ref="14e534eb2170015056ccd71458e1058c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EntityResolver::EntityResolver           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default Constructor. 
<p>

</div>
</div><p>
<a class="anchor" name="0d5de369cdaff0d67cfaaa63029187aa"></a><!-- doxytag: member="EntityResolver::~EntityResolver" ref="0d5de369cdaff0d67cfaaa63029187aa" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual EntityResolver::~EntityResolver           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f6e630429ea35de71acda7287846911e"></a><!-- doxytag: member="EntityResolver::resolveEntity" ref="f6e630429ea35de71acda7287846911e" args="(const XMLCh *const publicId, const XMLCh *const systemId)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classInputSource.html">InputSource</a>* EntityResolver::resolveEntity           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const &nbsp;</td>
          <td class="paramname"> <em>publicId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const &nbsp;</td>
          <td class="paramname"> <em>systemId</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allow the application to resolve external entities. 
<p>
The <a class="el" href="classParser.html" title="Basic interface for SAX (Simple API for XML) parsers.">Parser</a> 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>publicId</em>&nbsp;</td><td>The public identifier of the external entity being referenced, or null if none was supplied. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>systemId</em>&nbsp;</td><td>The system identifier of the external entity being referenced. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>An <a class="el" href="classInputSource.html" title="A single input source for an XML entity.">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="classInputSource.html" title="A single input source for an XML entity.">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><a class="el" href="classSAXException.html" title="Encapsulate a general SAX error or warning.">SAXException</a></em>&nbsp;</td><td>Any SAX exception, possibly wrapping another exception. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>IOException</em>&nbsp;</td><td>An IO exception, possibly the result of creating a new InputStream or Reader for the <a class="el" href="classInputSource.html" title="A single input source for an XML entity.">InputSource</a>. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInputSource.html#601a7aa7124e2d8e9664eda9aea6b622" title="Default constructor.">InputSource::InputSource</a> </dd></dl>

<p>Implemented in <a class="el" href="classHandlerBase.html#c8887abf3674946a8c02bf6097bffd28">HandlerBase</a>, and <a class="el" href="classDefaultHandler.html#6890d0f8c734eaca9fbc5da987b2b4d4">DefaultHandler</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="EntityResolver_8hpp-source.html">EntityResolver.hpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 29 15:30:48 2010 for Xerces-C++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>