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_ELEMUSE_HEADER_GUARD) 00019 #define XALAN_ELEMUSE_HEADER_GUARD 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include "XSLTDefinitions.hpp" 00025 00026 00027 00028 // Base class header file. 00029 #include "ElemTemplateElement.hpp" 00030 00031 00032 00033 XALAN_CPP_NAMESPACE_BEGIN 00034 00035 00036 00037 class ElemUse : public ElemTemplateElement 00038 { 00039 public: 00040 00041 #if defined(XALAN_STRICT_ANSI_HEADERS) 00042 typedef std::size_t size_type; 00043 #else 00044 typedef size_t size_type; 00045 #endif 00046 00047 /** 00048 * Construct an object corresponding to an "use-attribute-sets" attribute. 00049 * This is a base class for "xsl:element," "xsl:copy" and 00050 * "xsl:attribute-set" elements, which may specify attribute sets to use. 00051 * 00052 * @param constructionContext context for construction of object 00053 * @param stylesheetTree stylesheet containing element 00054 * @param atts list of attributes for element 00055 * @param lineNumber line number in document 00056 * @param columnNumber column number in document 00057 */ 00058 ElemUse( 00059 StylesheetConstructionContext& constructionContext, 00060 Stylesheet& stylesheetTree, 00061 XalanFileLoc lineNumber, 00062 XalanFileLoc columnNumber, 00063 int xslToken); 00064 00065 virtual 00066 ~ElemUse(); 00067 00068 /** 00069 * See if this is a use-attribute-sets attribute, and, if so, process it. 00070 * 00071 * @param attrName qualified name of attribute 00072 * @param atts attribute list where the element comes from (not used at 00073 * this time) 00074 * @param which index into the attribute list (not used at this time) 00075 * @return true if this is a use-attribute-sets attribute 00076 */ 00077 bool 00078 processUseAttributeSets( 00079 StylesheetConstructionContext& constructionContext, 00080 const XalanDOMChar* attrName, 00081 const AttributeListType& atts, 00082 XalanSize_t which); 00083 00084 // These methods are inherited from ElemTemplateElement ... 00085 00086 virtual const XalanDOMString& 00087 getElementName() const; 00088 00089 virtual void 00090 postConstruction( 00091 StylesheetConstructionContext& constructionContext, 00092 const NamespacesHandler& theParentHandler); 00093 00094 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 00095 virtual const ElemTemplateElement* 00096 startElement(StylesheetExecutionContext& executionContext) const; 00097 00098 virtual void 00099 endElement(StylesheetExecutionContext& executionContext) const; 00100 00101 virtual const ElemTemplateElement* 00102 getNextChildElemToExecute( 00103 StylesheetExecutionContext& executionContext, 00104 const ElemTemplateElement* currentElem) const; 00105 00106 virtual const ElemTemplateElement* 00107 getFirstChildElemToExecute( 00108 StylesheetExecutionContext& executionContext) const; 00109 #else 00110 virtual void 00111 execute(StylesheetExecutionContext& executionContext) const; 00112 #endif 00113 00114 00115 protected: 00116 00117 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 00118 /** 00119 * Get the next attribute set to execute. 00120 * 00121 * @param executionContext context to execute this element 00122 * @returns a pointer to the attribute set element, 0 if no more attribute sets 00123 */ 00124 const ElemTemplateElement* 00125 getNextAttributeSet( 00126 StylesheetExecutionContext& executionContext) const; 00127 00128 /** 00129 * Evalute the AVTs for this element 00130 * 00131 * @param executionContext context to execute this element 00132 */ 00133 virtual void 00134 evaluateAVTs( 00135 StylesheetExecutionContext& executionContext) const; 00136 #else 00137 /** 00138 * Execute and conditionally apply any attribute sets. To be used 00139 * by deriving classes who want ElemUse to do any default execution 00140 * but skip applying attribute sets. Typically, this would be done 00141 * when attempting to recover from an error. 00142 * 00143 * @param executionContext The current execution context. 00144 * @param applyAttributeSets If true, attribute sets will be applied. 00145 */ 00146 virtual void 00147 doExecute( 00148 StylesheetExecutionContext& executionContext, 00149 bool applyAttributeSets) const; 00150 #endif 00151 00152 private: 00153 00154 const XalanQName** m_attributeSetsNames; 00155 00156 size_type m_attributeSetsNamesCount; 00157 }; 00158 00159 00160 00161 XALAN_CPP_NAMESPACE_END 00162 00163 00164 00165 #endif // XALAN_ELEMUSE_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 |
|