1 | /*
|
---|
2 | * The Apache Software License, Version 1.1
|
---|
3 | *
|
---|
4 | * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
---|
5 | * reserved.
|
---|
6 | *
|
---|
7 | * Redistribution and use in source and binary forms, with or without
|
---|
8 | * modification, are permitted provided that the following conditions
|
---|
9 | * are met:
|
---|
10 | *
|
---|
11 | * 1. Redistributions of source code must retain the above copyright
|
---|
12 | * notice, this list of conditions and the following disclaimer.
|
---|
13 | *
|
---|
14 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
15 | * notice, this list of conditions and the following disclaimer in
|
---|
16 | * the documentation and/or other materials provided with the
|
---|
17 | * distribution.
|
---|
18 | *
|
---|
19 | * 3. The end-user documentation included with the redistribution,
|
---|
20 | * if any, must include the following acknowledgment:
|
---|
21 | * "This product includes software developed by the
|
---|
22 | * Apache Software Foundation (http://www.apache.org/)."
|
---|
23 | * Alternately, this acknowledgment may appear in the software itself,
|
---|
24 | * if and wherever such third-party acknowledgments normally appear.
|
---|
25 | *
|
---|
26 | * 4. The names "Xerces" and "Apache Software Foundation" must
|
---|
27 | * not be used to endorse or promote products derived from this
|
---|
28 | * software without prior written permission. For written
|
---|
29 | * permission, please contact apache\@apache.org.
|
---|
30 | *
|
---|
31 | * 5. Products derived from this software may not be called "Apache",
|
---|
32 | * nor may "Apache" appear in their name, without prior written
|
---|
33 | * permission of the Apache Software Foundation.
|
---|
34 | *
|
---|
35 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
---|
36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
37 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
38 | * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
---|
39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
---|
40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
---|
41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
---|
42 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
43 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
---|
44 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
---|
45 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
46 | * SUCH DAMAGE.
|
---|
47 | * ====================================================================
|
---|
48 | *
|
---|
49 | * This software consists of voluntary contributions made by many
|
---|
50 | * individuals on behalf of the Apache Software Foundation, and was
|
---|
51 | * originally based on software copyright (c) 1999, International
|
---|
52 | * Business Machines, Inc., http://www.ibm.com . For more information
|
---|
53 | * on the Apache Software Foundation, please see
|
---|
54 | * <http://www.apache.org/>.
|
---|
55 | */
|
---|
56 |
|
---|
57 | /*
|
---|
58 | * $Id: DOM_DOMImplementation.hpp,v 1.4 2003/05/22 02:26:50 knoaman Exp $
|
---|
59 | */
|
---|
60 |
|
---|
61 | #ifndef DOM_DOMImplementation_HEADER_GUARD_
|
---|
62 | #define DOM_DOMImplementation_HEADER_GUARD_
|
---|
63 |
|
---|
64 | #include <xercesc/util/PlatformUtils.hpp>
|
---|
65 | #include "DOMString.hpp"
|
---|
66 |
|
---|
67 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
68 |
|
---|
69 |
|
---|
70 | class DOM_Document;
|
---|
71 | class DOM_DocumentType;
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * This class provides a way to query the capabilities of an implementation
|
---|
75 | * of the DOM
|
---|
76 | */
|
---|
77 |
|
---|
78 |
|
---|
79 | class CDOM_EXPORT DOM_DOMImplementation {
|
---|
80 | private:
|
---|
81 | DOM_DOMImplementation(const DOM_DOMImplementation &other);
|
---|
82 |
|
---|
83 | public:
|
---|
84 | /** @name Constructors and assignment operators */
|
---|
85 | //@{
|
---|
86 | /**
|
---|
87 | * Construct a DOM_Implementation reference variable, which should
|
---|
88 | * be assigned to the return value from
|
---|
89 | * <code>DOM_Implementation::getImplementation()</code>.
|
---|
90 | */
|
---|
91 | DOM_DOMImplementation();
|
---|
92 |
|
---|
93 | /**
|
---|
94 | * Assignment operator
|
---|
95 | *
|
---|
96 | */
|
---|
97 | DOM_DOMImplementation & operator = (const DOM_DOMImplementation &other);
|
---|
98 | //@}
|
---|
99 |
|
---|
100 | /** @name Destructor */
|
---|
101 | //@{
|
---|
102 | /**
|
---|
103 | * Destructor. The object being destroyed is a reference to the DOMImplemenentation,
|
---|
104 | * not the underlying DOMImplementation object itself, which is owned by
|
---|
105 | * the implementation code.
|
---|
106 | *
|
---|
107 | */
|
---|
108 |
|
---|
109 | ~DOM_DOMImplementation();
|
---|
110 | //@}
|
---|
111 |
|
---|
112 | /** @name Getter functions */
|
---|
113 | //@{
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * Test if the DOM implementation implements a specific feature.
|
---|
117 | *
|
---|
118 | * @param feature The string of the feature to test (case-insensitive). The legal
|
---|
119 | * values are defined throughout this specification. The string must be
|
---|
120 | * an <EM>XML name</EM> (see also Compliance).
|
---|
121 | * @param version This is the version number of the package name to test.
|
---|
122 | * In Level 1, this is the string "1.0". If the version is not specified,
|
---|
123 | * supporting any version of the feature will cause the method to return
|
---|
124 | * <code>true</code>.
|
---|
125 | * @return <code>true</code> if the feature is implemented in the specified
|
---|
126 | * version, <code>false</code> otherwise.
|
---|
127 | */
|
---|
128 | bool hasFeature(const DOMString &feature, const DOMString &version);
|
---|
129 |
|
---|
130 |
|
---|
131 | /** Return a reference to a DOM_Implementation object for this
|
---|
132 | * DOM implementation.
|
---|
133 | *
|
---|
134 | * Intended to support applications that may be
|
---|
135 | * using DOMs retrieved from several different sources, potentially
|
---|
136 | * with different underlying implementations.
|
---|
137 | */
|
---|
138 | static DOM_DOMImplementation &getImplementation();
|
---|
139 |
|
---|
140 | //@}
|
---|
141 |
|
---|
142 | /** @name Functions introduced in DOM Level 2. */
|
---|
143 | //@{
|
---|
144 | /**
|
---|
145 | * Creates an empty <code>DOM_DocumentType</code> node.
|
---|
146 | * Entity declarations and notations are not made available.
|
---|
147 | * Entity reference expansions and default attribute additions
|
---|
148 | * do not occur. It is expected that a future version of the DOM
|
---|
149 | * will provide a way for populating a <code>DOM_DocumentType</code>.
|
---|
150 | *
|
---|
151 | * @param qualifiedName The <em>qualified name</em>
|
---|
152 | * of the document type to be created.
|
---|
153 | * @param publicId The external subset public identifier.
|
---|
154 | * @param systemId The external subset system identifier.
|
---|
155 | * @return A new <code>DOM_DocumentType</code> node with
|
---|
156 | * <code>Node.ownerDocument</code> set to <code>null</code>.
|
---|
157 | * @exception DOMException
|
---|
158 | * INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
---|
159 | * contains an illegal character.
|
---|
160 | * <br>
|
---|
161 | * NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is malformed.
|
---|
162 | */
|
---|
163 | DOM_DocumentType createDocumentType(const DOMString &qualifiedName,
|
---|
164 | const DOMString &publicId, const DOMString &systemId);
|
---|
165 |
|
---|
166 | /**
|
---|
167 | * Creates an XML <code>DOM_Document</code> object of the specified type
|
---|
168 | * with its document element.
|
---|
169 | *
|
---|
170 | * @param namespaceURI The <em>namespace URI</em> of
|
---|
171 | * the document element to create, or <code>null</code>.
|
---|
172 | * @param qualifiedName The <em>qualified name</em>
|
---|
173 | * of the document element to be created.
|
---|
174 | * @param doctype The type of document to be created or <code>null</code>.
|
---|
175 | * <p>When <code>doctype</code> is not <code>null</code>, its
|
---|
176 | * <code>Node.ownerDocument</code> attribute is set to the document
|
---|
177 | * being created.
|
---|
178 | * @return A new <code>DOM_Document</code> object.
|
---|
179 | * @exception DOMException
|
---|
180 | * INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
---|
181 | * contains an illegal character.
|
---|
182 | * <br>
|
---|
183 | * NAMESPACE_ERR: Raised if the <CODE>qualifiedName</CODE> is
|
---|
184 | * malformed, or if the <CODE>qualifiedName</CODE> has a prefix that is
|
---|
185 | * "xml" and the <CODE>namespaceURI</CODE> is different from
|
---|
186 | * "http://www.w3.org/XML/1998/namespace".
|
---|
187 | * <br>
|
---|
188 | * WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
|
---|
189 | * been used with a different document.
|
---|
190 | */
|
---|
191 | DOM_Document createDocument(const DOMString &namespaceURI,
|
---|
192 | const DOMString &qualifiedName, const DOM_DocumentType &doctype,
|
---|
193 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
194 | //@}
|
---|
195 |
|
---|
196 | // -----------------------------------------------------------------------
|
---|
197 | // Notification that lazy data has been deleted
|
---|
198 | // -----------------------------------------------------------------------
|
---|
199 | static void reinitDOM_DOMImplementation();
|
---|
200 | };
|
---|
201 |
|
---|
202 | XERCES_CPP_NAMESPACE_END
|
---|
203 |
|
---|
204 | #endif
|
---|