source: NonGTP/Xerces/xerces/include/xercesc/dom/DOMEntity.hpp @ 358

Revision 358, 7.7 KB checked in by bittner, 19 years ago (diff)

xerces added

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