Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

ElemForEach.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(XALAN_ELEMFOREACH_HEADER_GUARD)
17 #define XALAN_ELEMFOREACH_HEADER_GUARD
18 
19 
20 
21 // Base include file. Must be first.
22 #include "XSLTDefinitions.hpp"
23 
24 
25 
27 
28 
29 
30 // Base class header file.
31 #include "ElemTemplateElement.hpp"
32 
33 
34 
37 #include <xalanc/XPath/XObject.hpp>
38 
39 
40 
41 #include "Constants.hpp"
42 
43 
44 
45 XALAN_CPP_NAMESPACE_BEGIN
46 
47 
48 
49 class ElemSort;
50 class ElemTemplate;
51 class NodeSorter;
52 class XPath;
53 
54 
55 
57 {
58 public:
59 
70  StylesheetConstructionContext& constructionContext,
71  Stylesheet& stylesheetTree,
72  const AttributeListType& atts,
73  int lineNumber,
74  int columnNumber);
75 
76  virtual
77  ~ElemForEach();
78 
80 
81  // These methods are inherited from ElemTemplateElement ...
82 
83  virtual const XalanDOMString&
84  getElementName() const;
85 
86  virtual void
88  StylesheetConstructionContext& constructionContext,
89  Stylesheet& theStylesheet,
90  const AttributeListType& atts,
91  const LocatorType* locator = 0);
92 
93  virtual void
95  StylesheetConstructionContext& constructionContext,
96  const NamespacesHandler& theParentHandler);
97 
98 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
99  virtual const ElemTemplateElement*
100  startElement(StylesheetExecutionContext& executionContext) const;
101 
102  virtual void
103  endElement(StylesheetExecutionContext& executionContext) const;
104 
105  virtual const ElemTemplateElement*
107  StylesheetExecutionContext& executionContext,
108  const ElemTemplateElement* currentElem) const;
109 #else
110  virtual void
111  execute(StylesheetExecutionContext& executionContext) const;
112 #endif
113 
114  virtual const XPath*
115  getXPath(unsigned int index = 0) const;
116 
117 protected:
118 
128  ElemForEach(
129  StylesheetConstructionContext& constructionContext,
130  Stylesheet& stylesheetTree,
131  int lineNumber,
132  int columnNumber,
133  int xslToken);
134 
135 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
136 
137  /*
138  * Returns a pointer to a list of the selected nodes. The
139  * nodes are sorted if required.
140  *
141  * @param executionContext context for executing this element
142  * @return pointer to the list of selected (and sorted) nodes
143  */
144  virtual const NodeRefListBase*
146  StylesheetExecutionContext& executionContext) const;
147 
148  /*
149  * Release any objects used to maintain the last selected
150  * (and sorted) node list to be created
151  *
152  * @param executionContext context for executing this element
153  */
154  virtual void
156  StylesheetExecutionContext& executionContext) const;
157 
158  /*
159  * Sorts a list of nodes
160  *
161  * @param executionContext context for executing this element
162  * @param selectedNodeList list of nodes to be sorted
163  * @param sortedNodeList list for sorted nodes
164  *
165  * @returns pointer to list of sorted nodes
166  */
167  virtual const NodeRefListBase*
168  sortChildren(
169  StylesheetExecutionContext& executionContext,
170  const NodeRefListBase& selectedNodeList,
171  MutableNodeRefList& sortedNodeList) const;
172 
173 #else
174 
181  void
182  transformSelectedChildren(
183  StylesheetExecutionContext& executionContext,
184  const ElemTemplateElement* theTemplate) const;
185 
194  void
195  transformSelectedChildren(
196  StylesheetExecutionContext& executionContext,
197  const ElemTemplateElement* theTemplate,
198  const NodeRefListBase& sourceNodes,
199  NodeRefListBase::size_type sourceNodesCount) const;
200 
210  virtual void
211  selectAndSortChildren(
212  StylesheetExecutionContext& executionContext,
213  const ElemTemplateElement* theTemplate,
214  NodeSorter* sorter,
215  int selectStackFrameIndex) const;
216 #endif
217 
219 
220 private:
221 
222  SortElemsVectorType m_sortElems;
223 
224  SortElemsVectorType::size_type m_sortElemsCount;
225 
226 };
227 
228 
229 
230 XALAN_CPP_NAMESPACE_END
231 
232 
233 
234 #endif // XALAN_ELEMFOREACH_HEADER_GUARD

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo