DOMEntityResolver.hpp
上传用户:zhuqijet
上传日期:2013-06-25
资源大小:10074k
文件大小:8k
源码类别:

词法分析

开发平台:

Visual C++

  1. #ifndef DOMEntityResolver_HEADER_GUARD_
  2. #define DOMEntityResolver_HEADER_GUARD_
  3. /*
  4.  * The Apache Software License, Version 1.1
  5.  *
  6.  * Copyright (c) 2002 The Apache Software Foundation.  All rights
  7.  * reserved.
  8.  *
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that the following conditions
  11.  * are met:
  12.  *
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  *
  16.  * 2. Redistributions in binary form must reproduce the above copyright
  17.  *    notice, this list of conditions and the following disclaimer in
  18.  *    the documentation and/or other materials provided with the
  19.  *    distribution.
  20.  *
  21.  * 3. The end-user documentation included with the redistribution,
  22.  *    if any, must include the following acknowledgment:
  23.  *       "This product includes software developed by the
  24.  *        Apache Software Foundation (http://www.apache.org/)."
  25.  *    Alternately, this acknowledgment may appear in the software itself,
  26.  *    if and wherever such third-party acknowledgments normally appear.
  27.  *
  28.  * 4. The names "Xerces" and "Apache Software Foundation" must
  29.  *    not be used to endorse or promote products derived from this
  30.  *    software without prior written permission. For written
  31.  *    permission, please contact apache@apache.org.
  32.  *
  33.  * 5. Products derived from this software may not be called "Apache",
  34.  *    nor may "Apache" appear in their name, without prior written
  35.  *    permission of the Apache Software Foundation.
  36.  *
  37.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  38.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  39.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  40.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  41.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  42.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  43.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  44.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  45.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  46.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  47.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  48.  * SUCH DAMAGE.
  49.  * ====================================================================
  50.  *
  51.  * This software consists of voluntary contributions made by many
  52.  * individuals on behalf of the Apache Software Foundation, and was
  53.  * originally based on software copyright (c) 1999, International
  54.  * Business Machines, Inc., http://www.ibm.com .  For more information
  55.  * on the Apache Software Foundation, please see
  56.  * <http://www.apache.org/>.
  57.  */
  58. /*
  59.  * $Log: DOMEntityResolver.hpp,v $
  60.  * Revision 1.6  2003/03/07 19:59:04  tng
  61.  * [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
  62.  *
  63.  * Revision 1.5  2002/11/04 15:09:24  tng
  64.  * C++ Namespace Support.
  65.  *
  66.  * Revision 1.4  2002/08/22 15:04:57  tng
  67.  * Remove unused parameter variables in inline functions.
  68.  *
  69.  * Revision 1.3  2002/06/06 20:53:06  tng
  70.  * Documentation Fix: Update the API Documentation for DOM headers
  71.  *
  72.  * Revision 1.2  2002/05/30 19:24:48  knoaman
  73.  * documentation update
  74.  *
  75.  * Revision 1.1  2002/05/29 21:28:02  knoaman
  76.  * DOM L3 LS: DOMInputSource, DOMEntityResolver, DOMImplementationLS and DOMBuilder
  77.  *
  78.  */
  79. #include <xercesc/util/XercesDefs.hpp>
  80. XERCES_CPP_NAMESPACE_BEGIN
  81. class DOMInputSource;
  82. /**
  83.   * DOMEntityResolver provides a way for applications to redirect references
  84.   * to external entities.
  85.   *
  86.   * <p>Applications needing to implement customized handling for external
  87.   * entities must implement this interface and register their implementation
  88.   * by setting the entityResolver attribute of the DOMBuilder.</p>
  89.   *
  90.   * <p>The DOMBuilder will then allow the application to intercept any
  91.   * external entities (including the external DTD subset and external parameter
  92.   * entities) before including them.</p>
  93.   *
  94.   * <p>Many DOM applications will not need to implement this interface, but it
  95.   * will be especially useful for applications that build XML documents from
  96.   * databases or other specialized input sources, or for applications that use
  97.   * URNs.</p>
  98.   *
  99.   * @see DOMBuilder#setEntityResolver
  100.   * @see DOMInputSource#DOMInputSource
  101.   * @since DOM Level 3
  102.   */
  103. class CDOM_EXPORT DOMEntityResolver
  104. {
  105. protected:
  106.     // -----------------------------------------------------------------------
  107.     //  Hidden constructors
  108.     // -----------------------------------------------------------------------
  109.     /** @name Hidden constructors */
  110.     //@{    
  111.     DOMEntityResolver() {};
  112.     //@}
  113. private:
  114.     // -----------------------------------------------------------------------
  115.     // Unimplemented constructors and operators
  116.     // -----------------------------------------------------------------------
  117.     /** @name Unimplemented constructors and operators */
  118.     //@{
  119.     DOMEntityResolver(const DOMEntityResolver &);
  120.     DOMEntityResolver & operator = (const DOMEntityResolver &);
  121.     //@}
  122. public:
  123.     // -----------------------------------------------------------------------
  124.     //  All constructors are hidden, just the destructor is available
  125.     // -----------------------------------------------------------------------
  126.     /** @name Destructor */
  127.     //@{
  128.     /**
  129.      * Destructor
  130.      *
  131.      */
  132.     virtual ~DOMEntityResolver() {};
  133.     //@}
  134.     // -----------------------------------------------------------------------
  135.     //  Virtual DOMEntityResolver interface
  136.     // -----------------------------------------------------------------------
  137.     /** @name Functions introduced in DOM Level 2 */
  138.     //@{
  139.     /**
  140.      * Allow the application to resolve external entities.
  141.      *
  142.      * <p>The DOMBuilder will call this method before opening any external
  143.      * entity except the top-level document entity (including the
  144.      * external DTD subset, external entities referenced within the
  145.      * DTD, and external entities referenced within the document
  146.      * element): the application may request that the DOMBuilder resolve
  147.      * the entity itself, that it use an alternative URI, or that it
  148.      * use an entirely different input source.</p>
  149.      *
  150.      * <p>Application writers can use this method to redirect external
  151.      * system identifiers to secure and/or local URIs, to look up
  152.      * public identifiers in a catalogue, or to read an entity from a
  153.      * database or other input source (including, for example, a dialog
  154.      * box).</p>
  155.      *
  156.      * <p>If the system identifier is a URL, the DOMBuilder parser must
  157.      * resolve it fully before reporting it to the application.</p>
  158.      *
  159.      * <p> The returned DOMInputSource is owned by the DOMBuilder which is
  160.      *     responsible to clean up the memory.
  161.      *
  162.      * <p><b>"Experimental - subject to change"</b></p>
  163.      *
  164.      * @param publicId The public identifier of the external entity
  165.      *        being referenced, or null if none was supplied.
  166.      * @param systemId The system identifier of the external entity
  167.      *        being referenced.
  168.      * @param baseURI The absolute base URI of the resource being parsed, or
  169.      *        <code>null</code> if there is no base URI.
  170.      * @return A DOMInputSource object describing the new input source,
  171.      *         or <code>null</code> to request that the parser open a regular
  172.      *         URI connection to the system identifier.
  173.      *         The returned DOMInputSource is owned by the DOMBuilder which is
  174.      *         responsible to clean up the memory.
  175.      * @exception DOMSystemException Any DOMSystemException exception, possibly
  176.      *            wrapping another exception.
  177.      * @see DOMInputSource#DOMInputSource
  178.      * @since DOM Level 3
  179.      */
  180.     virtual DOMInputSource* resolveEntity
  181.     (
  182.         const   XMLCh* const    publicId
  183.         , const XMLCh* const    systemId
  184.         , const XMLCh* const    baseURI
  185.     ) = 0;
  186.     //@}
  187. };
  188. XERCES_CPP_NAMESPACE_END
  189. #endif