## Xalan-C++ API Documentation

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

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# StylesheetConstructionContext.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright 1999-2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *     http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016 #if !defined(STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680)
    00017 #define STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
    00018
    00019
    00020
    00021 // Base include file.  Must be first.
    00022 #include <xalanc/XSLT/XSLTDefinitions.hpp>
    00023
    00024
    00025
    00026 #include <xalanc/PlatformSupport/URISupport.hpp>
    00027
    00028
    00029
    00030 #include <xalanc/XalanDOM/XalanDOMString.hpp>
    00031
    00032
    00033
    00034 #include <xalanc/XPath/XalanQName.hpp>
    00035 #include <xalanc/XPath/XPath.hpp>
    00036 #include <xalanc/XPath/XPathConstructionContext.hpp>
    00037
    00038
    00039
    00040 XALAN_DECLARE_XERCES_CLASS(AttributeList)
    00041 XALAN_DECLARE_XERCES_CLASS(DocumentHandler)
    00042
    00043
    00044
    00045 XALAN_CPP_NAMESPACE_BEGIN
    00046
    00047
    00048
    00049 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList    AttributeListType;
    00050 typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler  DocumentHandlerType;
    00051
    00052
    00053
    00054 class AVT;
    00055 class AVTPart;
    00056 class ElemTemplate;
    00057 class ElemTemplateElement;
    00058 class ExtensionNSHandler;
    00059 class PrefixResolver;
    00060 class Stylesheet;
    00061 class StylesheetRoot;
    00062 class XalanDocument;
    00063 class XalanMatchPatternData;
    00064 class XalanNode;
    00065 class XSLTInputSource;
    00066
    00067
    00068
    00069 //
    00070 // An abstract class which provides support for constructing the internal
    00071 // representation  of a stylesheet.
    00072 //
    00073 class XALAN_XSLT_EXPORT StylesheetConstructionContext : public XPathConstructionContext
    00074 {
    00075 public:
    00076
    00077     typedef XalanQName::NamespacesStackType     NamespacesStackType;
    00078
    00079 #if defined(XALAN_STRICT_ANSI_HEADERS)
    00080     typedef std::size_t     size_type;
    00081 #else
    00082     typedef size_t          size_type;
    00083 #endif
    00084
    00089     enum eElementToken
    00090     {
    00091         ELEMNAME_UNDEFINED = -2,
    00092         ELEMNAME_EMPTY = -1,
    00093         ELEMNAME_WITH_PARAM,
    00094         ELEMNAME_APPLY_TEMPLATES,
    00095         ELEMNAME_CHOOSE,
    00096         ELEMNAME_COMMENT,
    00097         ELEMNAME_COPY,
    00098         ELEMNAME_COPY_OF,
    00099         ELEMNAME_ATTRIBUTE,
    00100         ELEMNAME_ATTRIBUTE_SET,
    00101         ELEMNAME_EXTENSION,
    00102         ELEMNAME_FOR_EACH,
    00103         ELEMNAME_KEY,
    00104         ELEMNAME_IF,
    00105         ELEMNAME_IMPORT,
    00106         ELEMNAME_INCLUDE,
    00107         ELEMNAME_CALL_TEMPLATE,
    00108         ELEMNAME_PARAM,
    00109         ELEMNAME_NUMBER,
    00110         ELEMNAME_OTHERWISE,
    00111         ELEMNAME_PI,
    00112         ELEMNAME_PRESERVE_SPACE,
    00113         ELEMNAME_TEMPLATE,
    00114         ELEMNAME_SORT,
    00115         ELEMNAME_STRIP_SPACE,
    00116         ELEMNAME_STYLESHEET,
    00117         ELEMNAME_TEXT,
    00118         ELEMNAME_VALUE_OF,
    00119         ELEMNAME_WHEN,
    00120         ELEMNAME_FALLBACK,
    00121         ELEMNAME_ELEMENT,
    00122
    00123         ELEMNAME_APPLY_IMPORTS,
    00124
    00125         ELEMNAME_VARIABLE,
    00126         ELEMNAME_MESSAGE,
    00127
    00128         ELEMNAME_OUTPUT,
    00129         ELEMNAME_DECIMAL_FORMAT,
    00130         ELEMNAME_NAMESPACE_ALIAS,
    00131
    00132         // This one doesn't really have a name.
    00133         // It's used for any literal result
    00134         // element.
    00135         ELEMNAME_LITERAL_RESULT,
    00136
    00137         // This one doesn't really have a name.
    00138         // It's used for any literal text in
    00139         // the content of a literal result
    00140         // element.
    00141         ELEMNAME_TEXT_LITERAL_RESULT,
    00142
    00143         // This one doesn't really have a name.
    00144         // It's used for forward-compatible
    00145         // processing.
    00146         ELEMNAME_FORWARD_COMPATIBLE,
    00147
    00148         // Extension handling.
    00149         ELEMNAME_EXTENSION_CALL,
    00150         ELEMNAME_EXTENSION_HANDLER
    00151     };
    00152
    00153     typedef URISupport::URLAutoPtrType  URLAutoPtrType;
    00154
    00155     explicit
    00156     StylesheetConstructionContext(MemoryManagerType&  theManager);
    00157
    00158     virtual
    00159     ~StylesheetConstructionContext();
    00160
    00161
    00166     virtual void
    00167     reset() = 0;
    00168
    00177     virtual StylesheetRoot*
    00178     create(const XalanDOMString&    theBaseIdentifier) = 0;
    00179
    00188     virtual StylesheetRoot*
    00189     create(const XSLTInputSource&   theInputSource) = 0;
    00190
    00200     virtual Stylesheet*
    00201     create(
    00202             StylesheetRoot&         theStylesheetRoot,
    00203             const XalanDOMString&   theBaseIdentifier) = 0;
    00204
    00211     virtual void
    00212     destroy(StylesheetRoot*     theStylesheetRoot) = 0;
    00213
    00220     virtual URLAutoPtrType
    00221     getURLFromString(const XalanDOMString&  urlString) = 0;
    00222
    00229     virtual XalanDOMString&
    00230     getURLStringFromString(const XalanDOMString&    urlString,
    00231                             XalanDOMString& theResult) = 0;
    00232
    00240     virtual URLAutoPtrType
    00241     getURLFromString(
    00242             const XalanDOMString&   urlString,
    00243             const XalanDOMString&   base) = 0;
    00244
    00252     virtual XalanDOMString&
    00253     getURLStringFromString(
    00254             const XalanDOMString&   urlString,
    00255             const XalanDOMString&   base,
    00256             XalanDOMString& theResult) = 0;
    00257
    00264     virtual const XalanDOMString&
    00265     getXSLTNamespaceURI() const = 0;
    00266
    00277     virtual XPath*
    00278     createMatchPattern(
    00279             const LocatorType*      locator,
    00280             const XalanDOMString&   str,
    00281             const PrefixResolver&   resolver) = 0;
    00282
    00293     virtual XPath*
    00294     createMatchPattern(
    00295             const LocatorType*      locator,
    00296             const XalanDOMChar*     str,
    00297             const PrefixResolver&   resolver) = 0;
    00298
    00309     virtual XPath*
    00310     createXPath(
    00311             const LocatorType*      locator,
    00312             const XalanDOMString&   str,
    00313             const PrefixResolver&   resolver) = 0;
    00314
    00325     virtual XPath*
    00326     createXPath(
    00327             const LocatorType*      locator,
    00328             const XalanDOMChar*     str,
    00329             const PrefixResolver&   resolver) = 0;
    00330
    00341     virtual XPath*
    00342     createXPath(
    00343             const LocatorType*          locator,
    00344             const XalanDOMChar*         str,
    00345             XalanDOMString::size_type   len,
    00346             const PrefixResolver&       resolver) = 0;
    00347
    00353     virtual const LocatorType*
    00354     getLocatorFromStack() const = 0;
    00355
    00361     virtual void
    00362     pushLocatorOnStack(const LocatorType*   locator) = 0;
    00363
    00367     virtual void
    00368     popLocatorStack() = 0;
    00369
    00375     virtual const XalanDOMString&
    00376     getXalanXSLNameSpaceURL() const = 0;
    00377
    00389     virtual XalanDocument*
    00390     parseXML(
    00391             const XalanDOMString&   urlString,
    00392             DocumentHandlerType*    docHandler,
    00393             XalanDocument*          docToRegister) = 0;
    00394
    00404     virtual bool
    00405     isXMLSpaceAttribute(
    00406             const XalanDOMChar*     theAttributeName,
    00407             const Stylesheet&       theStylesheet,
    00408             const LocatorType*      theLocator = 0) = 0;
    00409
    00419     virtual bool
    00420     isXSLUseAttributeSetsAttribute(
    00421             const XalanDOMChar*     theAttributeName,
    00422             const Stylesheet&       theStylesheet,
    00423             const LocatorType*      theLocator = 0) = 0;
    00424
    00434     virtual bool
    00435     isValidQName(
    00436             const XalanDOMChar*     theName,
    00437             const Stylesheet&       theStylesheet,
    00438             const LocatorType*      theLocator = 0) = 0;
    00439
    00447     virtual eElementToken
    00448     getElementToken(const XalanDOMString&   name) const = 0;
    00449
    00455     virtual double
    00456     getXSLTVersionSupported() const = 0;
    00457
    00458     virtual const XalanDOMString&
    00459     getPooledString(const XalanDOMString&   theString) = 0;
    00460
    00461     virtual const XalanDOMString&
    00462     getPooledString(
    00463             const XalanDOMChar*         theString,
    00464             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00465
    00466     virtual XalanDOMString&
    00467     getCachedString() = 0;
    00468
    00469     virtual bool
    00470     releaseCachedString(XalanDOMString&     theString) = 0;
    00471
    00479     virtual XalanDOMChar*
    00480     allocateXalanDOMCharVector(XalanDOMString::size_type    theLength) = 0;
    00481
    00491     virtual XalanDOMChar*
    00492     allocateXalanDOMCharVector(
    00493             const XalanDOMChar*         theString,
    00494             XalanDOMString::size_type   theLength = XalanDOMString::npos,
    00495             bool                        fTerminate = true) = 0;
    00496
    00506     virtual const AVT*
    00507     createAVT(
    00508             const LocatorType*      locator,
    00509             const XalanDOMChar*     name,
    00510             const XalanDOMChar*     stringedValue,
    00511             const PrefixResolver&   resolver) = 0;
    00512
    00521     virtual const AVTPart*
    00522     createAVTPart(
    00523             const XalanDOMChar*         theString,
    00524             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00525
    00535     virtual const AVTPart*
    00536     createAVTPart(
    00537             const LocatorType*          locator,
    00538             const XalanDOMChar*         str,
    00539             XalanDOMString::size_type   len,
    00540             const PrefixResolver&       resolver) = 0;
    00541
    00549     virtual const AVT**
    00550     allocateAVTPointerVector(size_type  theLength) = 0;
    00551
    00559     virtual const AVTPart**
    00560     allocateAVTPartPointerVector(size_type  theLength) = 0;
    00561
    00571     virtual const XalanQName*
    00572     createXalanQName(
    00573             const XalanDOMString&       qname,
    00574             const NamespacesStackType&  namespaces,
    00575             const LocatorType*          locator = 0,
    00576             bool                        fUseDefault = false) = 0;
    00577
    00587     virtual const XalanQName*
    00588     createXalanQName(
    00589             const XalanDOMChar*         qname,
    00590             const NamespacesStackType&  namespaces,
    00591             const LocatorType*          locator = 0,
    00592             bool                        fUseDefault = false) = 0;
    00593
    00605     virtual const XalanQName**
    00606     tokenizeQNames(
    00607             size_type&                  count,
    00608             const XalanDOMChar*         qnameTokens,
    00609             const NamespacesStackType&  namespaces,
    00610             const LocatorType*          locator = 0,
    00611             bool                        fUseDefault = false) = 0;
    00612
    00626     virtual ElemTemplateElement*
    00627     createElement(
    00628             int                         token,
    00629             Stylesheet&                 stylesheetTree,
    00630             const AttributeListType&    atts,
    00631             const LocatorType*          locator = 0) = 0;
    00632
    00646     virtual ElemTemplateElement*
    00647     createElement(
    00648             int                         token,
    00649             Stylesheet&                 stylesheetTree,
    00650             const XalanDOMChar*         name,
    00651             const AttributeListType&    atts,
    00652             const LocatorType*          locator = 0) = 0;
    00653
    00668     virtual ElemTemplateElement*
    00669     createElement(
    00670             Stylesheet&                 stylesheetTree,
    00671             const XalanDOMChar*         chars,
    00672             XalanDOMString::size_type   length,
    00673             bool                        preserveSpace,
    00674             bool                        disableOutputEscaping,
    00675             const LocatorType*          locator = 0) = 0;
    00676
    00691     virtual ElemTemplateElement*
    00692     createElement(
    00693             Stylesheet&                 stylesheetTree,
    00694             const XalanDOMChar*         name,
    00695             const AttributeListType&    atts,
    00696             ExtensionNSHandler&         handler,
    00697             const LocatorType*          locator = 0) = 0;
    00698
    00715     virtual const XalanMatchPatternData*
    00716     createXalanMatchPatternData(
    00717             const ElemTemplate&     theTemplate,
    00718             size_type               thePosition,
    00719             const XalanDOMString&   theTargetString,
    00720             const XPath&            theMatchPattern,
    00721             const XalanDOMString&   thePatternString,
    00722             XPath::eMatchScore      thePriority) = 0;
    00723
    00724
    00725     // These are inherited from XPathConstructionContext...
    00726
    00727     virtual void
    00728     error(
    00729             const XalanDOMString&       msg,
    00730             const XalanNode*            sourceNode = 0,
    00731             const ElemTemplateElement*  styleNode = 0) const = 0;
    00732
    00733     virtual void
    00734     error(
    00735             const XalanDOMString&   msg,
    00736             const XalanNode*        sourceNode,
    00737             const LocatorType*      locator) const = 0;
    00738
    00739     virtual void
    00740     warn(
    00741             const XalanDOMString&       msg,
    00742             const XalanNode*            sourceNode = 0,
    00743             const ElemTemplateElement*  styleNode = 0) const = 0;
    00744
    00745     virtual void
    00746     warn(
    00747             const XalanDOMString&   msg,
    00748             const XalanNode*        sourceNode,
    00749             const LocatorType*      locator) const = 0;
    00750
    00751     virtual void
    00752     message(
    00753             const XalanDOMString&       msg,
    00754             const XalanNode*            sourceNode = 0,
    00755             const ElemTemplateElement*  styleNode = 0) const = 0;
    00756
    00757     virtual void
    00758     message(
    00759             const XalanDOMString&   msg,
    00760             const XalanNode*        sourceNode,
    00761             const LocatorType*      locator) const = 0;
    00762
    00763 };
    00764
    00765
    00766
    00767 XALAN_CPP_NAMESPACE_END
    00768
    00769
    00770
    00771 #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.9 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.