Sophie

Sophie

distrib > Momonga > development > i686 > media > os > by-pkgid > 8094ac79f986f14af880f5f612391693 > files > 807

xml-commons-apis-manual-1.4.01-4m.mo8.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_18) on Sun Jun 12 19:55:32 JST 2011 -->
<TITLE>
EntityResolver (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3)
</TITLE>

<META NAME="date" CONTENT="2011-06-12">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="EntityResolver (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/xml/sax/DTDHandler.html" title="interface in org.xml.sax"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?org/xml/sax/EntityResolver.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="EntityResolver.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.xml.sax</FONT>
<BR>
Interface EntityResolver</H2>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../org/xml/sax/ext/EntityResolver2.html" title="interface in org.xml.sax.ext">EntityResolver2</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/xml/sax/helpers/DefaultHandler.html" title="class in org.xml.sax.helpers">DefaultHandler</A>, <A HREF="../../../org/xml/sax/ext/DefaultHandler2.html" title="class in org.xml.sax.ext">DefaultHandler2</A>, <A HREF="../../../org/xml/sax/HandlerBase.html" title="class in org.xml.sax">HandlerBase</A>, <A HREF="../../../org/xml/sax/helpers/XMLFilterImpl.html" title="class in org.xml.sax.helpers">XMLFilterImpl</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>EntityResolver</B></DL>
</PRE>

<P>
Basic interface for resolving entities.

 <blockquote>
 <em>This module, both source code and documentation, is in the
 Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
 See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
 for further information.
 </blockquote>

 <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 driver using the
 <A HREF="../../../org/xml/sax/XMLReader.html#setEntityResolver(org.xml.sax.EntityResolver)"><CODE>setEntityResolver</CODE></A>
 method.</p>

 <p>The XML reader 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>

 <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>

 <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>

 <pre>
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;

 public class MyResolver implements EntityResolver {
   public InputSource resolveEntity (String publicId, String systemId)
   {
     if (systemId.equals("http://www.myhost.com/today")) {
              // return a special input source
       MyReader reader = new MyReader();
       return new InputSource(reader);
     } else {
              // use the default behaviour
       return null;
     }
   }
 }
 </pre>

 <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>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>SAX 1.0</DD>
<DT><B>Version:</B></DT>
  <DD>2.0.1 (sax2r2)</DD>
<DT><B>Author:</B></DT>
  <DD>David Megginson</DD>
<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/XMLReader.html#setEntityResolver(org.xml.sax.EntityResolver)"><CODE>XMLReader.setEntityResolver(org.xml.sax.EntityResolver)</CODE></A>, 
<A HREF="../../../org/xml/sax/InputSource.html" title="class in org.xml.sax"><CODE>InputSource</CODE></A></DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/xml/sax/InputSource.html" title="class in org.xml.sax">InputSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/xml/sax/EntityResolver.html#resolveEntity(java.lang.String, java.lang.String)">resolveEntity</A></B>(java.lang.String&nbsp;publicId,
              java.lang.String&nbsp;systemId)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allow the application to resolve external entities.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="resolveEntity(java.lang.String, java.lang.String)"><!-- --></A><H3>
resolveEntity</H3>
<PRE>
<A HREF="../../../org/xml/sax/InputSource.html" title="class in org.xml.sax">InputSource</A> <B>resolveEntity</B>(java.lang.String&nbsp;publicId,
                          java.lang.String&nbsp;systemId)
                          throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A>,
                                 java.io.IOException</PRE>
<DL>
<DD>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.  Such entities include
 the external DTD subset and external parameter entities referenced
 within the DTD (in either case, only if the parser reads external
 parameter entities), and external general entities referenced
 within the document element (if the parser reads external general
 entities).  The application may request that the parser locate
 the entity itself, that it use an alternative URI, or that it
 use data provided by the application (as a character or byte
 input stream).</p>

 <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).  Neither XML nor SAX specifies a preferred policy for using
 public or system IDs to resolve resources.  However, SAX specifies
 how to interpret any InputSource returned by this method, and that
 if none is returned, then the system ID will be dereferenced as
 a URL.  </p>

 <p>If the system identifier is a URL, the SAX parser must
 resolve it fully before reporting it to the application.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>publicId</CODE> - The public identifier of the external entity
        being referenced, or null if none was supplied.<DD><CODE>systemId</CODE> - The system identifier of the external entity
        being referenced.
<DT><B>Returns:</B><DD>An InputSource object describing the new input source,
         or null to request that the parser open a regular
         URI connection to the system identifier.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - Any SAX exception, possibly
            wrapping another exception.
<DD><CODE>java.io.IOException</CODE> - A Java-specific IO exception,
            possibly the result of creating a new InputStream
            or Reader for the InputSource.<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/InputSource.html" title="class in org.xml.sax"><CODE>InputSource</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/xml/sax/DTDHandler.html" title="interface in org.xml.sax"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?org/xml/sax/EntityResolver.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="EntityResolver.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>