18 #if !defined(STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680) 19 #define STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680 43 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 57 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION) 79 class XalanSourceTreeDocument;
117 MemoryManager& theManager,
138 MemoryManager& theManager,
145 MemoryManager& theManager,
162 m_xpathExecutionContextDefault.setXPathEnvSupport(theSupport);
173 m_xpathExecutionContextDefault.setDOMSupport(theDOMSupport);
184 m_xpathExecutionContextDefault.setXObjectFactory(theXObjectFactory);
186 m_xobjectFactory = theXObjectFactory;
198 m_xsltProcessor = theProcessor;
204 return m_usePerInstanceDocumentFactory;
210 m_usePerInstanceDocumentFactory = fValue;
217 getQuietConflictWarnings()
const;
220 getCopyTextNodesOnly()
const;
223 pushCopyTextNodesOnly(
bool copyTextNodesOnly);
226 popCopyTextNodesOnly();
228 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 230 pushProcessCurrentAttribute(
bool processAttribute);
233 popProcessCurrentAttribute();
236 pushSkipElementAttributes(
bool skipAttributes);
239 getSkipElementAttributes()
const;
242 popSkipElementAttributes();
245 pushExecuteIf(
bool executeIf);
252 getRootDocument()
const;
261 getCurrentMode()
const;
270 getCurrentTemplate()
const;
276 popCurrentTemplate();
279 isElementPending()
const;
282 replacePendingAttribute(
283 const XalanDOMChar* theName,
284 const XalanDOMChar* theNewType,
285 const XalanDOMChar* theNewValue);
301 const XalanDOMChar* value);
304 copyNamespaceAttributes(
const XalanNode& src);
307 getResultPrefixForNamespace(
const XalanDOMString& theNamespace)
const;
310 getResultNamespaceForPrefix(
const XalanDOMString& thePrefix)
const;
319 getFormatterListener()
const;
328 setIndent(
int indentAmount);
336 returnXPath(
const XPath* xpath);
339 pushTopLevelVariables(
const ParamVectorType& topLevelParams);
348 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 383 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 400 resolveTopLevelParams();
403 clearTopLevelParams();
405 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 406 virtual void beginParams();
408 virtual void endParams();
426 getGlobalStackFrameIndex()
const;
429 getCurrentStackFrameIndex()
const;
432 pushCurrentStackFrameIndex(
int currentStackFrameIndex = -1);
435 popCurrentStackFrameIndex();
444 startElement(
const XalanDOMChar* name);
447 endElement(
const XalanDOMChar* name);
451 const XalanDOMChar* ch,
457 const XalanDOMChar* ch,
462 comment(
const XalanDOMChar* data);
465 processingInstruction(
466 const XalanDOMChar* target,
467 const XalanDOMChar* data);
475 const Locator* locator);
482 bool shouldCloneAttributes,
483 const Locator* locator);
485 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 487 beginCreateXResultTreeFrag(
XalanNode* sourceNode);
490 endCreateXResultTreeFrag();
500 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 502 createXResultTreeFrag(
510 const Locator* locator);
513 outputResultTreeFragment(
515 const Locator* locator);
518 getXSLNameSpaceURL()
const;
521 getXalanXSLNameSpaceURL()
const;
530 popElementRecursionStack();
536 getEscapeURLs()
const;
539 setEscapeURLs(eEscapeURLs value);
542 getOmitMETATag()
const;
545 setOmitMETATag(eOmitMETATag value);
548 createFormatterToXML(
551 bool doIndent =
false,
552 int indent = eDefaultXMLIndentAmount,
561 createFormatterToHTML(
567 bool doIndent =
true,
568 int indent = eDefaultHTMLIndentAmount,
569 bool escapeURLs =
true,
570 bool omitMetaTag =
false);
573 createFormatterToText(
577 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 588 virtual XalanNumberFormatAutoPtr
589 createXalanNumberFormat();
603 create(MemoryManager& theManager);
609 return s_defaultXalanNumberFormatFactory;
619 static XalanNumberFormatFactory*
620 installXalanNumberFormatFactory(XalanNumberFormatFactory* theFactory);
624 getTraceListeners()
const;
636 getTraceSelects()
const;
659 const XalanDOMChar* theLHS,
660 const XalanDOMChar* theRHS,
665 const XalanDOMChar* theLHS,
666 const XalanDOMChar* theRHS,
667 const XalanDOMChar* theLocale,
683 const XalanDOMChar* theLHS,
684 const XalanDOMChar* theRHS,
689 const XalanDOMChar* theLHS,
690 const XalanDOMChar* theRHS,
691 const XalanDOMChar* theLocale,
700 uninstallCollationCompareFunctor();
720 const Locator* locator = 0)
const = 0;
729 const Locator* locator = 0);
738 const Locator* locator = 0);
745 uninstallFormatNumberFunctor();
756 createPrintWriter(StreamType& theStream);
759 createPrintWriter(FILE* theStream);
783 getCurrentNode()
const;
786 pushCurrentNode(
XalanNode* theCurrentNode);
800 popContextNodeList();
803 getContextNodeList()
const;
806 getContextNodeListLength()
const;
809 getContextNodeListPosition(
const XalanNode& contextNode)
const;
812 elementAvailable(
const XalanQName& theQName)
const;
817 const Locator* locator)
const;
820 functionAvailable(
const XalanQName& theQName)
const;
825 const Locator* locator)
const;
832 const XObjectArgVectorType& argVec,
833 const Locator* locator);
837 MemoryManager& theManager,
840 ErrorHandler* theErrorHandler = 0)
const;
843 borrowMutableNodeRefList();
849 createMutableNodeRefList(MemoryManager& theManager)
const;
851 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 853 createUseAttributeSetIndexesOnStack();
855 virtual UseAttributeSetIndexes&
856 getUseAttributeSetIndexes();
859 popUseAttributeSetIndexesFromStack();
871 createAndPushMutableNodeRefList();
874 releaseAndPopMutableNodeRefList();
886 getNextNodeToTransform();
889 popNodesToTransformList();
892 getAndPushCachedString();
895 getLastCachedString();
898 getAndPopCachedString();
913 const Locator* locator,
921 const Locator* locator,
927 const Locator* locator = 0);
930 getPrefixResolver()
const;
942 getUnparsedEntityURI(
947 shouldStripSourceNode(
const XalanText& node);
961 eClassification classification,
963 const Locator* locator,
969 eClassification classification,
978 m_xsltProcessor(xsltProcessor)
995 getSourceTreeFactory(MemoryManager& theManager)
const;
997 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 1001 borrowFormatterToText();
1010 getDecimalFormatSymbols(
const XalanQName& qname);
1012 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 1023 ParamsVectorType& params);
1033 isCached(
const XPath* theXPath);
1051 const XPath* theXPath);
1058 cleanUpTransients();
1066 enum { eXPathCacheMax = 50,
1067 eDefaultParamsVectorSize = 10,
1068 eXResultTreeFragAllocatorBlockSize = 10,
1069 eDocumentAllocatorBlockSize = 10,
1070 eDocumentFragmentAllocatorBlockSize = 10,
1071 eDefaultAttributeAllocatorBlockSize = 10,
1072 eDefaultAttributeNSAllocatorBlockSize = 10,
1073 eDefaultCommentAllocatorBlockSize = 10,
1074 eDefaultElementAllocatorBlockSize = 10,
1075 eDefaultElementNSAllocatorBlockSize = 10,
1076 eDefaultPIAllocatorBlockSize = 10,
1077 eDefaultTextAllocatorBlockSize = 20,
1078 eDefaultTextIWSAllocatorBlockSize = 20 };
1080 ElementTemplateElementStackType m_elementRecursionStack;
1082 const StylesheetRoot* m_stylesheetRoot;
1084 FormatterListenerVectorType m_formatterListeners;
1086 PrintWriterVectorType m_printWriters;
1088 OutputStreamVectorType m_outputStreams;
1090 CollationCompareFunctor* m_collationCompareFunctor;
1097 VariablesStack m_variablesStack;
1099 ParamsVectorType m_paramsVector;
1101 XPathCacheMapType m_matchPatternCache;
1103 KeyTablesTableType m_keyTables;
1105 CountersTable m_countersTable;
1111 mutable XalanMemMgrAutoPtr<XalanSourceTreeDocument> m_sourceTreeResultTreeFactory;
1114 const XalanQName* m_mode;
1116 CurrentTemplateStackType m_currentTemplateStack;
1120 XResultTreeFragAllocator m_xresultTreeFragAllocator;
1122 XalanSourceTreeDocumentFragmentAllocator m_documentFragmentAllocator;
1124 XalanSourceTreeDocumentAllocator m_documentAllocator;
1126 typedef XalanVector<bool> BooleanStackType;
1127 typedef XalanVector<const XalanQName*> ModeStackType;
1128 typedef XalanVector<int> IntStackType;
1130 BooleanStackType m_copyTextNodesOnlyStack;
1131 ModeStackType m_modeStack;
1132 IntStackType m_currentIndexStack;
1134 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION) 1135 typedef XalanMemoryManagerObjectCacheDefault<FormatterToText> FormatterToTextCacheType;
1136 typedef XalanMemoryManagerObjectCacheDefault<FormatterToSourceTree> FormatterToSourceTreeCacheType;
1137 typedef XalanMemoryManagerObjectCacheDefault<NodeSorter> NodeSorterCacheType;
1139 FormatterToTextCacheType m_formatterToTextCache;
1141 FormatterToSourceTreeCacheType m_formatterToSourceTreeCache;
1143 NodeSorterCacheType m_nodeSorterCache;
1146 class FormatterToTextDOMString :
public FormatterToText
1150 FormatterToTextDOMString(MemoryManager& theManager);
1153 ~FormatterToTextDOMString();
1156 setDOMString(XalanDOMString& theString)
1158 m_printWriter.setString(theString);
1164 FormatterToTextDOMString(
const FormatterToTextDOMString&);
1166 FormatterToTextDOMString&
1167 operator=(
const FormatterToTextDOMString&);
1170 operator==(
const FormatterToTextDOMString&)
const;
1174 DOMStringPrintWriter m_printWriter;
1176 static XalanDOMString s_dummyString;
1179 typedef XalanVector<XObjectPtr> XObjectPtrStackType;
1180 typedef XalanVector<ParamsVectorType> ParamsVectorStackType;
1181 typedef XalanVector<UseAttributeSetIndexes> UseAttributeSetIndexesStackType;
1182 typedef XalanObjectStackCache<MutableNodeRefList,DefaultCacheCreateFunctorMemMgr<MutableNodeRefList> >
1183 MutableNodeRefListStackType;
1185 typedef XalanObjectStackCache<XalanDOMString,DefaultCacheCreateFunctorMemMgr<XalanDOMString> >
1188 typedef XalanObjectStackCache<FormatterToTextDOMString,DefaultCacheCreateFunctorMemMgr<FormatterToTextDOMString> >
1189 FormatterToTextStackType;
1190 typedef XalanObjectStackCache<FormatterToSourceTree,DefaultCacheCreateFunctorMemMgr<FormatterToSourceTree> >
1191 FormatterToSourceTreeStackType;
1196 class NodesToTransform
1199 NodesToTransform(
const NodeRefListBase* nodeList) :
1200 m_nodeList(nodeList), m_index(0)
1202 assert(m_nodeList != 0);
1205 const NodeRefListBase* operator() ()
1217 if (m_index < m_nodeList->getLength())
1219 return m_nodeList->item(m_index++);
1225 const NodeRefListBase* m_nodeList;
1229 typedef XalanVector<NodesToTransform> NodesToTransformStackType;
1231 XObjectPtrStackType m_xobjectPtrStack;
1232 MutableNodeRefListStackType m_mutableNodeRefListStack;
1233 NodesToTransformStackType m_nodesToTransformStack;
1234 BooleanStackType m_processCurrentAttributeStack;
1235 BooleanStackType m_executeIfStack;
1236 StringStackType m_stringStack;
1237 FormatterToTextStackType m_formatterToTextStack;
1238 BooleanStackType m_skipElementAttributesStack;
1239 FormatterToSourceTreeStackType m_formatterToSourceTreeStack;
1240 ParamsVectorStackType m_paramsVectorStack;
1241 ElementTemplateElementStackType m_elementInvokerStack;
1242 UseAttributeSetIndexesStackType m_useAttributeSetIndexesStack;
1244 NodeSorter m_nodeSorter;
1249 bool m_usePerInstanceDocumentFactory;
1252 eEscapeURLs m_escapeURLs;
1255 eOmitMETATag m_omitMETATag;
1257 static XalanNumberFormatFactory s_defaultXalanNumberFormatFactory;
1259 static XalanNumberFormatFactory* s_xalanNumberFormatFactory;
1261 static const DefaultCollationCompareFunctor s_defaultCollationFunctor;
1270 #endif // STYLESHEETEXECUTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
A basic implementation of the class XPathExecutionContext.
std::pair< const XPath *, ClockType > XPathCacheEntry
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Local implementation of NodeRefList.
Local implementation of MutableNodeRefList.
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
It's the responsibility of the XSLTEngineImpl class, collaborating with the XML parser liaison...
This class defines an interface for classes that resolve namespace prefixes to their URIs...
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
This is the class for events generated by the XSL processor after it generates a new node in the resu...
void setXSLTProcessor(XSLTEngineImpl *theProcessor)
Set the DOMSupport instance.
XalanVector< XalanOutputStream * > OutputStreamVectorType
Class to represent a qualified name.
XalanVector< PrintWriter * > PrintWriterVectorType
ParamsVectorTypeDecl ParamsVectorType
XalanVector< const ElemTemplateElement * > ElementTemplateElementStackType
std::pair< const key_type, data_type > value_type
void setUsePerInstanceDocumentFactory(bool fValue)
Class to hold XObjectPtr return types.
XalanVector< FormatterListener * > FormatterListenerVectorType
void setXObjectFactory(XObjectFactory *theXObjectFactory)
Set the XObjectFactory instance.
This class can sort vectors of nodes according to a select pattern.
XalanCollationServices::CollationCompareFunctor CollationCompareFunctor
VariablesStack::ParamsVectorType ParamsVectorTypeDecl
XalanVector< const ElemTemplate * > CurrentTemplateStackType
static XalanNumberFormatFactory & getDefaultXalanNumberFormatFactory()
void setDOMSupport(DOMSupport *theDOMSupport)
Set the DOMSupport instance.
#define XALAN_USES_MEMORY_MANAGER(Type)
#define XALAN_XSLT_EXPORT
collationCompare(const XalanDOMChar *theLHS, XalanDOMString::size_type theLHSLength, const XalanDOMChar *theRHS, XalanDOMString::size_type theRHSLength)
Compare the contents of two character arrays.
bool getUsePerInstanceDocumentFactory() const
This class handles the creation of XObjects and manages their lifetime.
<meta name="usage" content="internal"> This is a table of counters, keyed by ElemNumber objects...
StylesheetExecutionContextDefault::FormatNumberFunctor FormatNumberFunctor
XalanMap< XalanDOMString, XPathCacheEntry > XPathCacheMapType
This is the parent class of events generated for tracing the progress of the XSL processor.
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
void setXPathEnvSupport(XPathEnvSupport *theSupport)
Set the XPathEnvSupport instance.
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and produc...
Class to hold XPath return types.
Stylesheet::KeyTablesTableType KeyTablesTableType
XPathCacheReturnFunctor(XSLTEngineImpl &xsltProcessor)
virtual ~FormatNumberFunctor()