## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.5

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-2002 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
    00077 XALAN_CPP_NAMESPACE_BEGIN
    00078
    00079
    00080
    00085 class XALAN_XPATH_EXPORT XPathEnvSupportDefault : public XPathEnvSupport
    00086 {
    00087 public:
    00088
    00089 #if defined(XALAN_NO_STD_NAMESPACE)
    00090     typedef map<XalanDOMString, XalanDocument*, less<XalanDOMString> >      SourceDocsTableType;
    00091     typedef map<XalanDOMString, const Function*, less<XalanDOMString> >     FunctionTableType;
    00092     typedef map<XalanDOMString, FunctionTableType, less<XalanDOMString> >   NamespaceFunctionTablesType;
    00093 #else
    00094     typedef std::map<XalanDOMString, XalanDocument*>    SourceDocsTableType;
    00095     typedef std::map<XalanDOMString, const Function*>   FunctionTableType;
    00096     typedef std::map<XalanDOMString, FunctionTableType> NamespaceFunctionTablesType;
    00097 #endif
    00098
    00103     static void
    00104     initialize();
    00105
    00109     static void
    00110     terminate();
    00111
    00112
    00113     XPathEnvSupportDefault();
    00114
    00115     virtual
    00116     ~XPathEnvSupportDefault();
    00117
    00118
    00119     // Interfaces to install and uninstall external functions globally.
    00120     // These calls are not thread-safe, and should happen during
    00121     // processing.
    00122
    00130     static void
    00131     installExternalFunctionGlobal(
    00132             const XalanDOMString&   theNamespace,
    00133             const XalanDOMString&   functionName,
    00134             const Function&         function);
    00135
    00142     static void
    00143     uninstallExternalFunctionGlobal(
    00144             const XalanDOMString&   theNamespace,
    00145             const XalanDOMString&   functionName);
    00146
    00147     // Interfaces to install and uninstall external functions in this instance.
    00148
    00156     virtual void
    00157     installExternalFunctionLocal(
    00158             const XalanDOMString&   theNamespace,
    00159             const XalanDOMString&   functionName,
    00160             const Function&         function);
    00161
    00168     virtual void
    00169     uninstallExternalFunctionLocal(
    00170             const XalanDOMString&   theNamespace,
    00171             const XalanDOMString&   functionName);
    00172
    00173
    00174     // These interfaces are inherited from XPathEnvSupport...
    00175
    00176     virtual XalanDocument*
    00177     parseXML(
    00178             const XalanDOMString&   urlString,
    00179             const XalanDOMString&   base);
    00180
    00181     virtual XalanDocument*
    00182     getSourceDocument(const XalanDOMString& theURI) const;
    00183
    00184     virtual void
    00185     setSourceDocument(
    00186             const XalanDOMString&   theURI,
    00187             XalanDocument*          theDocument);
    00188
    00189     virtual XalanDOMString
    00190     findURIFromDoc(const XalanDocument*     owner) const;
    00191
    00192     virtual bool
    00193     elementAvailable(
    00194             const XalanDOMString&   theNamespace,
    00195             const XalanDOMString&   elementName) const;
    00196
    00197     virtual bool
    00198     functionAvailable(
    00199             const XalanDOMString&   theNamespace,
    00200             const XalanDOMString&   functionName) const;
    00201
    00202     virtual XObjectPtr
    00203     extFunction(
    00204             XPathExecutionContext&          executionContext,
    00205             const XalanDOMString&           theNamespace,
    00206             const XalanDOMString&           functionName,
    00207             XalanNode*                      context,
    00208             const XObjectArgVectorType&     argVec,
    00209             const LocatorType*              locator) const;
    00210
    00211     virtual bool
    00212     problem(
    00213             eSource                 where,
    00214             eClassification         classification,
    00215             const PrefixResolver*   resolver,
    00216             const XalanNode*        sourceNode,
    00217             const XalanDOMString&   msg,
    00218             const XalanDOMChar*     uri,
    00219             int                     lineNo,
    00220             int                     charOffset) const;
    00221
    00222     // These interfaces are inherited from Resettable...
    00223
    00224     virtual void
    00225     reset();
    00226
    00227     // Delete functor for table cleanup...
    00228     struct NamespaceFunctionTableDeleteFunctor
    00229     {
    00230         typedef FunctionTableType               FunctionTableInnerType;
    00231         typedef NamespaceFunctionTablesType     NamespaceFunctionTablesInnerType;
    00232
    00239         void
    00240         operator()(const NamespaceFunctionTablesInnerType::value_type&  thePair) const;
    00241     };
    00242
    00243 protected:
    00244
    00252     const Function*
    00253     findFunction(
    00254             const XalanDOMString&   theNamespace,
    00255             const XalanDOMString&   functionName) const;
    00256
    00257 private:
    00258
    00259     // These are not implemented...
    00260     XPathEnvSupportDefault(const XPathEnvSupportDefault&);
    00261
    00262     XPathEnvSupportDefault&
    00263     operator=(const XPathEnvSupportDefault&);
    00264
    00265     bool
    00266     operator==(const XPathEnvSupportDefault&) const;
    00267
    00281     static void
    00282     updateFunctionTable(
    00283             NamespaceFunctionTablesType&    theTable,
    00284             const XalanDOMString&           theNamespace,
    00285             const XalanDOMString&           functionName,
    00286             const Function*                 function);
    00287
    00296     const Function*
    00297     findFunction(
    00298             const NamespaceFunctionTablesType&  theTable,
    00299             const XalanDOMString&               theNamespace,
    00300             const XalanDOMString&               functionName) const;
    00301
    00302     // Data members...
    00303
    00304     SourceDocsTableType                     m_sourceDocs;
    00305
    00306     NamespaceFunctionTablesType             m_externalFunctions;
    00307
    00308     static  NamespaceFunctionTablesType     s_externalFunctions;
    00309 };
    00310
    00311
    00312
    00313 XALAN_CPP_NAMESPACE_END
    00314
    00315
    00316
    00317 #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++ XSLT Processor Version 1.5 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.