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_AVT_HEADER_GUARD) 00019 #define XALAN_AVT_HEADER_GUARD 00020 00021 // Base include file. Must be first. 00022 #include <xalanc/XSLT/XSLTDefinitions.hpp> 00023 00024 00025 00026 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00027 00028 00029 00030 XALAN_DECLARE_XERCES_CLASS(Locator) 00031 00032 00033 00034 XALAN_CPP_NAMESPACE_BEGIN 00035 00036 00037 00038 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType; 00039 XALAN_USING_XERCES(Locator) 00040 00041 00042 00043 class AVTPart; 00044 class PrefixResolver; 00045 class XPathExecutionContext; 00046 class XalanNode; 00047 class StringTokenizer; 00048 class StylesheetConstructionContext; 00049 00050 00051 00052 /** 00053 * Class to hold an Attribute Value Template. 00054 */ 00055 class AVT 00056 { 00057 public: 00058 00059 #if defined(XALAN_STRICT_ANSI_HEADERS) 00060 typedef std::size_t size_type; 00061 #else 00062 typedef size_t size_type; 00063 #endif 00064 00065 /** 00066 * Construct an Attribute Value Template(AVT) by parsing the string, and 00067 * either constructing a vector of AVTParts, or simply hold on to the 00068 * string if the AVT is simple. 00069 * 00070 * @param constructionContext context for construction of AVT 00071 * @param locator the Locator for the AVT. May be null. 00072 * @param name name of AVT 00073 * @param stringedValue string value to parse 00074 * @param resolver resolver for namespace resolution 00075 */ 00076 AVT( 00077 StylesheetConstructionContext& constructionContext, 00078 const Locator* locator, 00079 const XalanDOMChar* name, 00080 const XalanDOMChar* stringedValue, 00081 const PrefixResolver& resolver); 00082 00083 virtual 00084 ~AVT(); 00085 00086 /** 00087 * Retrieve the name of the Attribute Value Template 00088 * 00089 * @return name of AVT 00090 */ 00091 const XalanDOMString& 00092 getName() const 00093 { 00094 return m_name; 00095 } 00096 00097 /** 00098 * Append the value to the buffer. 00099 * 00100 * @param buf buffer to write into 00101 * @param contextNode current context node 00102 * @param prefixResolver prefix resolver to use 00103 * @param executionContext execution context 00104 */ 00105 void 00106 evaluate( 00107 XalanDOMString& buf, 00108 XalanNode* contextNode, 00109 const PrefixResolver& prefixResolver, 00110 XPathExecutionContext& executionContext) const 00111 { 00112 if(m_simpleString != 0) 00113 { 00114 buf.assign(m_simpleString, m_simpleStringLength); 00115 } 00116 else 00117 { 00118 doEvaluate(buf, contextNode, prefixResolver, executionContext); 00119 } 00120 } 00121 00122 /** 00123 * Append the value to the buffer. 00124 * 00125 * @param buf buffer to write into 00126 * @param prefixResolver prefix resolver to use 00127 * @param executionContext execution context 00128 */ 00129 void 00130 evaluate( 00131 XalanDOMString& buf, 00132 const PrefixResolver& prefixResolver, 00133 XPathExecutionContext& executionContext) const 00134 { 00135 if(m_simpleString != 0) 00136 { 00137 buf.assign(m_simpleString, m_simpleStringLength); 00138 } 00139 else 00140 { 00141 doEvaluate(buf, prefixResolver, executionContext); 00142 } 00143 } 00144 00145 private: 00146 00147 void 00148 doEvaluate( 00149 XalanDOMString& buf, 00150 const PrefixResolver& prefixResolver, 00151 XPathExecutionContext& executionContext) const; 00152 00153 void 00154 doEvaluate( 00155 XalanDOMString& buf, 00156 XalanNode* contextNode, 00157 const PrefixResolver& prefixResolver, 00158 XPathExecutionContext& executionContext) const; 00159 00160 void 00161 nextToken( 00162 StylesheetConstructionContext& constructionContext, 00163 const Locator* locator, 00164 StringTokenizer& tokenizer, 00165 XalanDOMString& token); 00166 00167 // not implemented 00168 AVT(const AVT&); 00169 00170 AVT& 00171 operator=(const AVT&); 00172 00173 bool 00174 operator==(const AVT&) const; 00175 00176 00177 // Data members... 00178 const AVTPart** m_parts; 00179 00180 size_type m_partsSize; 00181 00182 const XalanDOMChar* m_simpleString; 00183 00184 XalanDOMString::size_type m_simpleStringLength; 00185 00186 const XalanDOMString& m_name; 00187 00188 static const XalanDOMString s_emptyString; 00189 }; 00190 00191 00192 00193 XALAN_CPP_NAMESPACE_END 00194 00195 00196 00197 #endif // XALAN_AVT_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 |
|