Xalan-C++ API Reference 1.12.0
XalanNode.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(XALANNODE_HEADER_GUARD_1357924680)
19#define XALANNODE_HEADER_GUARD_1357924680
20
21
22
24
25
26
27namespace XALAN_CPP_NAMESPACE {
28
29
30
31class XalanDOMString;
32class XalanDocument;
33class XalanNamedNodeMap;
34class XalanNodeList;
35
36
37
39{
40public:
41
43
44 virtual
46
48 {
49 UNKNOWN_NODE = 0,
50 ELEMENT_NODE = 1,
51 ATTRIBUTE_NODE = 2,
52 TEXT_NODE = 3,
53 CDATA_SECTION_NODE = 4,
54 ENTITY_REFERENCE_NODE = 5,
55 ENTITY_NODE = 6,
56 PROCESSING_INSTRUCTION_NODE = 7,
57 COMMENT_NODE = 8,
58 DOCUMENT_NODE = 9,
59 DOCUMENT_TYPE_NODE = 10,
60 DOCUMENT_FRAGMENT_NODE = 11,
61 NOTATION_NODE = 12
62 };
63
64 typedef unsigned long IndexType;
65
66 /**
67 * Gets the name of this node, depending on its type.
68 */
69 virtual const XalanDOMString&
70 getNodeName() const = 0;
71
72 /**
73 * Gets the value of this node, depending on its type.
74 */
75 virtual const XalanDOMString&
76 getNodeValue() const = 0;
77
78 /**
79 * An enum value representing the type of the underlying object.
80 */
81 virtual NodeType
82 getNodeType() const = 0;
83
84 /**
85 * Gets the parent of this node.
86 *
87 * If there is no such node, this returns a null pointer.
88 */
89 virtual XalanNode*
90 getParentNode() const = 0;
91
92 /**
93 * Gets a XalanNodeList that contains all children of this node.
94 *
95 * If there are no children, this is a XalanNodeList containing no nodes.
96 */
97 virtual const XalanNodeList*
98 getChildNodes() const = 0;
99
100 /**
101 * Gets the first child of this node.
102 *
103 * If there is no such node, this returns a null pointer.
104 */
105 virtual XalanNode*
106 getFirstChild() const = 0;
107
108 /**
109 * Gets the last child of this node.
110 *
111 * If there is no such node, this returns a null pointer.
112 */
113 virtual XalanNode*
114 getLastChild() const = 0;
115
116 /**
117 * Gets the node immediately preceding this node.
118 *
119 * If there is no such node, this returns a null pointer.
120 */
121 virtual XalanNode*
123
124 /**
125 * Gets the node immediately following this node.
126 *
127 * If there is no such node, this returns a null pointer.
128 */
129 virtual XalanNode*
130 getNextSibling() const = 0;
131
132 /**
133 * Gets a XalanNamedNodeMap containing the attributes of this node (if it
134 * is an XalanElement) or a null pointer otherwise.
135 */
136 virtual const XalanNamedNodeMap*
137 getAttributes() const = 0;
138
139 /**
140 * Gets the XalanDocument object associated with this node. This may
141 * be a null pointer.
142 */
143 virtual XalanDocument*
144 getOwnerDocument() const = 0;
145
146 /**
147 * Get the namespace URI of this node.
148 */
149 virtual const XalanDOMString&
150 getNamespaceURI() const = 0;
151
152 /**
153 * Get the namespace prefix of this node.
154 */
155 virtual const XalanDOMString&
156 getPrefix() const = 0;
157
158 /**
159 * Returns the local part of the qualified name of this node.
160 */
161 virtual const XalanDOMString&
162 getLocalName() const = 0;
163
164 /**
165 * Determine if the document is node-order indexed.
166 *
167 * @return true if the document is indexed, otherwise false.
168 */
169 virtual bool
170 isIndexed() const = 0;
171
172 /**
173 * Get the node's index. Valid only if the owner document
174 * reports that the document is node-order indexed.
175 *
176 * @return The index value, or 0 if the node is not indexed.
177 */
178 virtual IndexType
179 getIndex() const = 0;
180
181protected:
182
184
185 XalanNode&
187
188 bool
190
191private:
192
193#if !defined(NDEBUG)
194 static size_t s_instanceCount;
195#endif
196};
197
198
199
200}
201
202
203
204#endif // !defined(XALANNODE_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 * getLastChild() const =0
Gets the last child of this node.
virtual XalanDocument * getOwnerDocument() const =0
Gets the XalanDocument object associated with this node.
virtual const XalanNodeList * getChildNodes() const =0
Gets a XalanNodeList that contains all children of this node.
virtual bool isIndexed() const =0
Determine if the document is node-order indexed.
virtual XalanNode * getPreviousSibling() const =0
Gets the node immediately preceding this node.
bool operator==(const XalanNode &theRHS) const
virtual const XalanDOMString & getNodeName() const =0
Gets the name of this node, depending on its type.
virtual const XalanDOMString & getLocalName() const =0
Returns the local part of the qualified name of this node.
XalanNode(const XalanNode &theSource)
virtual NodeType getNodeType() const =0
An enum value representing the type of the underlying object.
virtual IndexType getIndex() const =0
Get the node's index.
virtual const XalanDOMString & getNamespaceURI() const =0
Get the namespace URI of this node.
virtual const XalanDOMString & getPrefix() const =0
Get the namespace prefix of this node.
virtual XalanNode * getFirstChild() const =0
Gets the first child of this node.
virtual const XalanNamedNodeMap * getAttributes() const =0
Gets a XalanNamedNodeMap containing the attributes of this node (if it is an XalanElement) or a null ...
unsigned long IndexType
Definition XalanNode.hpp:64
virtual ~XalanNode()
virtual const XalanDOMString & getNodeValue() const =0
Gets the value of this node, depending on its type.
XalanNode & operator=(const XalanNode &theSource)
virtual XalanNode * getNextSibling() const =0
Gets the node immediately following this node.