1 | #ifndef DOMEntity_HEADER_GUARD_
|
---|
2 | #define DOMEntity_HEADER_GUARD_
|
---|
3 |
|
---|
4 | /*
|
---|
5 | * The Apache Software License, Version 1.1
|
---|
6 | *
|
---|
7 | * Copyright (c) 2001-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) 2001, 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 | * $Id: DOMEntity.hpp,v 1.7 2003/03/07 19:59:03 tng Exp $
|
---|
62 | */
|
---|
63 |
|
---|
64 |
|
---|
65 | #include <xercesc/util/XercesDefs.hpp>
|
---|
66 | #include "DOMNode.hpp"
|
---|
67 |
|
---|
68 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * This interface represents an entity, either parsed or unparsed, in an XML
|
---|
72 | * document. Note that this models the entity itself not the entity
|
---|
73 | * declaration. <code>DOMEntity</code> declaration modeling has been left for a
|
---|
74 | * later Level of the DOM specification.
|
---|
75 | * <p>The <code>nodeName</code> attribute that is inherited from
|
---|
76 | * <code>DOMNode</code> contains the name of the entity.
|
---|
77 | * <p>An XML processor may choose to completely expand entities before the
|
---|
78 | * structure model is passed to the DOM; in this case there will be no
|
---|
79 | * <code>DOMEntityReference</code> nodes in the document tree.
|
---|
80 | * <p>XML does not mandate that a non-validating XML processor read and
|
---|
81 | * process entity declarations made in the external subset or declared in
|
---|
82 | * external parameter entities. This means that parsed entities declared in
|
---|
83 | * the external subset need not be expanded by some classes of applications,
|
---|
84 | * and that the replacement value of the entity may not be available. When
|
---|
85 | * the replacement value is available, the corresponding <code>DOMEntity</code>
|
---|
86 | * node's child list represents the structure of that replacement text.
|
---|
87 | * Otherwise, the child list is empty.
|
---|
88 | * <p>The DOM Level 2 does not support editing <code>DOMEntity</code> nodes; if a
|
---|
89 | * user wants to make changes to the contents of an <code>DOMEntity</code>,
|
---|
90 | * every related <code>DOMEntityReference</code> node has to be replaced in the
|
---|
91 | * structure model by a clone of the <code>DOMEntity</code>'s contents, and
|
---|
92 | * then the desired changes must be made to each of those clones instead.
|
---|
93 | * <code>DOMEntity</code> nodes and all their descendants are readonly.
|
---|
94 | * <p>An <code>DOMEntity</code> node does not have any parent.If the entity
|
---|
95 | * contains an unbound namespace prefix, the <code>namespaceURI</code> of
|
---|
96 | * the corresponding node in the <code>DOMEntity</code> node subtree is
|
---|
97 | * <code>null</code>. The same is true for <code>DOMEntityReference</code>
|
---|
98 | * nodes that refer to this entity, when they are created using the
|
---|
99 | * <code>createEntityReference</code> method of the <code>DOMDocument</code>
|
---|
100 | * interface. The DOM Level 2 does not support any mechanism to resolve
|
---|
101 | * namespace prefixes.
|
---|
102 | * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
|
---|
103 | *
|
---|
104 | * @since DOM Level 1
|
---|
105 | */
|
---|
106 | class CDOM_EXPORT DOMEntity: public DOMNode {
|
---|
107 | protected:
|
---|
108 | // -----------------------------------------------------------------------
|
---|
109 | // Hidden constructors
|
---|
110 | // -----------------------------------------------------------------------
|
---|
111 | /** @name Hidden constructors */
|
---|
112 | //@{
|
---|
113 | DOMEntity() {};
|
---|
114 | //@}
|
---|
115 |
|
---|
116 | private:
|
---|
117 | // -----------------------------------------------------------------------
|
---|
118 | // Unimplemented constructors and operators
|
---|
119 | // -----------------------------------------------------------------------
|
---|
120 | /** @name Unimplemented constructors and operators */
|
---|
121 | //@{
|
---|
122 | DOMEntity(const DOMEntity &);
|
---|
123 | DOMEntity & operator = (const DOMEntity &);
|
---|
124 | //@}
|
---|
125 |
|
---|
126 | public:
|
---|
127 | // -----------------------------------------------------------------------
|
---|
128 | // All constructors are hidden, just the destructor is available
|
---|
129 | // -----------------------------------------------------------------------
|
---|
130 | /** @name Destructor */
|
---|
131 | //@{
|
---|
132 | /**
|
---|
133 | * Destructor
|
---|
134 | *
|
---|
135 | */
|
---|
136 | virtual ~DOMEntity() {};
|
---|
137 | //@}
|
---|
138 |
|
---|
139 | // -----------------------------------------------------------------------
|
---|
140 | // Virtual DOMEntity interface
|
---|
141 | // -----------------------------------------------------------------------
|
---|
142 | /** @name Functions introduced in DOM Level 1 */
|
---|
143 | //@{
|
---|
144 | // -----------------------------------------------------------------------
|
---|
145 | // Getter methods
|
---|
146 | // -----------------------------------------------------------------------
|
---|
147 | /**
|
---|
148 | * The public identifier associated with the entity, if specified.
|
---|
149 | *
|
---|
150 | * If the public identifier was not specified, this is <code>null</code>.
|
---|
151 | *
|
---|
152 | * @since DOM Level 1
|
---|
153 | */
|
---|
154 | virtual const XMLCh * getPublicId() const = 0;
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * The system identifier associated with the entity, if specified.
|
---|
158 | *
|
---|
159 | * If the system identifier was not specified, this is <code>null</code>.
|
---|
160 | *
|
---|
161 | * @since DOM Level 1
|
---|
162 | */
|
---|
163 | virtual const XMLCh * getSystemId() const = 0;
|
---|
164 |
|
---|
165 | /**
|
---|
166 | * For unparsed entities, the name of the notation for the entity.
|
---|
167 | *
|
---|
168 | * For parsed entities, this is <code>null</code>.
|
---|
169 | *
|
---|
170 | * @since DOM Level 1
|
---|
171 | */
|
---|
172 | virtual const XMLCh * getNotationName() const = 0;
|
---|
173 | //@}
|
---|
174 |
|
---|
175 | /** @name Functions introduced in DOM Level 3. */
|
---|
176 | //@{
|
---|
177 |
|
---|
178 | /**
|
---|
179 | * An attribute specifying the actual encoding of this entity, when it is
|
---|
180 | * an external parsed entity. This is <code>null</code> otherwise.
|
---|
181 | *
|
---|
182 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
183 | *
|
---|
184 | * @since DOM Level 3
|
---|
185 | */
|
---|
186 | virtual const XMLCh* getActualEncoding() const = 0;
|
---|
187 |
|
---|
188 | /**
|
---|
189 | * An attribute specifying the actual encoding of this entity, when it is
|
---|
190 | * an external parsed entity. This is <code>null</code> otherwise.
|
---|
191 | *
|
---|
192 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
193 | *
|
---|
194 | * @since DOM Level 3
|
---|
195 | */
|
---|
196 | virtual void setActualEncoding(const XMLCh* actualEncoding) = 0;
|
---|
197 |
|
---|
198 | /**
|
---|
199 | * An attribute specifying, as part of the text declaration, the encoding
|
---|
200 | * of this entity, when it is an external parsed entity. This is
|
---|
201 | * <code>null</code> otherwise.
|
---|
202 | *
|
---|
203 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
204 | *
|
---|
205 | * @since DOM Level 3
|
---|
206 | */
|
---|
207 | virtual const XMLCh* getEncoding() const = 0;
|
---|
208 |
|
---|
209 | /**
|
---|
210 | * An attribute specifying, as part of the text declaration, the encoding
|
---|
211 | * of this entity, when it is an external parsed entity. This is
|
---|
212 | * <code>null</code> otherwise.
|
---|
213 | *
|
---|
214 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
215 | *
|
---|
216 | * @since DOM Level 3
|
---|
217 | */
|
---|
218 | virtual void setEncoding(const XMLCh* encoding) = 0;
|
---|
219 |
|
---|
220 | /**
|
---|
221 | * An attribute specifying, as part of the text declaration, the version
|
---|
222 | * number of this entity, when it is an external parsed entity. This is
|
---|
223 | * <code>null</code> otherwise.
|
---|
224 | *
|
---|
225 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
226 | *
|
---|
227 | * @since DOM Level 3
|
---|
228 | */
|
---|
229 | virtual const XMLCh* getVersion() const = 0;
|
---|
230 |
|
---|
231 | /**
|
---|
232 | * An attribute specifying, as part of the text declaration, the version
|
---|
233 | * number of this entity, when it is an external parsed entity. This is
|
---|
234 | * <code>null</code> otherwise.
|
---|
235 | *
|
---|
236 | * <p><b>"Experimental - subject to change"</b></p>
|
---|
237 | *
|
---|
238 | * @since DOM Level 3
|
---|
239 | */
|
---|
240 | virtual void setVersion(const XMLCh* version) = 0;
|
---|
241 | //@}
|
---|
242 | };
|
---|
243 |
|
---|
244 | XERCES_CPP_NAMESPACE_END
|
---|
245 |
|
---|
246 | #endif
|
---|
247 |
|
---|