Xalan-C++ API Documentation

The Xalan C++ XSL Transformer Version 1.1

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XPathEnvSupportDefault.hpp

Go to the documentation of this file.
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 bool
00210     problem(
00211             eSource                 where,
00212             eClassification         classification,
00213             const XalanNode*        styleNode,
00214             const XalanNode*        sourceNode,
00215             const XalanDOMString&   msg,
00216             const XalanDOMChar*     uri,
00217             int                     lineNo,
00218             int                     charOffset) const;
00219 
00220     virtual bool
00221     problem(
00222             eSource                 where,
00223             eClassification         classification,
00224             const PrefixResolver*   resolver,
00225             const XalanNode*        sourceNode,
00226             const XalanDOMString&   msg,
00227             const XalanDOMChar*     uri,
00228             int                     lineNo,
00229             int                     charOffset) const;
00230 
00231     // These interfaces are inherited from Resettable...
00232 
00233     virtual void
00234     reset();
00235 
00236     // Delete functor for table cleanup...
00237     struct NamespaceFunctionTableDeleteFunctor
00238     {
00239         typedef FunctionTableType               FunctionTableInnerType;
00240         typedef NamespaceFunctionTablesType     NamespaceFunctionTablesInnerType;
00241 
00248         void
00249         operator()(const NamespaceFunctionTablesInnerType::value_type&  thePair) const;
00250     };
00251 
00252 protected:
00253 
00261     virtual Function*
00262     findFunction(
00263             const XalanDOMString&   theNamespace,
00264             const XalanDOMString&   functionName) const;
00265 
00266 private:
00267 
00268     // These are not implemented...
00269     XPathEnvSupportDefault(const XPathEnvSupportDefault&);
00270 
00271     XPathEnvSupportDefault&
00272     operator=(const XPathEnvSupportDefault&);
00273 
00274     bool
00275     operator==(const XPathEnvSupportDefault&) const;
00276 
00290     static void
00291     updateFunctionTable(
00292             NamespaceFunctionTablesType&    theTable,
00293             const XalanDOMString&           theNamespace,
00294             const XalanDOMString&           functionName,
00295             const Function*                 function);
00296 
00305     Function*
00306     findFunction(
00307             const NamespaceFunctionTablesType&  theTable,
00308             const XalanDOMString&               theNamespace,
00309             const XalanDOMString&               functionName) const;
00310 
00311     // Data members...
00312 
00313     SourceDocsTableType                     m_sourceDocs;
00314 
00315     NamespaceFunctionTablesType             m_externalFunctions;
00316 
00317     static  NamespaceFunctionTablesType     s_externalFunctions;
00318 };
00319 
00320 
00321 
00322 #endif  // XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSL Transformer Version 1.1
Copyright © 2000, 2001 The Apache Software Foundation. All Rights Reserved.