1 | #ifndef DOMEntityResolver_HEADER_GUARD_
|
---|
2 | #define DOMEntityResolver_HEADER_GUARD_
|
---|
3 |
|
---|
4 | /*
|
---|
5 | * Copyright 2002,2004 The Apache Software Foundation.
|
---|
6 | *
|
---|
7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
8 | * you may not use this file except in compliance with the License.
|
---|
9 | * You may obtain a copy of the License at
|
---|
10 | *
|
---|
11 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
12 | *
|
---|
13 | * Unless required by applicable law or agreed to in writing, software
|
---|
14 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
16 | * See the License for the specific language governing permissions and
|
---|
17 | * limitations under the License.
|
---|
18 | */
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * $Log: DOMEntityResolver.hpp,v $
|
---|
22 | * Revision 1.7 2004/09/08 13:55:39 peiyongz
|
---|
23 | * Apache License Version 2.0
|
---|
24 | *
|
---|
25 | * Revision 1.6 2003/03/07 19:59:04 tng
|
---|
26 | * [Bug 11692] Unimplement the hidden constructors and assignment operator to remove warnings from gcc.
|
---|
27 | *
|
---|
28 | * Revision 1.5 2002/11/04 15:09:24 tng
|
---|
29 | * C++ Namespace Support.
|
---|
30 | *
|
---|
31 | * Revision 1.4 2002/08/22 15:04:57 tng
|
---|
32 | * Remove unused parameter variables in inline functions.
|
---|
33 | *
|
---|
34 | * Revision 1.3 2002/06/06 20:53:06 tng
|
---|
35 | * Documentation Fix: Update the API Documentation for DOM headers
|
---|
36 | *
|
---|
37 | * Revision 1.2 2002/05/30 19:24:48 knoaman
|
---|
38 | * documentation update
|
---|
39 | *
|
---|
40 | * Revision 1.1 2002/05/29 21:28:02 knoaman
|
---|
41 | * DOM L3 LS: DOMInputSource, DOMEntityResolver, DOMImplementationLS and DOMBuilder
|
---|
42 | *
|
---|
43 | */
|
---|
44 |
|
---|
45 |
|
---|
46 | #include <xercesc/util/XercesDefs.hpp>
|
---|
47 |
|
---|
48 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
49 |
|
---|
50 |
|
---|
51 | class DOMInputSource;
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * DOMEntityResolver provides a way for applications to redirect references
|
---|
55 | * to external entities.
|
---|
56 | *
|
---|
57 | * <p>Applications needing to implement customized handling for external
|
---|
58 | * entities must implement this interface and register their implementation
|
---|
59 | * by setting the entityResolver attribute of the DOMBuilder.</p>
|
---|
60 | *
|
---|
61 | * <p>The DOMBuilder will then allow the application to intercept any
|
---|
62 | * external entities (including the external DTD subset and external parameter
|
---|
63 | * entities) before including them.</p>
|
---|
64 | *
|
---|
65 | * <p>Many DOM applications will not need to implement this interface, but it
|
---|
66 | * will be especially useful for applications that build XML documents from
|
---|
67 | * databases or other specialized input sources, or for applications that use
|
---|
68 | * URNs.</p>
|
---|
69 | *
|
---|
70 | * @see DOMBuilder#setEntityResolver
|
---|
71 | * @see DOMInputSource#DOMInputSource
|
---|
72 | * @since DOM Level 3
|
---|
73 | */
|
---|
74 | class CDOM_EXPORT DOMEntityResolver
|
---|
75 | {
|
---|
76 | protected:
|
---|
77 | // -----------------------------------------------------------------------
|
---|
78 | // Hidden constructors
|
---|
79 | // -----------------------------------------------------------------------
|
---|
80 | /** @name Hidden constructors */
|
---|
81 | //@{
|
---|
82 | DOMEntityResolver() {};
|
---|
83 | //@}
|
---|
84 |
|
---|
85 | private:
|
---|
86 | // -----------------------------------------------------------------------
|
---|
87 | // Unimplemented constructors and operators
|
---|
88 | // -----------------------------------------------------------------------
|
---|
89 | /** @name Unimplemented constructors and operators */
|
---|
90 | //@{
|
---|
91 | DOMEntityResolver(const DOMEntityResolver &);
|
---|
92 | DOMEntityResolver & operator = (const DOMEntityResolver &);
|
---|
93 | //@}
|
---|
94 |
|
---|
95 | public:
|
---|
96 | // -----------------------------------------------------------------------
|
---|
97 | // All constructors are hidden, just the destructor is available
|
---|
98 | // -----------------------------------------------------------------------
|
---|
99 | /** @name Destructor */
|
---|
100 | //@{
|
---|
101 | /**
|
---|
102 | * Destructor
|
---|
103 | *
|
---|
104 | */
|
---|
105 | virtual ~DOMEntityResolver() {};
|
---|
106 | //@}
|
---|
107 |
|
---|
108 | // -----------------------------------------------------------------------
|
---|
109 | // Virtual DOMEntityResolver interface
|
---|
110 | // -----------------------------------------------------------------------
|
---|
111 | /** @name Functions introduced in DOM Level 2 */
|
---|
112 | //@{
|
---|
113 | /**
|
---|
114 | * Allow the application to resolve external entities.
|
---|
115 | *
|
---|
116 | * <p>The DOMBuilder will call this method before opening any external
|
---|
117 | * entity except the top-level document entity (including the
|
---|
118 | * external DTD subset, external entities referenced within the
|
---|
119 | * DTD, and external entities referenced within the document
|
---|
120 | * element): the application may request that the DOMBuilder resolve
|
---|
121 | * the entity itself, that it use an alternative URI, or that it
|
---|
122 | * use an entirely different input source.</p>
|
---|
123 | *
|
---|
124 | * <p>Application writers can use this method to redirect external
|
---|
125 | * system identifiers to secure and/or local URIs, to look up
|
---|
126 | * public identifiers in a catalogue, or to read an entity from a
|
---|
127 | * database or other input source (including, for example, a dialog
|
---|
128 | * box).</p>
|
---|
129 | *
|
---|
130 | * <p>If the system identifier is a URL, the DOMBuilder parser must
|
---|
131 | * resolve it fully before reporting it to the application.</p>
|
---|
132 | *
|
---|
133 | * <p> The returned DOMInputSource is owned by the DOMBuilder which is
|
---|
134 | * responsible to clean up the memory.
|
---|
135 | *
|
---|
136 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
137 | *
|
---|
138 | * @param publicId The public identifier of the external entity
|
---|
139 | * being referenced, or null if none was supplied.
|
---|
140 | * @param systemId The system identifier of the external entity
|
---|
141 | * being referenced.
|
---|
142 | * @param baseURI The absolute base URI of the resource being parsed, or
|
---|
143 | * <code>null</code> if there is no base URI.
|
---|
144 | * @return A DOMInputSource object describing the new input source,
|
---|
145 | * or <code>null</code> to request that the parser open a regular
|
---|
146 | * URI connection to the system identifier.
|
---|
147 | * The returned DOMInputSource is owned by the DOMBuilder which is
|
---|
148 | * responsible to clean up the memory.
|
---|
149 | * @exception DOMSystemException Any DOMSystemException exception, possibly
|
---|
150 | * wrapping another exception.
|
---|
151 | * @see DOMInputSource#DOMInputSource
|
---|
152 | * @since DOM Level 3
|
---|
153 | */
|
---|
154 | virtual DOMInputSource* resolveEntity
|
---|
155 | (
|
---|
156 | const XMLCh* const publicId
|
---|
157 | , const XMLCh* const systemId
|
---|
158 | , const XMLCh* const baseURI
|
---|
159 | ) = 0;
|
---|
160 |
|
---|
161 | //@}
|
---|
162 |
|
---|
163 | };
|
---|
164 |
|
---|
165 | XERCES_CPP_NAMESPACE_END
|
---|
166 |
|
---|
167 | #endif
|
---|