## Xalan-C++ API Documentation

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

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-2004 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         // This one doesn't really have a name.
    00185         // It's used for forward-compatible
    00186         // processing.
    00187         ELEMNAME_FORWARD_COMPATIBLE,
    00188
    00189         // Extension handling.
    00190         ELEMNAME_EXTENSION_CALL,
    00191         ELEMNAME_EXTENSION_HANDLER
    00192     };
    00193
    00194     typedef URISupport::URLAutoPtrType  URLAutoPtrType;
    00195
    00196     explicit
    00197     StylesheetConstructionContext();
    00198
    00199     virtual
    00200     ~StylesheetConstructionContext();
    00201
    00202
    00207     virtual void
    00208     reset() = 0;
    00209
    00218     virtual StylesheetRoot*
    00219     create(const XalanDOMString&    theBaseIdentifier) = 0;
    00220
    00229     virtual StylesheetRoot*
    00230     create(const XSLTInputSource&   theInputSource) = 0;
    00231
    00241     virtual Stylesheet*
    00242     create(
    00243             StylesheetRoot&         theStylesheetRoot,
    00244             const XalanDOMString&   theBaseIdentifier) = 0;
    00245
    00252     virtual void
    00253     destroy(StylesheetRoot*     theStylesheetRoot) = 0;
    00254
    00261     virtual URLAutoPtrType
    00262     getURLFromString(const XalanDOMString&  urlString) = 0;
    00263
    00270     virtual XalanDOMString
    00271     getURLStringFromString(const XalanDOMString&    urlString) = 0;
    00272
    00280     virtual URLAutoPtrType
    00281     getURLFromString(
    00282             const XalanDOMString&   urlString,
    00283             const XalanDOMString&   base) = 0;
    00284
    00292     virtual XalanDOMString
    00293     getURLStringFromString(
    00294             const XalanDOMString&   urlString,
    00295             const XalanDOMString&   base) = 0;
    00296
    00303     virtual const XalanDOMString&
    00304     getXSLTNamespaceURI() const = 0;
    00305
    00316     virtual XPath*
    00317     createMatchPattern(
    00318             const LocatorType*      locator,
    00319             const XalanDOMString&   str,
    00320             const PrefixResolver&   resolver) = 0;
    00321
    00332     virtual XPath*
    00333     createMatchPattern(
    00334             const LocatorType*      locator,
    00335             const XalanDOMChar*     str,
    00336             const PrefixResolver&   resolver) = 0;
    00337
    00348     virtual XPath*
    00349     createXPath(
    00350             const LocatorType*      locator,
    00351             const XalanDOMString&   str,
    00352             const PrefixResolver&   resolver) = 0;
    00353
    00364     virtual XPath*
    00365     createXPath(
    00366             const LocatorType*      locator,
    00367             const XalanDOMChar*     str,
    00368             const PrefixResolver&   resolver) = 0;
    00369
    00380     virtual XPath*
    00381     createXPath(
    00382             const LocatorType*          locator,
    00383             const XalanDOMChar*         str,
    00384             XalanDOMString::size_type   len,
    00385             const PrefixResolver&       resolver) = 0;
    00386
    00392     virtual const LocatorType*
    00393     getLocatorFromStack() const = 0;
    00394
    00400     virtual void
    00401     pushLocatorOnStack(const LocatorType*   locator) = 0;
    00402
    00406     virtual void
    00407     popLocatorStack() = 0;
    00408
    00414     virtual const XalanDOMString&
    00415     getXalanXSLNameSpaceURL() const = 0;
    00416
    00428     virtual XalanDocument*
    00429     parseXML(
    00430             const XalanDOMString&   urlString,
    00431             DocumentHandlerType*    docHandler,
    00432             XalanDocument*          docToRegister) = 0;
    00433
    00443     virtual bool
    00444     isXMLSpaceAttribute(
    00445             const XalanDOMChar*     theAttributeName,
    00446             const Stylesheet&       theStylesheet,
    00447             const LocatorType*      theLocator = 0) = 0;
    00448
    00458     virtual bool
    00459     isXSLUseAttributeSetsAttribute(
    00460             const XalanDOMChar*     theAttributeName,
    00461             const Stylesheet&       theStylesheet,
    00462             const LocatorType*      theLocator = 0) = 0;
    00463
    00473     virtual bool
    00474     isValidQName(
    00475             const XalanDOMChar*     theName,
    00476             const Stylesheet&       theStylesheet,
    00477             const LocatorType*      theLocator = 0) = 0;
    00478
    00486     virtual eElementToken
    00487     getElementToken(const XalanDOMString&   name) const = 0;
    00488
    00494     virtual double
    00495     getXSLTVersionSupported() const = 0;
    00496
    00497     virtual const XalanDOMString&
    00498     getPooledString(const XalanDOMString&   theString) = 0;
    00499
    00500     virtual const XalanDOMString&
    00501     getPooledString(
    00502             const XalanDOMChar*         theString,
    00503             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00504
    00505     virtual XalanDOMString&
    00506     getCachedString() = 0;
    00507
    00508     virtual bool
    00509     releaseCachedString(XalanDOMString&     theString) = 0;
    00510
    00518     virtual XalanDOMChar*
    00519     allocateXalanDOMCharVector(XalanDOMString::size_type    theLength) = 0;
    00520
    00530     virtual XalanDOMChar*
    00531     allocateXalanDOMCharVector(
    00532             const XalanDOMChar*         theString,
    00533             XalanDOMString::size_type   theLength = XalanDOMString::npos,
    00534             bool                        fTerminate = true) = 0;
    00535
    00545     virtual const AVT*
    00546     createAVT(
    00547             const LocatorType*      locator,
    00548             const XalanDOMChar*     name,
    00549             const XalanDOMChar*     stringedValue,
    00550             const PrefixResolver&   resolver) = 0;
    00551
    00560     virtual const AVTPart*
    00561     createAVTPart(
    00562             const XalanDOMChar*         theString,
    00563             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00564
    00574     virtual const AVTPart*
    00575     createAVTPart(
    00576             const LocatorType*          locator,
    00577             const XalanDOMChar*         str,
    00578             XalanDOMString::size_type   len,
    00579             const PrefixResolver&       resolver) = 0;
    00580
    00588     virtual const AVT**
    00589     allocateAVTPointerVector(size_type  theLength) = 0;
    00590
    00598     virtual const AVTPart**
    00599     allocateAVTPartPointerVector(size_type  theLength) = 0;
    00600
    00610     virtual const XalanQName*
    00611     createXalanQName(
    00612             const XalanDOMString&       qname,
    00613             const NamespacesStackType&  namespaces,
    00614             const LocatorType*          locator = 0,
    00615             bool                        fUseDefault = false) = 0;
    00616
    00626     virtual const XalanQName*
    00627     createXalanQName(
    00628             const XalanDOMChar*         qname,
    00629             const NamespacesStackType&  namespaces,
    00630             const LocatorType*          locator = 0,
    00631             bool                        fUseDefault = false) = 0;
    00632
    00644     virtual const XalanQName**
    00645     tokenizeQNames(
    00646             size_type&                  count,
    00647             const XalanDOMChar*         qnameTokens,
    00648             const NamespacesStackType&  namespaces,
    00649             const LocatorType*          locator = 0,
    00650             bool                        fUseDefault = false) = 0;
    00651
    00665     virtual ElemTemplateElement*
    00666     createElement(
    00667             int                         token,
    00668             Stylesheet&                 stylesheetTree,
    00669             const AttributeListType&    atts,
    00670             const LocatorType*          locator = 0) = 0;
    00671
    00685     virtual ElemTemplateElement*
    00686     createElement(
    00687             int                         token,
    00688             Stylesheet&                 stylesheetTree,
    00689             const XalanDOMChar*         name,
    00690             const AttributeListType&    atts,
    00691             const LocatorType*          locator = 0) = 0;
    00692
    00707     virtual ElemTemplateElement*
    00708     createElement(
    00709             Stylesheet&                 stylesheetTree,
    00710             const XalanDOMChar*         chars,
    00711             XalanDOMString::size_type   length,
    00712             bool                        preserveSpace,
    00713             bool                        disableOutputEscaping,
    00714             const LocatorType*          locator = 0) = 0;
    00715
    00730     virtual ElemTemplateElement*
    00731     createElement(
    00732             Stylesheet&                 stylesheetTree,
    00733             const XalanDOMChar*         name,
    00734             const AttributeListType&    atts,
    00735             ExtensionNSHandler&         handler,
    00736             const LocatorType*          locator = 0) = 0;
    00737
    00738     // These are inherited from XPathConstructionContext...
    00739
    00740     virtual void
    00741     error(
    00742             const XalanDOMString&       msg,
    00743             const XalanNode*            sourceNode = 0,
    00744             const ElemTemplateElement*  styleNode = 0) const = 0;
    00745
    00746     virtual void
    00747     error(
    00748             const XalanDOMString&   msg,
    00749             const XalanNode*        sourceNode,
    00750             const LocatorType*      locator) const = 0;
    00751
    00752     virtual void
    00753     error(
    00754             const char*                 msg,
    00755             const XalanNode*            sourceNode = 0,
    00756             const ElemTemplateElement*  styleNode = 0) const = 0;
    00757
    00758     virtual void
    00759     error(
    00760             const char*         msg,
    00761             const XalanNode*    sourceNode,
    00762             const LocatorType*  locator) const = 0;
    00763
    00764     virtual void
    00765     warn(
    00766             const XalanDOMString&       msg,
    00767             const XalanNode*            sourceNode = 0,
    00768             const ElemTemplateElement*  styleNode = 0) const = 0;
    00769
    00770     virtual void
    00771     warn(
    00772             const XalanDOMString&   msg,
    00773             const XalanNode*        sourceNode,
    00774             const LocatorType*      locator) const = 0;
    00775
    00776     virtual void
    00777     warn(
    00778             const char*                 msg,
    00779             const XalanNode*            sourceNode = 0,
    00780             const ElemTemplateElement*  styleNode = 0) const = 0;
    00781
    00782     virtual void
    00783     warn(
    00784             const char*         msg,
    00785             const XalanNode*    sourceNode,
    00786             const LocatorType*  locator) const = 0;
    00787
    00788     virtual void
    00789     message(
    00790             const XalanDOMString&       msg,
    00791             const XalanNode*            sourceNode = 0,
    00792             const ElemTemplateElement*  styleNode = 0) const = 0;
    00793
    00794     virtual void
    00795     message(
    00796             const XalanDOMString&   msg,
    00797             const XalanNode*        sourceNode,
    00798             const LocatorType*      locator) const = 0;
    00799
    00800     virtual void
    00801     message(
    00802             const char*                 msg,
    00803             const XalanNode*            sourceNode = 0,
    00804             const ElemTemplateElement*  styleNode = 0) const = 0;
    00805
    00806     virtual void
    00807     message(
    00808             const char*         msg,
    00809             const XalanNode*    sourceNode,
    00810             const LocatorType*  locator) const = 0;
    00811 };
    00812
    00813
    00814
    00815 XALAN_CPP_NAMESPACE_END
    00816
    00817
    00818
    00819 #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.7 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.