Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


ElemVariable.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(XALAN_ELEMVARIABLE_HEADER_GUARD)
19 #define XALAN_ELEMVARIABLE_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
24 #include "XSLTDefinitions.hpp"
25 
26 // Base class header file.
27 #include "ElemTemplateElement.hpp"
28 
29 
30 
31 #include <xalanc/XPath/XObject.hpp>
32 
33 
34 
36 
37 
38 
39 XALAN_CPP_NAMESPACE_BEGIN
40 
41 
42 
43 class XPath;
44 
45 
46 
48 {
49 public:
50 
52 
53  /**
54  * Construct an object corresponding to an "xsl:variable" element
55  *
56  * @param constructionContext context for construction of object
57  * @param stylesheetTree stylesheet containing element
58  * @param atts list of attributes for element
59  * @param lineNumber line number in document
60  * @param columnNumber column number in document
61  */
63  StylesheetConstructionContext& constructionContext,
64  Stylesheet& stylesheetTree,
65  const AttributeListType& atts,
66  XalanFileLoc lineNumber,
67  XalanFileLoc columnNumber);
68 
69  virtual
70  ~ElemVariable();
71 
72  /**
73  * Determines if this is a top level variable.
74  *
75  * @return true if it is a top level variable
76  */
77  bool
78  isTopLevel() const
79  {
80  return m_isTopLevel;
81  }
82 
83  // These methods are inherited from ElemTemplateElement ...
84 
85  virtual const XalanQName&
86  getNameAttribute() const;
87 
88  virtual void
90  StylesheetConstructionContext& constructionContext,
91  Stylesheet& theStylesheet);
92 
93  virtual const XalanDOMString&
94  getElementName() const;
95 
96 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
97  const ElemTemplateElement*
98  startElement(StylesheetExecutionContext& executionContext) const;
99 
100  void
101  endElement(StylesheetExecutionContext& executionContext) const;
102 #else
103  virtual void
104  execute(StylesheetExecutionContext& executionContext) const;
105 #endif
106 
107  const XObjectPtr
108  getValue(
109  StylesheetExecutionContext& executionContext,
110  XalanNode* sourceNode) const;
111 
112  virtual void
114 
115  virtual const XPath*
116  getXPath(XalanSize_t index) const;
117 
118 protected:
119 
120  /**
121  * Construct an object corresponding to an "xsl:variable" element
122  *
123  * @param constructionContext context for construction of object
124  * @param stylesheetTree stylesheet containing element
125  * @param atts list of attributes for element
126  * @param lineNumber line number in document
127  * @param columnNumber column number in document
128  */
129  ElemVariable(
130  StylesheetConstructionContext& constructionContext,
131  Stylesheet& stylesheetTree,
132  const AttributeListType& atts,
133  XalanFileLoc lineNumber,
134  XalanFileLoc columnNumber,
135  int xslToken);
136 
137  /**
138  * Do common initialization.
139  *
140  * @param constructionContext context for construction of object
141  * @param stylesheetTree stylesheet containing element
142  * @param atts list of attributes for element
143  */
144  void
145  init(
146  StylesheetConstructionContext& constructionContext,
147  Stylesheet& stylesheetTree,
148  const AttributeListType& atts);
149 
150 
152 
153 private:
154 
155  // not implemented
156  ElemVariable(const ElemVariable &);
157 
158  ElemVariable&
159  operator=(const ElemVariable &);
160 
161  const XPath* m_selectPattern;
162 
163  bool m_isTopLevel;
164 
165  XObjectPtr m_value;
166 
167  XalanNode* m_varContext;
168 };
169 
170 
171 
172 XALAN_CPP_NAMESPACE_END
173 
174 
175 
176 #endif // XALAN_ELEMVARIABLE_HEADER_GUARD
virtual const XalanDOMString & getElementName() const
Get a string for the name of the element.
virtual const XPath * getXPath(XalanSize_t index) const
Get XPath pattern/expression of one of the element atribute.
virtual ~ElemVariable()
const ElemTemplateElement * startElement(StylesheetExecutionContext &executionContext) const
Completes "pre-processing" before any sub-elements are invoked (i.e.
virtual void addToStylesheet(StylesheetConstructionContext &constructionContext, Stylesheet &theStylesheet)
Called during compilation when an instance is not parented by another element, and thus...
Class to hold XObjectPtr return types.
Definition: XObject.hpp:883
Definition: XPath.hpp:64
const XObjectPtr getValue(StylesheetExecutionContext &executionContext, XalanNode *sourceNode) const
void endElement(StylesheetExecutionContext &executionContext) const
Completes "post-processing" afer any sub-elements are invoked (i.e.
ElemVariable(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts, XalanFileLoc lineNumber, XalanFileLoc columnNumber)
Construct an object corresponding to an "xsl:variable" element.
bool isTopLevel() const
Determines if this is a top level variable.
virtual void execute(StylesheetExecutionContext &executionContext) const
Execute the element.
virtual const XalanQName & getNameAttribute() const
Get the QName associated with any name attribute of this element.
ElemTemplateElement ParentType
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
This class represents the base stylesheet or an "import" stylesheet.
Definition: Stylesheet.hpp:86
const XalanQName * m_qname
Class to represent a qualified name.
Definition: XalanQName.hpp:70
void init(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts)
Do common initialization.
virtual void setParentNodeElem(ElemTemplateElement *theParent)
Set the parent node.

Interpreting class diagrams

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

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

Apache Logo