Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.4

Main Page   Namespace List   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, const 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, const 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 bool
00189     elementAvailable(
00190             const XalanDOMString&   theNamespace, 
00191             const XalanDOMString&   elementName) const;
00192 
00193     virtual bool
00194     functionAvailable(
00195             const XalanDOMString&   theNamespace, 
00196             const XalanDOMString&   functionName) const;
00197 
00198     virtual XObjectPtr
00199     extFunction(
00200             XPathExecutionContext&          executionContext,
00201             const XalanDOMString&           theNamespace,
00202             const XalanDOMString&           functionName, 
00203             XalanNode*                      context,
00204             const XObjectArgVectorType&     argVec,
00205             const Locator*                  locator) const;
00206 
00207     virtual bool
00208     problem(
00209             eSource                 where,
00210             eClassification         classification,
00211             const XalanNode*        styleNode,
00212             const XalanNode*        sourceNode,
00213             const XalanDOMString&   msg,
00214             const XalanDOMChar*     uri,
00215             int                     lineNo,
00216             int                     charOffset) const;
00217 
00218     virtual bool
00219     problem(
00220             eSource                 where,
00221             eClassification         classification,
00222             const PrefixResolver*   resolver,
00223             const XalanNode*        sourceNode,
00224             const XalanDOMString&   msg,
00225             const XalanDOMChar*     uri,
00226             int                     lineNo,
00227             int                     charOffset) const;
00228 
00229     // These interfaces are inherited from Resettable...
00230 
00231     virtual void
00232     reset();
00233 
00234     // Delete functor for table cleanup...
00235     struct NamespaceFunctionTableDeleteFunctor
00236     {
00237         typedef FunctionTableType               FunctionTableInnerType;
00238         typedef NamespaceFunctionTablesType     NamespaceFunctionTablesInnerType;
00239 
00246         void
00247         operator()(const NamespaceFunctionTablesInnerType::value_type&  thePair) const;
00248     };
00249 
00250 protected:
00251 
00259     const Function*
00260     findFunction(
00261             const XalanDOMString&   theNamespace,
00262             const XalanDOMString&   functionName) const;
00263 
00264 private:
00265 
00266     // These are not implemented...
00267     XPathEnvSupportDefault(const XPathEnvSupportDefault&);
00268 
00269     XPathEnvSupportDefault&
00270     operator=(const XPathEnvSupportDefault&);
00271 
00272     bool
00273     operator==(const XPathEnvSupportDefault&) const;
00274 
00288     static void
00289     updateFunctionTable(
00290             NamespaceFunctionTablesType&    theTable,
00291             const XalanDOMString&           theNamespace,
00292             const XalanDOMString&           functionName,
00293             const Function*                 function);
00294 
00303     const Function*
00304     findFunction(
00305             const NamespaceFunctionTablesType&  theTable,
00306             const XalanDOMString&               theNamespace,
00307             const XalanDOMString&               functionName) const;
00308 
00309     // Data members...
00310 
00311     SourceDocsTableType                     m_sourceDocs;
00312 
00313     NamespaceFunctionTablesType             m_externalFunctions;
00314 
00315     static  NamespaceFunctionTablesType     s_externalFunctions;
00316 };
00317 
00318 
00319 
00320 #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.4
Copyright © 2000, 2001, 2002 The Apache Software Foundation. All Rights Reserved.