Xalan-C++ API Reference 1.12.0
XalanDocument.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18#if !defined(XALANDOCUMENT_HEADER_GUARD_1357924680)
19#define XALANDOCUMENT_HEADER_GUARD_1357924680
20
21
22
25
26
27
28namespace XALAN_CPP_NAMESPACE {
29
30
31
32class XalanElement;
33
34
35
37{
38public:
39
41
42 virtual
44
45 // These interfaces are inherited from XalanNode...
46
47 virtual const XalanDOMString&
48 getNodeName() const = 0;
49
50 /**
51 * Gets the value of this node, depending on its type.
52 */
53 virtual const XalanDOMString&
54 getNodeValue() const = 0;
55
56 /**
57 * An enum value representing the type of the underlying object.
58 */
59 virtual NodeType
60 getNodeType() const = 0;
61
62 /**
63 * Gets the parent of this node.
64 *
65 * All nodes, except <code>Document</code>,
66 * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent.
67 * However, if a node has just been created and not yet added to the tree,
68 * or if it has been removed from the tree, a <code>null</code> Node
69 * is returned.
70 */
71 virtual XalanNode*
72 getParentNode() const = 0;
73
74 /**
75 * Gets a <code>NodeList</code> that contains all children of this node.
76 *
77 * If there are no children, this is a <code>NodeList</code> containing no nodes.
78 */
79 virtual const XalanNodeList*
80 getChildNodes() const = 0;
81
82 /**
83 * Gets the first child of this node.
84 *
85 * If there is no such node, this returns <code>null</code>.
86 */
87 virtual XalanNode*
88 getFirstChild() const = 0;
89
90 /**
91 * Gets the last child of this node.
92 *
93 * If there is no such node, this returns <code>null</code>.
94 */
95 virtual XalanNode*
96 getLastChild() const = 0;
97
98 /**
99 * Gets the node immediately preceding this node.
100 *
101 * If there is no such node, this returns <code>null</code>.
102 */
103 virtual XalanNode*
105
106 /**
107 * Gets the node immediately following this node.
108 *
109 * If there is no such node, this returns <code>null</code>.
110 */
111 virtual XalanNode*
112 getNextSibling() const = 0;
113
114 /**
115 * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it
116 * is an <code>Element</code>) or <code>null</code> otherwise.
117 */
118 virtual const XalanNamedNodeMap*
119 getAttributes() const = 0;
120
121 /**
122 * Gets the <code>Document</code> object associated with this node.
123 *
124 * This is also
125 * the <code>Document</code> object used to create new nodes. When this
126 * node is a <code>Document</code> or a <code>DocumentType</code>
127 * which is not used with any <code>Document</code> yet, this is
128 * <code>null</code>.
129 */
130 virtual XalanDocument*
131 getOwnerDocument() const = 0;
132
133 /**
134 * Get the <em>namespace URI</em> of
135 * this node, or <code>null</code> if it is unspecified.
136 * <p>
137 * This is not a computed value that is the result of a namespace lookup
138 * based on an examination of the namespace declarations in scope. It is
139 * merely the namespace URI given at creation time.
140 * <p>
141 * For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and
142 * <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method,
143 * such as <CODE>createElement</CODE> from the <CODE>Document</CODE>
144 * interface, this is always <CODE>null</CODE>.
145 */
146 virtual const XalanDOMString&
147 getNamespaceURI() const = 0;
148
149 /**
150 * Get the <em>namespace prefix</em>
151 * of this node, or <code>null</code> if it is unspecified.
152 */
153 virtual const XalanDOMString&
154 getPrefix() const = 0;
155
156 /**
157 * Returns the local part of the <em>qualified name</em> of this node.
158 * <p>
159 * For nodes created with a DOM Level 1 method, such as
160 * <code>createElement</code> from the <code>Document</code> interface,
161 * it is null.
162 */
163 virtual const XalanDOMString&
164 getLocalName() const = 0;
165
166 /**
167 * Determine if the document is node-order indexed.
168 *
169 * @return true if the document is indexed, otherwise false.
170 */
171 virtual bool
172 isIndexed() const = 0;
173
174 /**
175 * Get the node's index. Valid only if isIndexed()
176 * reports that the document is node-order indexed.
177 *
178 * @return The index value, or 0 if the node is not indexed.
179 */
180 virtual IndexType
181 getIndex() const = 0;
182
183 // These interfaces are new to XalanDocument...
184
185 /**
186 * Return a reference to the root element of the document.
187 */
188 virtual XalanElement*
190
191 /**
192 * Returns the <code>Element</code> whose ID is given by <code>elementId</code>.
193 * If no such element exists, returns <code>null</code>.
194 * Behavior is not defined if more than one element has this <code>ID</code>.
195 * <P><B>Note:</B> The DOM implementation must have information that says
196 * which attributes are of type ID. Attributes with the name "ID" are not of
197 * type ID unless so defined. Implementations that do not know whether
198 * attributes are of type ID or not are expected to return
199 * <CODE>null</CODE>.</P>
200 *
201 * @param elementId The unique <code>id</code> value for an element.
202 * @return The matching element.
203 */
204 virtual XalanElement*
206
207protected:
208
210
213
214 bool
216
217private:
218};
219
220
221
222}
223
224
225
226#endif // !defined(XALANDOCUMENT_HEADER_GUARD_1357924680)
#define XALAN_DOM_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
virtual XalanNode * getParentNode() const =0
Gets the parent of this node.
virtual XalanNode * getPreviousSibling() const =0
Gets the node immediately preceding this node.
virtual const XalanDOMString & getNodeName() const =0
Gets the name of this node, depending on its type.
bool operator==(const XalanDocument &theRHS) const
virtual const XalanDOMString & getNamespaceURI() const =0
Get the namespace URI of this node, or null if it is unspecified.
virtual const XalanDOMString & getPrefix() const =0
Get the namespace prefix of this node, or null if it is unspecified.
virtual XalanNode * getLastChild() const =0
Gets the last child of this node.
virtual const XalanDOMString & getLocalName() const =0
Returns the local part of the qualified name of this node.
virtual const XalanNamedNodeMap * getAttributes() const =0
Gets a NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
virtual const XalanDOMString & getNodeValue() const =0
Gets the value of this node, depending on its type.
virtual IndexType getIndex() const =0
Get the node's index.
virtual XalanElement * getElementById(const XalanDOMString &elementId) const =0
Returns the Element whose ID is given by elementId.
virtual XalanNode * getNextSibling() const =0
Gets the node immediately following this node.
XalanDocument(const XalanDocument &theSource)
virtual NodeType getNodeType() const =0
An enum value representing the type of the underlying object.
virtual const XalanNodeList * getChildNodes() const =0
Gets a NodeList that contains all children of this node.
virtual bool isIndexed() const =0
Determine if the document is node-order indexed.
virtual XalanNode * getFirstChild() const =0
Gets the first child of this node.
virtual XalanElement * getDocumentElement() const =0
Return a reference to the root element of the document.
virtual XalanDocument * getOwnerDocument() const =0
Gets the Document object associated with this node.
XalanDocument & operator=(const XalanDocument &theSource)