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(FUNCTIONNORMALIZE_HEADER_GUARD_1357924680) 00019 #define FUNCTIONNORMALIZE_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base header file. Must be first. 00024 #include <xalanc/XPath/XPathDefinitions.hpp> 00025 00026 00027 00028 // Base class header file... 00029 #include <xalanc/XPath/Function.hpp> 00030 00031 00032 00033 #include <xalanc/XPath/NodeRefListBase.hpp> 00034 00035 00036 00037 XALAN_CPP_NAMESPACE_BEGIN 00038 00039 00040 00041 /** 00042 * XPath implementation of "normalize-space" function. 00043 */ 00044 class XALAN_XPATH_EXPORT FunctionNormalizeSpace : public Function 00045 { 00046 public: 00047 00048 typedef Function ParentType; 00049 00050 FunctionNormalizeSpace(); 00051 00052 virtual 00053 ~FunctionNormalizeSpace(); 00054 00055 // These methods are inherited from Function ... 00056 00057 virtual XObjectPtr 00058 execute( 00059 XPathExecutionContext& executionContext, 00060 XalanNode* context, 00061 const Locator* locator) const; 00062 00063 virtual XObjectPtr 00064 execute( 00065 XPathExecutionContext& executionContext, 00066 XalanNode* context, 00067 const XObjectPtr arg1, 00068 const Locator* locator) const; 00069 00070 using ParentType::execute; 00071 00072 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) 00073 virtual Function* 00074 #else 00075 virtual FunctionNormalizeSpace* 00076 #endif 00077 clone(MemoryManager& theManager) const; 00078 00079 protected: 00080 00081 virtual const XalanDOMString& 00082 getError(XalanDOMString& theResult) const; 00083 00084 private: 00085 00086 bool 00087 needsNormalization(const XalanDOMString& theString) const; 00088 00089 XObjectPtr 00090 normalize( 00091 XPathExecutionContext& executionContext, 00092 const XalanDOMString& theString) const 00093 { 00094 // A string contain the result... 00095 GetCachedString theResult(executionContext); 00096 00097 return normalize(executionContext, theString, theResult); 00098 } 00099 00100 XObjectPtr 00101 normalize( 00102 XPathExecutionContext& executionContext, 00103 const XObjectPtr& theArg) const; 00104 00105 XObjectPtr 00106 normalize( 00107 XPathExecutionContext& executionContext, 00108 const XalanDOMString& theString, 00109 GetCachedString& theResult) const; 00110 00111 // Not implemented... 00112 FunctionNormalizeSpace& 00113 operator=(const FunctionNormalizeSpace&); 00114 00115 bool 00116 operator==(const FunctionNormalizeSpace&) const; 00117 }; 00118 00119 00120 00121 XALAN_CPP_NAMESPACE_END 00122 00123 00124 00125 #endif // FUNCTIONNORMALIZE_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|