18 #if !defined(XALAN_ELEMTEMPLATEELEMENT_HEADER_GUARD)
19 #define XALAN_ELEMTEMPLATEELEMENT_HEADER_GUARD
47 #include "LocalMsgIndex.hpp"
51 namespace XERCES_CPP_NAMESPACE
67 using xercesc::AttributeList;
68 using xercesc::Locator;
70 class ElemTextLiteral;
71 class NamespacesHandler;
73 class StylesheetConstructionContext;
74 class StylesheetExecutionContext;
97 XalanFileLoc lineNumber,
98 XalanFileLoc columnNumber,
118 XalanFileLoc lineNumber = XalanLocator::getUnknownValue(),
119 XalanFileLoc columnNumber = XalanLocator::getUnknownValue());
129 virtual const Locator*
144 const XalanDOMChar* attrName,
161 const XalanDOMChar* elementName,
162 const XalanDOMChar* aname,
177 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
277 childrenToResultAttribute(
375 const Locator* locator = 0);
393 return m_namespacesHandler;
415 setFlag(eFinishedConstruction, fValue);
424 return getFlag(eFinishedConstruction);
445 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
519 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
641 XalanFileLoc theLineNumber,
642 XalanFileLoc theColumnNumber,
678 const XalanFileLoc m_lineNumber;
680 const XalanFileLoc m_columnNumber;
689 return m_locatorProxy.getLineNumber();
695 return m_locatorProxy.getColumnNumber();
701 return getFlag(eHasParams);
707 return getFlag(eHasVariables);
713 return getFlag(eHasSingleTextChild);
719 return m_firstChild != 0 ? true :
false;
725 return getFlag(eHasDirectTemplate);
731 return getFlag(eCanGenerateAttributes);
737 return getFlag(eDefaultTemplate);
745 setFlag(eCanGenerateAttributes, value);
751 setFlag(eHasPrefix, value);
757 return getFlag(eHasPrefix);
763 setFlag(eSpacePreserve, value);
769 return getFlag(eSpacePreserve);
775 setFlag(eDisableOutputEscaping, value);
781 return getFlag(eDisableOutputEscaping);
798 const XalanDOMChar* attrValue);
810 #if !defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
912 return m_namespacesHandler;
926 XalanMessages::Codes theCode)
const;
940 XalanMessages::Codes theCode,
955 XalanMessages::Codes theCode,
956 const Locator* theLocator)
const;
969 XalanMessages::Codes theCode)
const;
983 XalanMessages::Codes theCode,
998 XalanMessages::Codes theCode,
999 const Locator* theLocator)
const;
1012 XalanMessages::Codes theCode);
1027 XalanMessages::Codes theCode,
1043 XalanMessages::Codes theCode,
1045 const Locator* theLocator);
1060 XalanMessages::Codes theCode,
1077 XalanMessages::Codes theCode,
1078 const XalanDOMChar* theToken1,
1079 const XalanDOMChar* theToken2);
1095 XalanMessages::Codes theCode,
1096 const XalanDOMChar* theToken1,
1097 const XalanDOMChar* theToken2,
1098 const XalanDOMChar* theToken3);
1114 XalanMessages::Codes theCode,
1115 const XalanDOMChar* theToken1,
1116 const XalanDOMChar* theToken2,
1117 const XalanDOMChar* theToken3);
1128 eHasSingleTextChild = 2,
1130 eHasDirectTemplate = 8,
1131 eCanGenerateAttributes = 16,
1132 eDefaultTemplate = 32,
1133 eSpacePreserve = 64,
1134 eFinishedConstruction = 128,
1136 eDisableOutputEscaping = 512
1140 getFlag(eFlags theFlag)
const
1142 return m_flags & theFlag ? true :
false;
1150 if (theValue ==
true)
1156 m_flags &= ~theFlag;
1161 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
1172 StylesheetExecutionContext& executionContext,
1173 XalanDOMString& result)
const;
1176 Stylesheet& m_stylesheet;
1181 NamespacesHandler m_namespacesHandler;
1183 const int m_xslToken;
1185 ElemTemplateElement* m_parentNode;
1186 ElemTemplateElement* m_nextSibling;
1187 ElemTemplateElement* m_previousSibling;
1196 LocatorProxy m_locatorProxy;
1198 unsigned short m_flags;
#define XALAN_XSLT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
virtual const XMLCh * getSystemId() const
virtual XalanFileLoc getLineNumber() const
const XalanDOMString & getURI() const
LocatorProxy(XalanFileLoc theLineNumber, XalanFileLoc theColumnNumber, const XalanDOMString &theURI)
virtual XalanFileLoc getColumnNumber() const
virtual const XMLCh * getPublicId() const
ElemTemplateElement(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, int xslToken, const XalanDOMString &baseURI=XalanDOMString(XalanMemMgrs::getDummyMemMgr()), XalanFileLoc lineNumber=XalanLocator::getUnknownValue(), XalanFileLoc columnNumber=XalanLocator::getUnknownValue())
Special constructor used by dummy elements which do not exist in the final stylesheet.
void hasPrefix(bool value)
void setFinishedConstruction(bool fValue)
Set the flag indicating construction of the element is completed.
bool hasDirectTemplate() const
ElemTemplateElement(StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, XalanFileLoc lineNumber, XalanFileLoc columnNumber, int xslToken)
Construct a template element instance.
virtual void processSortElement(StylesheetConstructionContext &constructionContext, Stylesheet &theStylesheet, const AttributeListType &atts, const Locator *locator=0)
Called during compilation to process xsl:sort elements in the stylesheet.
virtual const XalanQName & getNameAttribute() const
Get the QName associated with any name attribute of this element.
virtual const ElemTemplateElement * getFirstChildElemToExecute(StylesheetExecutionContext &executionContext) const
Returns the first sub-element (i.e.
virtual ElemTemplateElement * getParentNodeElem() const
Get the parent node.
virtual const ElemTemplateElement * findTemplateToTransformChild(StylesheetExecutionContext &executionContext, const ElemTemplateElement &xslInstruction, const ElemTemplateElement *theTemplate, XalanNode *child) const
Given an element, find the corresponding template.
void error(StylesheetExecutionContext &theContext, XalanMessages::Codes theCode) const
A convenience function for loading a message and reporting an error through the provided StylesheetEx...
void error(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMString &theToken, const Locator *theLocator)
A convenience function for loading a message and reporting an error through the provided StylesheetCo...
const NamespacesHandler & getNamespacesHandler() const
Get the namespaces handler for this element.
static const XalanDOMString s_emptyString
const ElemTemplateElement * beginChildrenToString(StylesheetExecutionContext &executionContext, XalanDOMString &result) const
Method to initiate output from the children to a string.
bool processSpaceAttr(const XalanDOMChar *elementName, const XalanDOMChar *aname, const AttributeListType &atts, XalanSize_t which, StylesheetConstructionContext &constructionContext)
Tell whether or not this is a xml:space attribute and, if so, process it.
virtual void setDefaultTemplate(bool value)
Sets a flag indicating this is the default template.
static bool isValidNCName(const XalanDOMString &s)
Validate that the string is an NCName.
const ElemTemplate * m_directTemplate
const XalanDOMString * getNamespaceForPrefixInternal(const XalanDOMString &prefix) const
Get the namespace for a given prefix.
virtual void endExecuteChildren(StylesheetExecutionContext &executionContext) const
Method to indicate the execution of the element's children is complete.
virtual void setParentNodeElem(ElemTemplateElement *theParent)
Set the parent node.
XalanFileLoc getLineNumber() const
void warn(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMChar *theToken1, const XalanDOMChar *theToken2, const XalanDOMChar *theToken3)
A convenience function for loading a message and reporting a warning through the provided StylesheetC...
bool hasSingleTextChild() const
bool preserveSpace() const
bool canGenerateAttributes() const
void error(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMString &theToken)
A convenience function for loading a message and reporting an error through the provided StylesheetCo...
void error(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMChar *theToken1, const XalanDOMChar *theToken2)
A convenience function for loading a message and reporting an error through the provided StylesheetCo...
virtual void namespacesPostConstruction(StylesheetConstructionContext &constructionContext, const NamespacesHandler &theParentHandler, NamespacesHandler &theHandler)
Called after construction is completed.
virtual ElemTemplateElement * appendChildElem(ElemTemplateElement *newChild)
Append a child.
virtual const ElemTemplateElement * beginExecuteChildren(StylesheetExecutionContext &executionContext) const
Method to initiate the execution of the element's children.
void canGenerateAttributes(bool value)
virtual ElemTemplateElement * getFirstChildElem() const
Get the first child.
virtual bool isWhitespace() const
Tell if the element will generate text which is XML whitespace.
virtual const XalanDOMString * getNamespaceForPrefix(const XalanDOMString &prefix) const
Retrieve a namespace corresponding to a prefix.
void warn(StylesheetExecutionContext &theContext, XalanMessages::Codes theCode, const Locator *theLocator) const
A convenience function for loading a message and reporting a warning through the provided StylesheetE...
void error(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMString &theToken1, const XalanDOMString &theToken2)
A convenience function for loading a message and reporting an error through the provided StylesheetCo...
void error(StylesheetExecutionContext &theContext, XalanMessages::Codes theCode, const XalanDOMString &theToken) const
A convenience function for loading a message and reporting an error through the provided StylesheetEx...
virtual void endElement(StylesheetExecutionContext &executionContext) const
Completes "post-processing" afer any sub-elements are invoked (i.e.
void error(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode)
A convenience function for loading a message and reporting an error through the provided StylesheetCo...
virtual const XalanDOMString & getURI() const
Retrieve the base URI for the resolver.
void endChildrenToString(StylesheetExecutionContext &executionContext) const
Method to indicate string output from the children is complete.
virtual void setFirstChildElem(ElemTemplateElement *theChild)
Set the first child.
bool hasVariables() const
virtual const XPath * getXPath(XalanSize_t index) const
Get XPath pattern/expression of one of the element atribute.
virtual const Locator * getLocator() const
Get the Locator for the node.
void warn(StylesheetExecutionContext &theContext, XalanMessages::Codes theCode, const XalanDOMString &theToken) const
A convenience function for loading a message and reporting a warning through the provided StylesheetE...
void error(StylesheetExecutionContext &theContext, XalanMessages::Codes theCode, const Locator *theLocator) const
A convenience function for loading a message and reporting an error through the provided StylesheetEx...
bool isDefaultTemplate() const
virtual ElemTemplateElement * getNextSiblingElem() const
Get the next sibling.
virtual bool isAttrOK(const XalanDOMChar *attrName, const AttributeListType &atts, XalanSize_t which, StylesheetConstructionContext &constructionContext) const
See if this is a xmlns attribute or in a non-XSLT.
virtual void setNextSiblingElem(ElemTemplateElement *theSibling)
Set the next sibling.
virtual bool executeChildElement(StylesheetExecutionContext &executionContext, const ElemTemplateElement *element) const
Filters sub-elements that should be executed.
const ElemTextLiteral * m_textLiteralChild
virtual const ElemTemplateElement * findTemplateToTransformChild(StylesheetExecutionContext &executionContext, const ElemTemplateElement &xslInstruction, const ElemTemplateElement *theTemplate, XalanNode *child, XalanNode::NodeType nodeType) const
Given an element, find the corresponding template.
virtual void execute(StylesheetExecutionContext &executionContext) const
Execute the element.
virtual ElemTemplateElement * getLastChildElem() const
Get the last child.
ElemTemplateElement * m_firstChild
virtual const ElemTemplateElement * startElement(StylesheetExecutionContext &executionContext) const
Completes "pre-processing" before any sub-elements are invoked (i.e.
virtual void executeChildren(StylesheetExecutionContext &executionContext) const
Execute the children of this element.
bool processPrefixControl(StylesheetConstructionContext &constructionContext, const Stylesheet &stylesheetTree, const XalanDOMString &localName, const XalanDOMChar *attrValue)
Process the exclude-result-prefixes or the extension-element-prefixes attributes, for the purpose of ...
virtual bool childTypeAllowed(int xslToken) const
Given an xsl token type, determine whether or not a child of that type is allowed.
XalanFileLoc getColumnNumber() const
const NamespacesHandler & getNamespaces() const
void error(StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMChar *theToken1, const XalanDOMChar *theToken2, const XalanDOMChar *theToken3)
A convenience function for loading a message and reporting an error through the provided StylesheetCo...
virtual const ElemTemplateElement * getInvoker(StylesheetExecutionContext &executionContext) const
Returns the element that invoked this element.
void warn(StylesheetExecutionContext &theContext, XalanMessages::Codes theCode) const
A convenience function for loading a message and reporting a warning through the provided StylesheetE...
virtual void addToStylesheet(StylesheetConstructionContext &constructionContext, Stylesheet &theStylesheet)
Called during compilation when an instance is not parented by another element, and thus,...
void preserveSpace(bool value)
virtual ~ElemTemplateElement()
virtual ElemTemplateElement * getPreviousSiblingElem() const
Get the previous sibling.
virtual void postConstruction(StylesheetConstructionContext &constructionContext, const NamespacesHandler &theParentHandler)
Called after construction is completed.
const Stylesheet & getStylesheet() const
Retrieve the stylesheet from which this element comes.
bool getFinishedConstruction() const
Get the flag indicating construction of the element is completed.
bool disableOutputEscaping() const
virtual const XalanDOMString & getElementName() const =0
Get a string for the name of the element.
void disableOutputEscaping(bool value)
virtual void setPreviousSiblingElem(ElemTemplateElement *theSibling)
Set the previous sibling.
virtual const ElemTemplateElement * getNextChildElemToExecute(StylesheetExecutionContext &executionContext, const ElemTemplateElement *currentElem) const
Returns the next sub-element (i.e.
This class defines an interface for classes that resolve namespace prefixes to their URIs.
This class represents the base stylesheet or an "import" stylesheet.
This class defines a base class for Locator derivations in Xalan.
Class to represent a qualified name.
xercesc::Locator LocatorType
xercesc::AttributeList AttributeListType
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)