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 00279 virtual XPath* 00280 createMatchPattern( 00281 const LocatorType* locator, 00282 const XalanDOMString& str, 00283 const PrefixResolver& resolver, 00284 bool allowVariableReferences = true, 00285 bool allowKeyFunction = true) = 0; 00286 00299 virtual XPath* 00300 createMatchPattern( 00301 const LocatorType* locator, 00302 const XalanDOMChar* str, 00303 const PrefixResolver& resolver, 00304 bool allowVariableReferences = true, 00305 bool allowKeyFunction = true) = 0; 00306 00317 virtual XPath* 00318 createXPath( 00319 const LocatorType* locator, 00320 const XalanDOMString& str, 00321 const PrefixResolver& resolver, 00322 bool allowVariableReferences = true, 00323 bool allowKeyFunction = true) = 0; 00324 00335 virtual XPath* 00336 createXPath( 00337 const LocatorType* locator, 00338 const XalanDOMChar* str, 00339 const PrefixResolver& resolver, 00340 bool allowVariableReferences = true, 00341 bool allowKeyFunction = true) = 0; 00342 00353 virtual XPath* 00354 createXPath( 00355 const LocatorType* locator, 00356 const XalanDOMChar* str, 00357 XalanDOMString::size_type len, 00358 const PrefixResolver& resolver, 00359 bool allowVariableReferences = true, 00360 bool allowKeyFunction = true) = 0; 00361 00367 virtual const LocatorType* 00368 getLocatorFromStack() const = 0; 00369 00375 virtual void 00376 pushLocatorOnStack(const LocatorType* locator) = 0; 00377 00381 virtual void 00382 popLocatorStack() = 0; 00383 00389 virtual const XalanDOMString& 00390 getXalanXSLNameSpaceURL() const = 0; 00391 00403 virtual XalanDocument* 00404 parseXML( 00405 const XalanDOMString& urlString, 00406 DocumentHandlerType* docHandler, 00407 XalanDocument* docToRegister) = 0; 00408 00418 virtual bool 00419 isXMLSpaceAttribute( 00420 const XalanDOMChar* theAttributeName, 00421 const Stylesheet& theStylesheet, 00422 const LocatorType* theLocator = 0) = 0; 00423 00433 virtual bool 00434 isXSLUseAttributeSetsAttribute( 00435 const XalanDOMChar* theAttributeName, 00436 const Stylesheet& theStylesheet, 00437 const LocatorType* theLocator = 0) = 0; 00438 00448 virtual bool 00449 isValidQName( 00450 const XalanDOMChar* theName, 00451 const Stylesheet& theStylesheet, 00452 const LocatorType* theLocator = 0) = 0; 00453 00461 virtual eElementToken 00462 getElementToken(const XalanDOMString& name) const = 0; 00463 00469 virtual double 00470 getXSLTVersionSupported() const = 0; 00471 00472 virtual const XalanDOMString& 00473 getPooledString(const XalanDOMString& theString) = 0; 00474 00475 virtual const XalanDOMString& 00476 getPooledString( 00477 const XalanDOMChar* theString, 00478 XalanDOMString::size_type theLength = XalanDOMString::npos) = 0; 00479 00480 virtual XalanDOMString& 00481 getCachedString() = 0; 00482 00483 virtual bool 00484 releaseCachedString(XalanDOMString& theString) = 0; 00485 00493 virtual XalanDOMChar* 00494 allocateXalanDOMCharVector(XalanDOMString::size_type theLength) = 0; 00495 00505 virtual XalanDOMChar* 00506 allocateXalanDOMCharVector( 00507 const XalanDOMChar* theString, 00508 XalanDOMString::size_type theLength = XalanDOMString::npos, 00509 bool fTerminate = true) = 0; 00510 00520 virtual const AVT* 00521 createAVT( 00522 const LocatorType* locator, 00523 const XalanDOMChar* name, 00524 const XalanDOMChar* stringedValue, 00525 const PrefixResolver& resolver) = 0; 00526 00535 virtual const AVTPart* 00536 createAVTPart( 00537 const XalanDOMChar* theString, 00538 XalanDOMString::size_type theLength = XalanDOMString::npos) = 0; 00539 00549 virtual const AVTPart* 00550 createAVTPart( 00551 const LocatorType* locator, 00552 const XalanDOMChar* str, 00553 XalanDOMString::size_type len, 00554 const PrefixResolver& resolver) = 0; 00555 00563 virtual const AVT** 00564 allocateAVTPointerVector(size_type theLength) = 0; 00565 00573 virtual const AVTPart** 00574 allocateAVTPartPointerVector(size_type theLength) = 0; 00575 00585 virtual const XalanQName* 00586 createXalanQName( 00587 const XalanDOMString& qname, 00588 const NamespacesStackType& namespaces, 00589 const LocatorType* locator = 0, 00590 bool fUseDefault = false) = 0; 00591 00601 virtual const XalanQName* 00602 createXalanQName( 00603 const XalanDOMChar* qname, 00604 const NamespacesStackType& namespaces, 00605 const LocatorType* locator = 0, 00606 bool fUseDefault = false) = 0; 00607 00619 virtual const XalanQName** 00620 tokenizeQNames( 00621 size_type& count, 00622 const XalanDOMChar* qnameTokens, 00623 const NamespacesStackType& namespaces, 00624 const LocatorType* locator = 0, 00625 bool fUseDefault = false) = 0; 00626 00640 virtual ElemTemplateElement* 00641 createElement( 00642 int token, 00643 Stylesheet& stylesheetTree, 00644 const AttributeListType& atts, 00645 const LocatorType* locator = 0) = 0; 00646 00660 virtual ElemTemplateElement* 00661 createElement( 00662 int token, 00663 Stylesheet& stylesheetTree, 00664 const XalanDOMChar* name, 00665 const AttributeListType& atts, 00666 const LocatorType* locator = 0) = 0; 00667 00682 virtual ElemTemplateElement* 00683 createElement( 00684 Stylesheet& stylesheetTree, 00685 const XalanDOMChar* chars, 00686 XalanDOMString::size_type length, 00687 bool preserveSpace, 00688 bool disableOutputEscaping, 00689 const LocatorType* locator = 0) = 0; 00690 00705 virtual ElemTemplateElement* 00706 createElement( 00707 Stylesheet& stylesheetTree, 00708 const XalanDOMChar* name, 00709 const AttributeListType& atts, 00710 ExtensionNSHandler& handler, 00711 const LocatorType* locator = 0) = 0; 00712 00729 virtual const XalanMatchPatternData* 00730 createXalanMatchPatternData( 00731 const ElemTemplate& theTemplate, 00732 size_type thePosition, 00733 const XalanDOMString& theTargetString, 00734 const XPath& theMatchPattern, 00735 const XalanDOMString& thePatternString, 00736 XPath::eMatchScore thePriority) = 0; 00737 00738 00739 // These are inherited from XPathConstructionContext... 00740 00741 virtual void 00742 error( 00743 const XalanDOMString& msg, 00744 const XalanNode* sourceNode = 0, 00745 const ElemTemplateElement* styleNode = 0) const = 0; 00746 00747 virtual void 00748 error( 00749 const XalanDOMString& msg, 00750 const XalanNode* sourceNode, 00751 const LocatorType* locator) const = 0; 00752 00753 virtual void 00754 warn( 00755 const XalanDOMString& msg, 00756 const XalanNode* sourceNode = 0, 00757 const ElemTemplateElement* styleNode = 0) const = 0; 00758 00759 virtual void 00760 warn( 00761 const XalanDOMString& msg, 00762 const XalanNode* sourceNode, 00763 const LocatorType* locator) const = 0; 00764 00765 virtual void 00766 message( 00767 const XalanDOMString& msg, 00768 const XalanNode* sourceNode = 0, 00769 const ElemTemplateElement* styleNode = 0) const = 0; 00770 00771 virtual void 00772 message( 00773 const XalanDOMString& msg, 00774 const XalanNode* sourceNode, 00775 const LocatorType* locator) const = 0; 00776 00777 }; 00778 00779 00780 00781 XALAN_CPP_NAMESPACE_END 00782 00783 00784 00785 #endif // STYLESHEETCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.10 |
|