Xalan-C++ API Reference 1.12.0
XercesDOMWalker.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(XERCESDOMWALKER_HEADER_GUARD_1357924680)
19#define XERCESDOMWALKER_HEADER_GUARD_1357924680
20
21
22
25
26
27
28namespace XALAN_CPP_NAMESPACE {
29
30
31
33{
34public:
35
36 /**
37 * Constructor.
38 */
40
41 virtual
43
44 /**
45 * Perform a document-order traversal.
46 *
47 * Derived classes and stop the traversal by returning
48 * true from startNode() or endNode(). If that happens,
49 * the function will return the next node in document
50 * order. If desired, the caller can start traversing
51 * the tree again from that point. Note that terminal
52 * nodes will always have startNode() and endNode()
53 * called before the traversal terminates.
54 *
55 * @param pos The node in the tree with which to start the walk
56 *
57 * @return 0 if the traversal completes, or the next node if the traversal doesn't complete.
58 */
59 const DOMNodeType*
61
62 /**
63 * Perform a document-order traversal.
64 *
65 * Derived classes and stop the traversal by returning
66 * true from startNode() or endNode(). If that happens,
67 * the function will return the next node in document
68 * order. If desired, the caller can start traversing
69 * the tree again from that point. Note that terminal
70 * nodes will always have startNode() and endNode()
71 * called before the traversal terminates.
72 *
73 * @param pos The node in the tree with which to start the walk
74 *
75 * @return 0 if the traversal completes, or the next node if the traversal doesn't complete.
76 */
79
80 /**
81 * Perform a document-order traversal stopping at the
82 * provided parent node.
83 *
84 * Derived classes and stop the traversal by returning
85 * true from startNode() or endNode(). If that happens,
86 * the function will return the next node in document
87 * order. If desired, the caller can start traversing
88 * the tree again from that point. Note that terminal
89 * nodes will always have startNode() and endNode()
90 * called before the traversal terminates.
91 *
92 * @param pos The node in the tree with which to start the walk
93 * @param parent The parent of pos. Note that for multiple calls that continue the traversal, this node must remain the same.
94 *
95 * @return parent if the traversal completes, or the next node if the traversal doesn't complete.
96 */
97 const DOMNodeType*
99 const DOMNodeType* pos,
100 const DOMNodeType* parent);
101
102 /**
103 * Perform a document-order traversal stopping at the
104 * provided parent node.
105 *
106 * Derived classes and stop the traversal by returning
107 * true from startNode() or endNode(). If that happens,
108 * the function will return the next node in document
109 * order. If desired, the caller can start traversing
110 * the tree again from that point. Note that terminal
111 * nodes will always have startNode() and endNode()
112 * called before the traversal terminates.
113 *
114 * @param pos The node in the tree with which to start the walk
115 * @param parent The parent of pos. Note that for multiple calls that continue the traversal, this node must remain the same.
116 *
117 * @return parent if the traversal completes, or the next node if the traversal doesn't complete.
118 */
123
124 /**
125 * Perform a pre-order traversal.
126 *
127 * @param pos starting node
128 */
129 void
131
132 /**
133 * Perform a document-order traversal.
134 *
135 * @param pos starting node
136 */
137 void
139
140protected:
141
142 /**
143 * Called when first walking a node
144 *
145 * @param node The node
146 *
147 * @return return false if traversal should continue, or true if it should not.
148 */
149 virtual bool
150 startNode(const DOMNodeType* node) = 0;
151
152 /**
153 * Called when first walking a node
154 *
155 * @param node The node
156 *
157 * @return return false if traversal should continue, or true if it should not.
158 */
159 virtual bool
161
162 /**
163 * Called when leaving a node
164 *
165 * @param node The node
166 *
167 * @return return false if traversal should continue, or true if it should not.
168 */
169 virtual bool
170 endNode(const DOMNodeType* node) = 0;
171
172 /**
173 * Called when leaving a node
174 *
175 * @param node The node
176 *
177 * @return return false if traversal should continue, or true if it should not.
178 */
179 virtual bool
181};
182
183
184
185}
186
187
188
189#endif // XERCESDOMWALKER_HEADER_GUARD_1357924680
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
#define XALAN_XERCESPARSERLIAISON_EXPORT
DOMNodeType * traverse(DOMNodeType *pos)
Perform a document-order traversal.
virtual bool endNode(const DOMNodeType *node)=0
Called when leaving a node.
DOMNodeType * traverse(DOMNodeType *pos, DOMNodeType *parent)
Perform a document-order traversal stopping at the provided parent node.
void traverseSubtree(const DOMNodeType *pos)
Perform a pre-order traversal.
virtual bool startNode(const DOMNodeType *node)=0
Called when first walking a node.
const DOMNodeType * traverse(const DOMNodeType *pos, const DOMNodeType *parent)
Perform a document-order traversal stopping at the provided parent node.
void traverseSubtree(DOMNodeType *pos)
Perform a document-order traversal.
XercesDOMWalker()
Constructor.
virtual bool endNode(DOMNodeType *node)
Called when leaving a node.
const DOMNodeType * traverse(const DOMNodeType *pos)
Perform a document-order traversal.
virtual bool startNode(DOMNodeType *node)
Called when first walking a node.
xercesc::DOMNode DOMNodeType