00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999 The Apache Software Foundation. All rights 00006 * reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. The end-user documentation included with the redistribution, 00021 * if any, must include the following acknowledgment: 00022 * "This product includes software developed by the 00023 * Apache Software Foundation (http://www.apache.org/)." 00024 * Alternately, this acknowledgment may appear in the software itself, 00025 * if and wherever such third-party acknowledgments normally appear. 00026 * 00027 * 4. The names "Xalan" and "Apache Software Foundation" must 00028 * not be used to endorse or promote products derived from this 00029 * software without prior written permission. For written 00030 * permission, please contact apache@apache.org. 00031 * 00032 * 5. Products derived from this software may not be called "Apache", 00033 * nor may "Apache" appear in their name, without prior written 00034 * permission of the Apache Software Foundation. 00035 * 00036 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00038 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00039 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00040 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00041 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00042 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00043 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00045 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00046 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00047 * SUCH DAMAGE. 00048 * ==================================================================== 00049 * 00050 * This software consists of voluntary contributions made by many 00051 * individuals on behalf of the Apache Software Foundation and was 00052 * originally based on software copyright (c) 1999, International 00053 * Business Machines, Inc., http://www.ibm.com. For more 00054 * information on the Apache Software Foundation, please see 00055 * <http://www.apache.org/>. 00056 * 00057 * @author <a href="mailto:david_n_bertoni@lotus.com">David N. Bertoni</a> 00058 */ 00059 #if !defined(XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680) 00060 #define XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680 00061 00062 00063 00064 // Base include file. Must be first. 00065 #include <XPath/XPathDefinitions.hpp> 00066 00067 00068 00069 #include <vector> 00070 00071 00072 00073 #include <XPath/XPathEnvSupport.hpp> 00074 00075 00076 00081 class XALAN_XPATH_EXPORT XPathEnvSupportDefault : public XPathEnvSupport 00082 { 00083 public: 00084 00085 #if defined(XALAN_NO_NAMESPACES) 00086 typedef map<XalanDOMString, XalanDocument*, less<XalanDOMString> > SourceDocsTableType; 00087 typedef map<XalanDOMString, Function*, less<XalanDOMString> > FunctionTableType; 00088 typedef map<XalanDOMString, FunctionTableType, less<XalanDOMString> > NamespaceFunctionTablesType; 00089 #else 00090 typedef std::map<XalanDOMString, XalanDocument*> SourceDocsTableType; 00091 typedef std::map<XalanDOMString, Function*> FunctionTableType; 00092 typedef std::map<XalanDOMString, FunctionTableType> NamespaceFunctionTablesType; 00093 #endif 00094 00099 static void 00100 initialize(); 00101 00105 static void 00106 terminate(); 00107 00108 00109 XPathEnvSupportDefault(); 00110 00111 virtual 00112 ~XPathEnvSupportDefault(); 00113 00114 00115 // Interfaces to install and uninstall external functions globally. 00116 // These calls are not thread-safe, and should happen during 00117 // processing. 00118 00126 static void 00127 installExternalFunctionGlobal( 00128 const XalanDOMString& theNamespace, 00129 const XalanDOMString& functionName, 00130 const Function& function); 00131 00138 static void 00139 uninstallExternalFunctionGlobal( 00140 const XalanDOMString& theNamespace, 00141 const XalanDOMString& functionName); 00142 00143 // Interfaces to install and uninstall external functions in this instance. 00144 00152 virtual void 00153 installExternalFunctionLocal( 00154 const XalanDOMString& theNamespace, 00155 const XalanDOMString& functionName, 00156 const Function& function); 00157 00164 virtual void 00165 uninstallExternalFunctionLocal( 00166 const XalanDOMString& theNamespace, 00167 const XalanDOMString& functionName); 00168 00169 00170 // These interfaces are inherited from XPathEnvSupport... 00171 00172 virtual XalanDocument* 00173 parseXML( 00174 const XalanDOMString& urlString, 00175 const XalanDOMString& base); 00176 00177 virtual XalanDocument* 00178 getSourceDocument(const XalanDOMString& theURI) const; 00179 00180 virtual void 00181 setSourceDocument( 00182 const XalanDOMString& theURI, 00183 XalanDocument* theDocument); 00184 00185 virtual XalanDOMString 00186 findURIFromDoc(const XalanDocument* owner) const; 00187 00188 virtual XalanDocument* 00189 getDOMFactory() const; 00190 00191 virtual bool 00192 elementAvailable( 00193 const XalanDOMString& theNamespace, 00194 const XalanDOMString& elementName) const; 00195 00196 virtual bool 00197 functionAvailable( 00198 const XalanDOMString& theNamespace, 00199 const XalanDOMString& functionName) const; 00200 00201 virtual XObjectPtr 00202 extFunction( 00203 XPathExecutionContext& executionContext, 00204 const XalanDOMString& theNamespace, 00205 const XalanDOMString& functionName, 00206 XalanNode* context, 00207 const XObjectArgVectorType& argVec) const; 00208 00209 virtual XLocator* 00210 getXLocatorFromNode(const XalanNode* node) const; 00211 00212 virtual void 00213 associateXLocatorToNode( 00214 const XalanNode* node, 00215 XLocator* xlocator); 00216 00217 virtual bool 00218 shouldStripSourceNode( 00219 XPathExecutionContext& executionContext, 00220 const XalanNode& node) const; 00221 00222 virtual bool 00223 problem( 00224 eSource where, 00225 eClassification classification, 00226 const XalanNode* styleNode, 00227 const XalanNode* sourceNode, 00228 const XalanDOMString& msg, 00229 int lineNo, 00230 int charOffset) const; 00231 00232 virtual bool 00233 problem( 00234 eSource where, 00235 eClassification classification, 00236 const PrefixResolver* resolver, 00237 const XalanNode* sourceNode, 00238 const XalanDOMString& msg, 00239 int lineNo, 00240 int charOffset) const; 00241 00242 // These interfaces are inherited from Resettable... 00243 00244 virtual void 00245 reset(); 00246 00247 // Delete functor for table cleanup... 00248 struct NamespaceFunctionTableDeleteFunctor 00249 { 00250 typedef FunctionTableType FunctionTableInnerType; 00251 typedef NamespaceFunctionTablesType NamespaceFunctionTablesInnerType; 00252 00259 void 00260 operator()(const NamespaceFunctionTablesInnerType::value_type& thePair) const; 00261 }; 00262 00263 protected: 00264 00272 virtual Function* 00273 findFunction( 00274 const XalanDOMString& theNamespace, 00275 const XalanDOMString& functionName) const; 00276 00277 private: 00278 00279 // These are not implemented... 00280 XPathEnvSupportDefault(const XPathEnvSupportDefault&); 00281 00282 XPathEnvSupportDefault& 00283 operator=(const XPathEnvSupportDefault&); 00284 00285 bool 00286 operator==(const XPathEnvSupportDefault&) const; 00287 00301 static void 00302 updateFunctionTable( 00303 NamespaceFunctionTablesType& theTable, 00304 const XalanDOMString& theNamespace, 00305 const XalanDOMString& functionName, 00306 const Function* function); 00307 00316 Function* 00317 findFunction( 00318 const NamespaceFunctionTablesType& theTable, 00319 const XalanDOMString& theNamespace, 00320 const XalanDOMString& functionName) const; 00321 00322 // Data members... 00323 00324 SourceDocsTableType m_sourceDocs; 00325 00326 NamespaceFunctionTablesType m_externalFunctions; 00327 00328 static NamespaceFunctionTablesType s_externalFunctions; 00329 }; 00330 00331 00332 00333 #endif // XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSL Transformer Version 1.1 |
|