1 | #ifndef DOMEntity_HEADER_GUARD_ |
---|
2 | #define DOMEntity_HEADER_GUARD_ |
---|
3 | |
---|
4 | /* |
---|
5 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
6 | * contributor license agreements. See the NOTICE file distributed with |
---|
7 | * this work for additional information regarding copyright ownership. |
---|
8 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
9 | * (the "License"); you may not use this file except in compliance with |
---|
10 | * the License. You may obtain a copy of the License at |
---|
11 | * |
---|
12 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
13 | * |
---|
14 | * Unless required by applicable law or agreed to in writing, software |
---|
15 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
17 | * See the License for the specific language governing permissions and |
---|
18 | * limitations under the License. |
---|
19 | */ |
---|
20 | |
---|
21 | /* |
---|
22 | * $Id: DOMEntity.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
23 | */ |
---|
24 | |
---|
25 | |
---|
26 | #include <xercesc/util/XercesDefs.hpp> |
---|
27 | #include <xercesc/dom/DOMNode.hpp> |
---|
28 | |
---|
29 | XERCES_CPP_NAMESPACE_BEGIN |
---|
30 | |
---|
31 | /** |
---|
32 | * This interface represents an entity, either parsed or unparsed, in an XML |
---|
33 | * document. Note that this models the entity itself not the entity |
---|
34 | * declaration. <code>DOMEntity</code> declaration modeling has been left for a |
---|
35 | * later Level of the DOM specification. |
---|
36 | * <p>The <code>nodeName</code> attribute that is inherited from |
---|
37 | * <code>DOMNode</code> contains the name of the entity. |
---|
38 | * <p>An XML processor may choose to completely expand entities before the |
---|
39 | * structure model is passed to the DOM; in this case there will be no |
---|
40 | * <code>DOMEntityReference</code> nodes in the document tree. |
---|
41 | * <p>XML does not mandate that a non-validating XML processor read and |
---|
42 | * process entity declarations made in the external subset or declared in |
---|
43 | * external parameter entities. This means that parsed entities declared in |
---|
44 | * the external subset need not be expanded by some classes of applications, |
---|
45 | * and that the replacement value of the entity may not be available. When |
---|
46 | * the replacement value is available, the corresponding <code>DOMEntity</code> |
---|
47 | * node's child list represents the structure of that replacement text. |
---|
48 | * Otherwise, the child list is empty. |
---|
49 | * <p>The DOM Level 2 does not support editing <code>DOMEntity</code> nodes; if a |
---|
50 | * user wants to make changes to the contents of an <code>DOMEntity</code>, |
---|
51 | * every related <code>DOMEntityReference</code> node has to be replaced in the |
---|
52 | * structure model by a clone of the <code>DOMEntity</code>'s contents, and |
---|
53 | * then the desired changes must be made to each of those clones instead. |
---|
54 | * <code>DOMEntity</code> nodes and all their descendants are readonly. |
---|
55 | * <p>An <code>DOMEntity</code> node does not have any parent.If the entity |
---|
56 | * contains an unbound namespace prefix, the <code>namespaceURI</code> of |
---|
57 | * the corresponding node in the <code>DOMEntity</code> node subtree is |
---|
58 | * <code>null</code>. The same is true for <code>DOMEntityReference</code> |
---|
59 | * nodes that refer to this entity, when they are created using the |
---|
60 | * <code>createEntityReference</code> method of the <code>DOMDocument</code> |
---|
61 | * interface. The DOM Level 2 does not support any mechanism to resolve |
---|
62 | * namespace prefixes. |
---|
63 | * <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>. |
---|
64 | * |
---|
65 | * @since DOM Level 1 |
---|
66 | */ |
---|
67 | class CDOM_EXPORT DOMEntity: public DOMNode { |
---|
68 | protected: |
---|
69 | // ----------------------------------------------------------------------- |
---|
70 | // Hidden constructors |
---|
71 | // ----------------------------------------------------------------------- |
---|
72 | /** @name Hidden constructors */ |
---|
73 | //@{ |
---|
74 | DOMEntity() {} |
---|
75 | DOMEntity(const DOMEntity &other) : DOMNode(other) {} |
---|
76 | //@} |
---|
77 | |
---|
78 | private: |
---|
79 | // ----------------------------------------------------------------------- |
---|
80 | // Unimplemented constructors and operators |
---|
81 | // ----------------------------------------------------------------------- |
---|
82 | /** @name Unimplemented operators */ |
---|
83 | //@{ |
---|
84 | DOMEntity & operator = (const DOMEntity &); |
---|
85 | //@} |
---|
86 | |
---|
87 | public: |
---|
88 | // ----------------------------------------------------------------------- |
---|
89 | // All constructors are hidden, just the destructor is available |
---|
90 | // ----------------------------------------------------------------------- |
---|
91 | /** @name Destructor */ |
---|
92 | //@{ |
---|
93 | /** |
---|
94 | * Destructor |
---|
95 | * |
---|
96 | */ |
---|
97 | virtual ~DOMEntity() {}; |
---|
98 | //@} |
---|
99 | |
---|
100 | // ----------------------------------------------------------------------- |
---|
101 | // Virtual DOMEntity interface |
---|
102 | // ----------------------------------------------------------------------- |
---|
103 | /** @name Functions introduced in DOM Level 1 */ |
---|
104 | //@{ |
---|
105 | // ----------------------------------------------------------------------- |
---|
106 | // Getter methods |
---|
107 | // ----------------------------------------------------------------------- |
---|
108 | /** |
---|
109 | * The public identifier associated with the entity, if specified. |
---|
110 | * |
---|
111 | * If the public identifier was not specified, this is <code>null</code>. |
---|
112 | * |
---|
113 | * @since DOM Level 1 |
---|
114 | */ |
---|
115 | virtual const XMLCh * getPublicId() const = 0; |
---|
116 | |
---|
117 | /** |
---|
118 | * The system identifier associated with the entity, if specified. |
---|
119 | * |
---|
120 | * If the system identifier was not specified, this is <code>null</code>. |
---|
121 | * |
---|
122 | * @since DOM Level 1 |
---|
123 | */ |
---|
124 | virtual const XMLCh * getSystemId() const = 0; |
---|
125 | |
---|
126 | /** |
---|
127 | * For unparsed entities, the name of the notation for the entity. |
---|
128 | * |
---|
129 | * For parsed entities, this is <code>null</code>. |
---|
130 | * |
---|
131 | * @since DOM Level 1 |
---|
132 | */ |
---|
133 | virtual const XMLCh * getNotationName() const = 0; |
---|
134 | //@} |
---|
135 | |
---|
136 | /** @name Functions introduced in DOM Level 3. */ |
---|
137 | //@{ |
---|
138 | |
---|
139 | /** |
---|
140 | * An attribute specifying the actual encoding of this entity, when it is |
---|
141 | * an external parsed entity. This is <code>null</code> otherwise. |
---|
142 | * |
---|
143 | * <p><b>"Experimental - subject to change"</b></p> |
---|
144 | * |
---|
145 | * @since DOM Level 3 |
---|
146 | */ |
---|
147 | virtual const XMLCh* getActualEncoding() const = 0; |
---|
148 | |
---|
149 | /** |
---|
150 | * An attribute specifying the actual encoding of this entity, when it is |
---|
151 | * an external parsed entity. This is <code>null</code> otherwise. |
---|
152 | * |
---|
153 | * <p><b>"Experimental - subject to change"</b></p> |
---|
154 | * |
---|
155 | * @since DOM Level 3 |
---|
156 | */ |
---|
157 | virtual void setActualEncoding(const XMLCh* actualEncoding) = 0; |
---|
158 | |
---|
159 | /** |
---|
160 | * An attribute specifying, as part of the text declaration, the encoding |
---|
161 | * of this entity, when it is an external parsed entity. This is |
---|
162 | * <code>null</code> otherwise. |
---|
163 | * |
---|
164 | * <p><b>"Experimental - subject to change"</b></p> |
---|
165 | * |
---|
166 | * @since DOM Level 3 |
---|
167 | */ |
---|
168 | virtual const XMLCh* getEncoding() const = 0; |
---|
169 | |
---|
170 | /** |
---|
171 | * An attribute specifying, as part of the text declaration, the encoding |
---|
172 | * of this entity, when it is an external parsed entity. This is |
---|
173 | * <code>null</code> otherwise. |
---|
174 | * |
---|
175 | * <p><b>"Experimental - subject to change"</b></p> |
---|
176 | * |
---|
177 | * @since DOM Level 3 |
---|
178 | */ |
---|
179 | virtual void setEncoding(const XMLCh* encoding) = 0; |
---|
180 | |
---|
181 | /** |
---|
182 | * An attribute specifying, as part of the text declaration, the version |
---|
183 | * number of this entity, when it is an external parsed entity. This is |
---|
184 | * <code>null</code> otherwise. |
---|
185 | * |
---|
186 | * <p><b>"Experimental - subject to change"</b></p> |
---|
187 | * |
---|
188 | * @since DOM Level 3 |
---|
189 | */ |
---|
190 | virtual const XMLCh* getVersion() const = 0; |
---|
191 | |
---|
192 | /** |
---|
193 | * An attribute specifying, as part of the text declaration, the version |
---|
194 | * number of this entity, when it is an external parsed entity. This is |
---|
195 | * <code>null</code> otherwise. |
---|
196 | * |
---|
197 | * <p><b>"Experimental - subject to change"</b></p> |
---|
198 | * |
---|
199 | * @since DOM Level 3 |
---|
200 | */ |
---|
201 | virtual void setVersion(const XMLCh* version) = 0; |
---|
202 | //@} |
---|
203 | }; |
---|
204 | |
---|
205 | XERCES_CPP_NAMESPACE_END |
---|
206 | |
---|
207 | #endif |
---|