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