Xalan-C++ API Reference 1.12.0
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.
28
29
30
32
33
34
36
37
38
39namespace XALAN_CPP_NAMESPACE {
40
41
42
43class XPath;
44
45
46
48{
49public:
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 */
68
69 virtual
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&
87
88 virtual void
92
93 virtual const XalanDOMString&
95
96#if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
99
100 void
102#else
103 virtual void
105#endif
106
107 const XObjectPtr
110 XalanNode* sourceNode) const;
111
112 virtual void
114
115 virtual const XPath*
116 getXPath(XalanSize_t index) const;
117
118protected:
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 */
132 const AttributeListType& atts,
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
148 const AttributeListType& atts);
149
150
152
153private:
154
155 // not implemented
156 ElemVariable(const ElemVariable &);
157
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}
173
174
175
176#endif // XALAN_ELEMVARIABLE_HEADER_GUARD
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
bool isTopLevel() const
Determines if this is a top level variable.
virtual void setParentNodeElem(ElemTemplateElement *theParent)
Set the parent node.
ElemTemplateElement ParentType
const XObjectPtr getValue(StylesheetExecutionContext &executionContext, XalanNode *sourceNode) const
ElemVariable(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts, XalanFileLoc lineNumber, XalanFileLoc columnNumber)
Construct an object corresponding to an "xsl:variable" element.
ElemVariable(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts, XalanFileLoc lineNumber, XalanFileLoc columnNumber, int xslToken)
Construct an object corresponding to an "xsl:variable" element.
virtual const XPath * getXPath(XalanSize_t index) const
Get XPath pattern/expression of one of the element atribute.
const XalanQName * m_qname
virtual const XalanDOMString & getElementName() const
Get a string for the name of the element.
void endElement(StylesheetExecutionContext &executionContext) const
Completes "post-processing" afer any sub-elements are invoked (i.e.
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,...
void init(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts)
Do common initialization.
virtual const XalanQName & getNameAttribute() const
Get the QName associated with any name attribute of this element.
This class represents the base stylesheet or an "import" stylesheet.
Class to hold XObjectPtr return types.
Definition XObject.hpp:884
Class to represent a qualified name.
xercesc::AttributeList AttributeListType