00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALAN_ELEMVARIABLE_HEADER_GUARD) 00019 #define XALAN_ELEMVARIABLE_HEADER_GUARD 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include "XSLTDefinitions.hpp" 00025 00026 // Base class header file. 00027 #include "ElemTemplateElement.hpp" 00028 00029 00030 00031 #include <xalanc/XPath/XObject.hpp> 00032 00033 00034 00035 #include <xalanc/XSLT/Constants.hpp> 00036 00037 00038 00039 XALAN_CPP_NAMESPACE_BEGIN 00040 00041 00042 00043 class XPath; 00044 00045 00046 00047 class ElemVariable : public ElemTemplateElement 00048 { 00049 public: 00050 00051 typedef ElemTemplateElement ParentType; 00052 00053 /** 00054 * Construct an object corresponding to an "xsl:variable" element 00055 * 00056 * @param constructionContext context for construction of object 00057 * @param stylesheetTree stylesheet containing element 00058 * @param atts list of attributes for element 00059 * @param lineNumber line number in document 00060 * @param columnNumber column number in document 00061 */ 00062 ElemVariable( 00063 StylesheetConstructionContext& constructionContext, 00064 Stylesheet& stylesheetTree, 00065 const AttributeListType& atts, 00066 XalanFileLoc lineNumber, 00067 XalanFileLoc columnNumber); 00068 00069 virtual 00070 ~ElemVariable(); 00071 00072 /** 00073 * Determines if this is a top level variable. 00074 * 00075 * @return true if it is a top level variable 00076 */ 00077 bool 00078 isTopLevel() const 00079 { 00080 return m_isTopLevel; 00081 } 00082 00083 // These methods are inherited from ElemTemplateElement ... 00084 00085 virtual const XalanQName& 00086 getNameAttribute() const; 00087 00088 virtual void 00089 addToStylesheet( 00090 StylesheetConstructionContext& constructionContext, 00091 Stylesheet& theStylesheet); 00092 00093 virtual const XalanDOMString& 00094 getElementName() const; 00095 00096 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 00097 const ElemTemplateElement* 00098 startElement(StylesheetExecutionContext& executionContext) const; 00099 00100 void 00101 endElement(StylesheetExecutionContext& executionContext) const; 00102 #else 00103 virtual void 00104 execute(StylesheetExecutionContext& executionContext) const; 00105 #endif 00106 00107 const XObjectPtr 00108 getValue( 00109 StylesheetExecutionContext& executionContext, 00110 XalanNode* sourceNode) const; 00111 00112 virtual void 00113 setParentNodeElem(ElemTemplateElement* theParent); 00114 00115 virtual const XPath* 00116 getXPath(XalanSize_t index) const; 00117 00118 protected: 00119 00120 /** 00121 * Construct an object corresponding to an "xsl:variable" element 00122 * 00123 * @param constructionContext context for construction of object 00124 * @param stylesheetTree stylesheet containing element 00125 * @param atts list of attributes for element 00126 * @param lineNumber line number in document 00127 * @param columnNumber column number in document 00128 */ 00129 ElemVariable( 00130 StylesheetConstructionContext& constructionContext, 00131 Stylesheet& stylesheetTree, 00132 const AttributeListType& atts, 00133 XalanFileLoc lineNumber, 00134 XalanFileLoc columnNumber, 00135 int xslToken); 00136 00137 /** 00138 * Do common initialization. 00139 * 00140 * @param constructionContext context for construction of object 00141 * @param stylesheetTree stylesheet containing element 00142 * @param atts list of attributes for element 00143 */ 00144 void 00145 init( 00146 StylesheetConstructionContext& constructionContext, 00147 Stylesheet& stylesheetTree, 00148 const AttributeListType& atts); 00149 00150 00151 const XalanQName* m_qname; 00152 00153 private: 00154 00155 // not implemented 00156 ElemVariable(const ElemVariable &); 00157 00158 ElemVariable& 00159 operator=(const ElemVariable &); 00160 00161 const XPath* m_selectPattern; 00162 00163 bool m_isTopLevel; 00164 00165 XObjectPtr m_value; 00166 00167 XalanNode* m_varContext; 00168 }; 00169 00170 00171 00172 XALAN_CPP_NAMESPACE_END 00173 00174 00175 00176 #endif // XALAN_ELEMVARIABLE_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|