18 #if !defined(XALAN_XSLTENGINEIMPL_HEADER_GUARD)
19 #define XALAN_XSLTENGINEIMPL_HEADER_GUARD
43 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
81 namespace XERCES_CPP_NAMESPACE
84 class DocumentHandler;
96 using xercesc::InputSource;
97 using xercesc::DocumentHandler;
105 class StylesheetConstructionContext;
106 class StylesheetRoot;
108 class XalanSourceTreeDocument;
110 class XMLParserLiaison;
112 class XPathEnvSupport;
114 class XPathProcessor;
115 class XSLTResultTarget;
142 if (theLHS == 0 && theRHS != 0)
146 else if (theRHS == 0)
152 return theLHS->
compare(*theRHS) < 0 ?
true :
false;
173 assert(theString != 0);
175 return *theString == m_string;
207 MemoryManager& theManager,
220 return m_xpathConstructionContext.getMemoryManager();
226 return m_xpathConstructionContext.getMemoryManager();
234 initialize(MemoryManager& theManager);
247 eClassification classification,
249 const Locator* locator,
255 eClassification classification,
290 getXMLParserLiaison()
const;
306 clearStylesheetParams();
309 getFormatterListener()
const;
317 getTraceListeners()
const;
335 getTraceSelects()
const;
338 setTraceSelects(
bool b);
345 const XPath* xpath)
const;
348 setQuietConflictWarnings(
bool b);
389 DocumentHandler* docHandler,
391 ErrorHandler* theErrorHandler = 0);
406 const InputSource& inputSource,
407 DocumentHandler* docHandler,
409 ErrorHandler* theErrorHandler = 0);
424 getStylesheetFromPIURL(
448 addResultNamespaceDecl(
450 namespaceVal.
c_str(),
464 const XalanDOMChar* namespaceVal,
467 m_resultNamespacesStack.addDeclaration(
488 bool fromCopy =
false,
489 const Locator* locator = 0)
513 const XalanDOMChar* value,
514 bool fromCopy =
false,
515 const Locator* locator = 0)
541 const XalanDOMChar* value,
543 bool fromCopy =
false,
544 const Locator* locator = 0);
558 const XalanDOMChar* value,
559 bool fromCopy =
false,
560 const Locator* locator = 0)
562 assert(m_outputContextStack.empty() ==
false);
565 getPendingAttributesImpl(),
585 bool fromCopy =
false,
586 const Locator* locator = 0)
588 assert(m_outputContextStack.empty() ==
false);
591 getPendingAttributesImpl(),
604 reportDuplicateNamespaceNodeError(
606 const Locator* locator);
609 setDocumentLocator(
const Locator* locator);
619 const XalanDOMChar* name,
623 endElement(
const XalanDOMChar* name);
627 const XalanDOMChar* ch,
632 const XalanDOMChar* ch,
636 processingInstruction(
637 const XalanDOMChar* target,
638 const XalanDOMChar* data);
652 const XalanDOMChar* ch,
679 startElement(
const XalanDOMChar* name);
692 const XalanDOMChar* ch,
718 comment(
const XalanDOMChar* data);
727 entityReference(
const XalanDOMChar* data);
738 const XalanDOMChar* ch,
752 bool cloneTextNodesOnly,
753 const Locator* locator);
770 bool shouldCloneAttributes,
771 bool cloneTextNodesOnly,
772 const Locator* locator);
784 bool outputTextNodesOnly,
785 const Locator* locator);
798 bool outputTextNodesOnly,
799 const Locator* locator)
801 outputResultTreeFragment(
816 outputResultTreeFragment(
818 bool outputTextNodesOnly,
819 const Locator* locator);
827 getStylesheetRoot()
const;
854 return s_XSLNameSpaceURL;
865 return s_XalanNamespaceURL;
876 return m_quietConflictWarnings;
895 getResultPrefixForNamespace(
const XalanDOMString& theNamespace)
const;
941 returnXPath(
const XPath* xpath);
949 copyNamespaceAttributes(
const XalanNode& src);
1003 copyAttributeToTarget(
1016 return m_xpathFactory;
1027 return *m_xpathProcessor.get();
1045 return m_xpathEnvSupport;
1059 m_problemListener = l;
1073 return m_problemListener;
1084 m_outputContextStack.pushContext(theListener);
1093 m_outputContextStack.popContext();
1103 return getHasPendingStartDocumentImpl();
1113 setHasPendingStartDocumentImpl(b);
1123 return getMustFlushPendingStartDocumentImpl();
1133 setMustFlushPendingStartDocumentImpl(b);
1144 return getPendingAttributesImpl();
1155 getPendingAttributesImpl() = pendingAttributes;
1167 const XalanDOMChar* theName,
1168 const XalanDOMChar* theNewType,
1169 const XalanDOMChar* theNewValue)
1173 getPendingAttributesImpl().addAttribute(theName, theNewType, theNewValue);
1179 return !getPendingElementNameImpl().empty();
1190 return getPendingElementNameImpl();
1201 setPendingElementNameImpl(elementName);
1207 setPendingElementNameImpl(elementName);
1218 return m_stylesheetLocatorStack.empty() ==
true ? 0 : m_stylesheetLocatorStack.back();
1229 m_stylesheetLocatorStack.push_back(locator);
1238 if (m_stylesheetLocatorStack.empty() ==
false)
1240 m_stylesheetLocatorStack.pop_back();
1254 return m_outputContextStack.getPendingAttributes();
1265 return m_outputContextStack.getPendingAttributes();
1276 getPendingAttributesImpl() = pendingAttributes;
1287 return m_outputContextStack.getPendingElementName();
1298 return m_outputContextStack.getPendingElementName();
1309 m_outputContextStack.getPendingElementName() = elementName;
1320 assert(elementName != 0);
1322 m_outputContextStack.getPendingElementName() = elementName;
1332 return m_outputContextStack.getHasPendingStartDocument();
1342 m_outputContextStack.getHasPendingStartDocument() = b;
1352 return m_outputContextStack.getMustFlushPendingStartDocument();
1362 m_outputContextStack.getMustFlushPendingStartDocument() = b;
1368 return m_outputContextStack.getFormatterListener();
1374 m_outputContextStack.getFormatterListener() = flistener;
1396 copyAttributesToAttList(
1424 warnCopyTextNodesOnly(
1426 const Locator* locator);
1437 bool overrideStrip);
1444 pendingAttributesHasDefaultNS()
const;
1452 bool fOnlyIfPrefixNotPresent);
1458 bool fOnlyIfPrefixNotPresent =
false);
1464 LocatorStack m_stylesheetLocatorStack;
1499 bool m_traceSelects;
1505 bool m_quietConflictWarnings;
1516 TraceListenerVectorType m_traceListeners;
1529 const Locator& locator,
1544 XMLUInt32 m_uniqueNSValue;
1546 ParamVectorType m_topLevelParams;
1556 m_topLevelParams.
clear();
1562 generateCDATASection()
const
1564 if (m_hasCDATASectionElements ==
false)
1570 assert(m_cdataStack.
empty() ==
false);
1572 return m_cdataStack.
back();
1579 setMustFlushPendingStartDocument(
true);
1592 isCDataResultElem(
const XalanDOMString& elementName);
1595 fireCharacterGenerateEvent(
1596 const XalanNode& theNode,
1600 fireCharacterGenerateEvent(
1601 const XObjectPtr& theXObject,
1605 fireCharacterGenerateEvent(
1606 const XalanDOMString& theString,
1610 fireCharacterGenerateEvent(
1611 const XalanDOMChar* ch,
1617 checkDefaultNamespace(
1618 const XalanDOMString& theElementName,
1619 const XalanDOMString& theElementNamespaceURI);
1623 const XalanDOMString& theMessage,
1624 const Locator* theLocator,
1625 const XalanNode* theSourceNode);
1629 const XalanDOMString& theMessage,
1630 const Locator* theLocator,
1631 const XalanNode* theSourceNode);
1635 const XalanDOMString& theMessage,
1636 const Locator* theLocator,
1637 const XalanNode* theSourceNode);
1640 XMLParserLiaison& m_parserLiaison;
1642 XPathEnvSupport& m_xpathEnvSupport;
1644 DOMSupport& m_domSupport;
1649 StylesheetExecutionContext* m_executionContext;
1654 OutputContextStack m_outputContextStack;
1659 XalanNamespacesStack m_resultNamespacesStack;
1664 AttributeListImpl m_dummyAttributesList;
1666 XalanDOMString m_scratchString;
1668 XalanDOMStringPointerVectorType m_attributeNamesVisited;
1670 bool m_hasCDATASectionElements;
1672 XPathConstructionContextDefault m_xpathConstructionContext;
1674 ParamMapType m_stylesheetParams;
1677 installFunctions(MemoryManager& theManager);
1680 uninstallFunctions();
1683 static const XalanDOMString s_emptyString;
1685 static const XalanDOMString& s_stylesheetNodeName;
1686 static const XalanDOMString& s_typeString;
1687 static const XalanDOMString& s_hrefString;
1688 static const XalanDOMString& s_piTokenizerString;
1689 static const XalanDOMString& s_typeValueString1;
1690 static const XalanDOMString& s_typeValueString2;
1691 static const XalanDOMString& s_typeValueString3;
1692 static const XalanDOMString& s_typeValueString4;
1695 XSLTEngineImpl(
const XSLTEngineImpl&);
1698 operator=(
const XSLTEngineImpl&);
1710 #endif // XALAN_XSLTENGINEIMPL_HEADER_GUARD
void setPendingElementName(const XalanDOMString &elementName)
Changes the currently pending element name.
void setFormatterListenerImpl(FormatterListener *flistener)
void setMustFlushPendingStartDocument(bool b)
bool operator()(const XalanDOMString *theString) const
BoolVectorType m_cdataStack
Stack of Booleans to keep track of if we should be outputting cdata instead of escaped text...
ProblemListener * getProblemListener() const
Get the problem listener property.
void addResultAttribute(const XalanDOMString &aname, const XalanDOMString &value, bool fromCopy=false, const Locator *locator=0)
Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack...
void setPendingElementNameImpl(const XalanDOMString &elementName)
Changes the currently pending element name.
AttributeListImpl & getPendingAttributesImpl()
Get the list of attributes yet to be processed.
XalanVector< const XalanDOMString * > XalanDOMStringPointerVectorType
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
XalanDOMString m_resultNameSpaceURL
The URL that belongs to the result namespace.
XPathEnvSupport & getXPathEnvSupport()
Retrieve the XPath environment support object.
void setPendingElementName(const XalanDOMChar *elementName)
void setPendingElementNameImpl(const XalanDOMChar *elementName)
Changes the currently pending element name.
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMChar *namespaceVal, size_type len)
Add a namespace declaration to the namespace stack.
bool isElementPending() const
bool operator()(const XalanDOMString *theLHS, const XalanDOMString *theRHS) const
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMString &value, bool fromCopy=false, const Locator *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack...
The implementation of the default error handling for Xalan.
const XalanDOMString & getPendingElementName() const
Retrieve name of the pending element currently being processed.
Local implementation of NodeRefList.
MemoryManager & getMemoryManager() const
void setHasPendingStartDocument(bool b)
XalanMemMgrAutoPtr< XPathProcessor > XPathProcessorPtrType
xercesc::AttributeList AttributeListType
FormatterListener * getFormatterListenerImpl() const
void replacePendingAttribute(const XalanDOMChar *theName, const XalanDOMChar *theNewType, const XalanDOMChar *theNewValue)
Replace the contents of a pending attribute.
XPathConstructionContext::GetCachedString CCGetCachedString
XalanVector< bool > BoolVectorType
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
bool getQuietConflictWarnings() const
Whether to warn about pattern match conflicts.
const Locator * getLocatorFromStack() const
Get the locator from the top of the locator stack.
int compare(const XalanDOMString &theString) const
XalanDOMString & getPendingElementNameImpl()
Retrieve name of the pending element currently being processed.
XObjectFactory & m_xobjectFactory
void setPendingAttributesImpl(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
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...
XPathFactory & getXPathFactory()
Get the factory for making xpaths.
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Function::XObjectArgVectorType XObjectArgVectorType
FindStringPointerFunctor(const XalanDOMString &theString)
This is the class for events generated by the XSL processor after it generates a new node in the resu...
void popLocatorStack()
Pop the locator from the top of the locator stack.
This class represents the base stylesheet or an "import" stylesheet.
void pushLocatorOnStack(const Locator *locator)
Push a locator on to the locator stack.
StylesheetExecutionContext::ParamVectorType ParamVectorType
xercesc::DocumentHandler DocumentHandlerType
static const XalanDOMString & getXalanXSLNameSpaceURL()
Special Xalan namespace for built-in extensions.
XalanVector< TraceListener * > TraceListenerVectorType
void clearTopLevelParams()
Reset the vector of top level parameters.
const XalanDOMChar * c_str() const
bool getMustFlushPendingStartDocumentImpl() const
void addResultAttribute(AttributeListImpl &attList, const XalanDOMString &aname, const XalanDOMChar *value, bool fromCopy=false, const Locator *locator=0)
Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack...
XalanVector< const Locator * > LocatorStack
void addResultAttribute(const XalanDOMString &aname, const XalanDOMChar *value, bool fromCopy=false, const Locator *locator=0)
Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack...
const AttributeListImpl & getPendingAttributesImpl() const
Get the list of attributes yet to be processed.
void setMustFlushPendingStartDocumentImpl(bool b)
Class to hold XObjectPtr return types.
XPathExecutionContext::GetCachedString ECGetCachedString
XalanMap< XalanDOMString, XalanParamHolder > ParamMapType
MemoryManager & getMemoryManager()
void pushOutputContext(FormatterListener *theListener)
#define XALAN_XSLT_EXPORT
XPathFactory & m_xpathFactory
void setPendingAttributes(const AttributeListType &pendingAttributes)
Set the list of attributes yet to be processed.
This class handles the creation of XObjects and manages their lifetime.
xercesc::InputSource InputSourceType
virtual const XalanDocumentFragment & rtree() const
Cast result object to a result tree fragment.
This is an interface for an XSLT Processor engine.
void setHasPendingStartDocumentImpl(bool b)
This is the parent class of events generated for tracing the progress of the XSL processor.
const AttributeListType & getPendingAttributes() const
Get the list of attributes yet to be processed.
bool getHasPendingStartDocumentImpl() const
bool getMustFlushPendingStartDocument() const
XPathProcessor & getXPathProcessor()
Get the XPath processor object.
bool getHasPendingStartDocument() const
This is the abstract class that the XSL processor uses when it has a problem of some kind...
void outputResultTreeFragment(const XObject &theTree, bool outputTextNodesOnly, const Locator *locator)
Given a result tree fragment, walk the tree and output it to the result stream.
This acts as the stylesheet root of the stylesheet tree, and holds values that are shared by all styl...
const XalanDOMString & getPendingElementNameImpl() const
Retrieve name of the pending element currently being processed.
XalanDOMString m_resultNameSpacePrefix
The namespace that the result tree conforms to.
Class to hold XPath return types.
const XPathProcessorPtrType m_xpathProcessor
void setProblemListener(ProblemListener *l)
Set the problem listener property.
static const XalanDOMString & getXSLNameSpaceURL()
Retrieve the URI for the current XSL namespace, for example, "http://www.w3.org/1999/XSL/Transform".
void addResultNamespaceDecl(const XalanDOMString &prefix, const XalanDOMString &namespaceVal)
Add a namespace declaration to the namespace stack.