## Xalan-C++ API Documentation

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

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

# StylesheetConstructionContext.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(STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680)
    00060 #define STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
    00061
    00062
    00063
    00064 // Base include file.  Must be first.
    00065 #include <xalanc/XSLT/XSLTDefinitions.hpp>
    00066
    00067
    00068
    00069 #include <xalanc/PlatformSupport/URISupport.hpp>
    00070
    00071
    00072
    00073 #include <xalanc/XalanDOM/XalanDOMString.hpp>
    00074
    00075
    00076
    00077 #include <xalanc/XPath/XalanQName.hpp>
    00078 #include <xalanc/XPath/XPathConstructionContext.hpp>
    00079
    00080
    00081
    00082 XALAN_DECLARE_XERCES_CLASS(AttributeList)
    00083 XALAN_DECLARE_XERCES_CLASS(DocumentHandler)
    00084
    00085
    00086
    00087 XALAN_CPP_NAMESPACE_BEGIN
    00088
    00089
    00090
    00091 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList    AttributeListType;
    00092 typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler  DocumentHandlerType;
    00093
    00094
    00095
    00096 class AVT;
    00097 class AVTPart;
    00098 class ElemTemplateElement;
    00099 class ExtensionNSHandler;
    00100 class PrefixResolver;
    00101 class Stylesheet;
    00102 class StylesheetRoot;
    00103 class XalanDocument;
    00104 class XalanNode;
    00105 class XPath;
    00106 class XSLTInputSource;
    00107
    00108
    00109
    00110 //
    00111 // An abstract class which provides support for constructing the internal
    00112 // representation  of a stylesheet.
    00113 //
    00114 class XALAN_XSLT_EXPORT StylesheetConstructionContext : public XPathConstructionContext
    00115 {
    00116 public:
    00117
    00118     typedef XalanQName::NamespacesStackType     NamespacesStackType;
    00119
    00120 #if defined(XALAN_STRICT_ANSI_HEADERS)
    00121     typedef std::size_t     size_type;
    00122 #else
    00123     typedef size_t          size_type;
    00124 #endif
    00125
    00130     enum eElementToken
    00131     {
    00132         ELEMNAME_UNDEFINED = -2,
    00133         ELEMNAME_EMPTY = -1,
    00134         ELEMNAME_WITH_PARAM,
    00135         ELEMNAME_APPLY_TEMPLATES,
    00136         ELEMNAME_CHOOSE,
    00137         ELEMNAME_COMMENT,
    00138         ELEMNAME_COPY,
    00139         ELEMNAME_COPY_OF,
    00140         ELEMNAME_ATTRIBUTE,
    00141         ELEMNAME_ATTRIBUTE_SET,
    00142         ELEMNAME_EXTENSION,
    00143         ELEMNAME_FOR_EACH,
    00144         ELEMNAME_KEY,
    00145         ELEMNAME_IF,
    00146         ELEMNAME_IMPORT,
    00147         ELEMNAME_INCLUDE,
    00148         ELEMNAME_CALL_TEMPLATE,
    00149         ELEMNAME_PARAM,
    00150         ELEMNAME_NUMBER,
    00151         ELEMNAME_OTHERWISE,
    00152         ELEMNAME_PI,
    00153         ELEMNAME_PRESERVE_SPACE,
    00154         ELEMNAME_TEMPLATE,
    00155         ELEMNAME_SORT,
    00156         ELEMNAME_STRIP_SPACE,
    00157         ELEMNAME_STYLESHEET,
    00158         ELEMNAME_TEXT,
    00159         ELEMNAME_VALUE_OF,
    00160         ELEMNAME_WHEN,
    00161         ELEMNAME_FALLBACK,
    00162         ELEMNAME_ELEMENT,
    00163
    00164         ELEMNAME_APPLY_IMPORTS,
    00165
    00166         ELEMNAME_VARIABLE,
    00167         ELEMNAME_MESSAGE,
    00168
    00169         ELEMNAME_OUTPUT,
    00170         ELEMNAME_DECIMAL_FORMAT,
    00171         ELEMNAME_NAMESPACE_ALIAS,
    00172
    00173         // This one doesn't really have a name.
    00174         // It's used for any literal result
    00175         // element.
    00176         ELEMNAME_LITERAL_RESULT,
    00177
    00178         // This one doesn't really have a name.
    00179         // It's used for any literal text in
    00180         // the content of a literal result
    00181         // element.
    00182         ELEMNAME_TEXT_LITERAL_RESULT,
    00183
    00184         // Extension handling.
    00185         ELEMNAME_EXTENSION_CALL,
    00186         ELEMNAME_EXTENSION_HANDLER
    00187     };
    00188
    00189     typedef URISupport::URLAutoPtrType  URLAutoPtrType;
    00190
    00191     explicit
    00192     StylesheetConstructionContext();
    00193
    00194     virtual
    00195     ~StylesheetConstructionContext();
    00196
    00197
    00202     virtual void
    00203     reset() = 0;
    00204
    00213     virtual StylesheetRoot*
    00214     create(const XalanDOMString&    theBaseIdentifier) = 0;
    00215
    00224     virtual StylesheetRoot*
    00225     create(const XSLTInputSource&   theInputSource) = 0;
    00226
    00236     virtual Stylesheet*
    00237     create(
    00238             StylesheetRoot&         theStylesheetRoot,
    00239             const XalanDOMString&   theBaseIdentifier) = 0;
    00240
    00247     virtual void
    00248     destroy(StylesheetRoot*     theStylesheetRoot) = 0;
    00249
    00256     virtual URLAutoPtrType
    00257     getURLFromString(const XalanDOMString&  urlString) = 0;
    00258
    00265     virtual XalanDOMString
    00266     getURLStringFromString(const XalanDOMString&    urlString) = 0;
    00267
    00275     virtual URLAutoPtrType
    00276     getURLFromString(
    00277             const XalanDOMString&   urlString,
    00278             const XalanDOMString&   base) = 0;
    00279
    00287     virtual XalanDOMString
    00288     getURLStringFromString(
    00289             const XalanDOMString&   urlString,
    00290             const XalanDOMString&   base) = 0;
    00291
    00298     virtual const XalanDOMString&
    00299     getXSLTNamespaceURI() const = 0;
    00300
    00311     virtual XPath*
    00312     createMatchPattern(
    00313             const LocatorType*      locator,
    00314             const XalanDOMString&   str,
    00315             const PrefixResolver&   resolver) = 0;
    00316
    00327     virtual XPath*
    00328     createMatchPattern(
    00329             const LocatorType*      locator,
    00330             const XalanDOMChar*     str,
    00331             const PrefixResolver&   resolver) = 0;
    00332
    00343     virtual XPath*
    00344     createXPath(
    00345             const LocatorType*      locator,
    00346             const XalanDOMString&   str,
    00347             const PrefixResolver&   resolver) = 0;
    00348
    00359     virtual XPath*
    00360     createXPath(
    00361             const LocatorType*      locator,
    00362             const XalanDOMChar*     str,
    00363             const PrefixResolver&   resolver) = 0;
    00364
    00375     virtual XPath*
    00376     createXPath(
    00377             const LocatorType*          locator,
    00378             const XalanDOMChar*         str,
    00379             XalanDOMString::size_type   len,
    00380             const PrefixResolver&       resolver) = 0;
    00381
    00387     virtual const LocatorType*
    00388     getLocatorFromStack() const = 0;
    00389
    00395     virtual void
    00396     pushLocatorOnStack(const LocatorType*   locator) = 0;
    00397
    00401     virtual void
    00402     popLocatorStack() = 0;
    00403
    00409     virtual const XalanDOMString&
    00410     getXalanXSLNameSpaceURL() const = 0;
    00411
    00423     virtual XalanDocument*
    00424     parseXML(
    00425             const XalanDOMString&   urlString,
    00426             DocumentHandlerType*    docHandler,
    00427             XalanDocument*          docToRegister) = 0;
    00428
    00438     virtual bool
    00439     isXMLSpaceAttribute(
    00440             const XalanDOMChar*     theAttributeName,
    00441             const Stylesheet&       theStylesheet,
    00442             const LocatorType*      theLocator = 0) = 0;
    00443
    00453     virtual bool
    00454     isXSLUseAttributeSetsAttribute(
    00455             const XalanDOMChar*     theAttributeName,
    00456             const Stylesheet&       theStylesheet,
    00457             const LocatorType*      theLocator = 0) = 0;
    00458
    00468     virtual bool
    00469     isValidQName(
    00470             const XalanDOMChar*     theName,
    00471             const Stylesheet&       theStylesheet,
    00472             const LocatorType*      theLocator = 0) = 0;
    00473
    00481     virtual eElementToken
    00482     getElementToken(const XalanDOMString&   name) const = 0;
    00483
    00489     virtual double
    00490     getXSLTVersionSupported() const = 0;
    00491
    00492     virtual const XalanDOMString&
    00493     getPooledString(const XalanDOMString&   theString) = 0;
    00494
    00495     virtual const XalanDOMString&
    00496     getPooledString(
    00497             const XalanDOMChar*         theString,
    00498             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00499
    00500     virtual XalanDOMString&
    00501     getCachedString() = 0;
    00502
    00503     virtual bool
    00504     releaseCachedString(XalanDOMString&     theString) = 0;
    00505
    00513     virtual XalanDOMChar*
    00514     allocateXalanDOMCharVector(XalanDOMString::size_type    theLength) = 0;
    00515
    00525     virtual XalanDOMChar*
    00526     allocateXalanDOMCharVector(
    00527             const XalanDOMChar*         theString,
    00528             XalanDOMString::size_type   theLength = XalanDOMString::npos,
    00529             bool                        fTerminate = true) = 0;
    00530
    00540     virtual const AVT*
    00541     createAVT(
    00542             const LocatorType*      locator,
    00543             const XalanDOMChar*     name,
    00544             const XalanDOMChar*     stringedValue,
    00545             const PrefixResolver&   resolver) = 0;
    00546
    00555     virtual const AVTPart*
    00556     createAVTPart(
    00557             const XalanDOMChar*         theString,
    00558             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00559
    00569     virtual const AVTPart*
    00570     createAVTPart(
    00571             const LocatorType*          locator,
    00572             const XalanDOMChar*         str,
    00573             XalanDOMString::size_type   len,
    00574             const PrefixResolver&       resolver) = 0;
    00575
    00583     virtual const AVT**
    00584     allocateAVTPointerVector(size_type  theLength) = 0;
    00585
    00593     virtual const AVTPart**
    00594     allocateAVTPartPointerVector(size_type  theLength) = 0;
    00595
    00605     virtual const XalanQName*
    00606     createXalanQName(
    00607             const XalanDOMString&       qname,
    00608             const NamespacesStackType&  namespaces,
    00609             const LocatorType*          locator = 0,
    00610             bool                        fUseDefault = false) = 0;
    00611
    00621     virtual const XalanQName*
    00622     createXalanQName(
    00623             const XalanDOMChar*         qname,
    00624             const NamespacesStackType&  namespaces,
    00625             const LocatorType*          locator = 0,
    00626             bool                        fUseDefault = false) = 0;
    00627
    00639     virtual const XalanQName**
    00640     tokenizeQNames(
    00641             size_type&                  count,
    00642             const XalanDOMChar*         qnameTokens,
    00643             const NamespacesStackType&  namespaces,
    00644             const LocatorType*          locator = 0,
    00645             bool                        fUseDefault = false) = 0;
    00646
    00660     virtual ElemTemplateElement*
    00661     createElement(
    00662             int                         token,
    00663             Stylesheet&                 stylesheetTree,
    00664             const AttributeListType&    atts,
    00665             const LocatorType*          locator = 0) = 0;
    00666
    00679     virtual ElemTemplateElement*
    00680     createElement(
    00681             Stylesheet&                 stylesheetTree,
    00682             const XalanDOMChar*         name,
    00683             const AttributeListType&    atts,
    00684             const LocatorType*          locator = 0) = 0;
    00685
    00700     virtual ElemTemplateElement*
    00701     createElement(
    00702             Stylesheet&                 stylesheetTree,
    00703             const XalanDOMChar*         chars,
    00704             XalanDOMString::size_type   length,
    00705             bool                        preserveSpace,
    00706             bool                        disableOutputEscaping,
    00707             const LocatorType*          locator = 0) = 0;
    00708
    00723     virtual ElemTemplateElement*
    00724     createElement(
    00725             Stylesheet&                 stylesheetTree,
    00726             const XalanDOMChar*         name,
    00727             const AttributeListType&    atts,
    00728             ExtensionNSHandler&         handler,
    00729             const LocatorType*          locator = 0) = 0;
    00730
    00731     // These are inherited from XPathConstructionContext...
    00732
    00733     virtual void
    00734     error(
    00735             const XalanDOMString&       msg,
    00736             const XalanNode*            sourceNode = 0,
    00737             const ElemTemplateElement*  styleNode = 0) const = 0;
    00738
    00739     virtual void
    00740     error(
    00741             const XalanDOMString&   msg,
    00742             const XalanNode*        sourceNode,
    00743             const LocatorType*      locator) const = 0;
    00744
    00745     virtual void
    00746     error(
    00747             const char*                 msg,
    00748             const XalanNode*            sourceNode = 0,
    00749             const ElemTemplateElement*  styleNode = 0) const = 0;
    00750
    00751     virtual void
    00752     error(
    00753             const char*         msg,
    00754             const XalanNode*    sourceNode,
    00755             const LocatorType*  locator) const = 0;
    00756
    00757     virtual void
    00758     warn(
    00759             const XalanDOMString&       msg,
    00760             const XalanNode*            sourceNode = 0,
    00761             const ElemTemplateElement*  styleNode = 0) const = 0;
    00762
    00763     virtual void
    00764     warn(
    00765             const XalanDOMString&   msg,
    00766             const XalanNode*        sourceNode,
    00767             const LocatorType*      locator) const = 0;
    00768
    00769     virtual void
    00770     warn(
    00771             const char*                 msg,
    00772             const XalanNode*            sourceNode = 0,
    00773             const ElemTemplateElement*  styleNode = 0) const = 0;
    00774
    00775     virtual void
    00776     warn(
    00777             const char*         msg,
    00778             const XalanNode*    sourceNode,
    00779             const LocatorType*  locator) const = 0;
    00780
    00781     virtual void
    00782     message(
    00783             const XalanDOMString&       msg,
    00784             const XalanNode*            sourceNode = 0,
    00785             const ElemTemplateElement*  styleNode = 0) const = 0;
    00786
    00787     virtual void
    00788     message(
    00789             const XalanDOMString&   msg,
    00790             const XalanNode*        sourceNode,
    00791             const LocatorType*      locator) const = 0;
    00792
    00793     virtual void
    00794     message(
    00795             const char*                 msg,
    00796             const XalanNode*            sourceNode = 0,
    00797             const ElemTemplateElement*  styleNode = 0) const = 0;
    00798
    00799     virtual void
    00800     message(
    00801             const char*         msg,
    00802             const XalanNode*    sourceNode,
    00803             const LocatorType*  locator) const = 0;
    00804 };
    00805
    00806
    00807
    00808 XALAN_CPP_NAMESPACE_END
    00809
    00810
    00811
    00812 #endif  // STYLESHEETCONSTRUCTIONCONTEXT_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.6 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.