Xalan-C++ API Reference  1.12.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
xalanc::ElemForEach Class Reference

#include <xalanc/XSLT/ElemForEach.hpp>

Inheritance diagram for xalanc::ElemForEach:
[legend]
Collaboration diagram for xalanc::ElemForEach:
[legend]

Public Types

typedef XalanVector< ElemSort * > SortElemsVectorType
 

Public Member Functions

 ElemForEach (StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts, XalanFileLoc lineNumber, XalanFileLoc columnNumber)
 Construct an object corresponding to an "xsl:for-each" element. More...
 
virtual ~ElemForEach ()
 
virtual const XalanDOMStringgetElementName () const
 Get a string for the name of the element. More...
 
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. More...
 
virtual void postConstruction (StylesheetConstructionContext &constructionContext, const NamespacesHandler &theParentHandler)
 Called after construction is completed. More...
 
virtual const ElemTemplateElementstartElement (StylesheetExecutionContext &executionContext) const
 Completes "pre-processing" before any sub-elements are invoked (i.e. More...
 
virtual void endElement (StylesheetExecutionContext &executionContext) const
 Completes "post-processing" afer any sub-elements are invoked (i.e. More...
 
virtual const ElemTemplateElementgetNextChildElemToExecute (StylesheetExecutionContext &executionContext, const ElemTemplateElement *currentElem) const
 Returns the next sub-element (i.e. More...
 
virtual const XPathgetXPath (XalanSize_t index) const
 Get XPath pattern/expression of one of the element atribute. More...
 
- Public Member Functions inherited from xalanc::ElemTemplateElement
 ElemTemplateElement (StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, XalanFileLoc lineNumber, XalanFileLoc columnNumber, int xslToken)
 Construct a template element instance. More...
 
 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. More...
 
virtual ~ElemTemplateElement ()
 
virtual const Locator * getLocator () const
 Get the Locator for the node. More...
 
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. More...
 
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. More...
 
virtual void execute (StylesheetExecutionContext &executionContext) const
 Execute the element. More...
 
virtual void executeChildren (StylesheetExecutionContext &executionContext) const
 Execute the children of this element. More...
 
virtual const ElemTemplateElementgetInvoker (StylesheetExecutionContext &executionContext) const
 Returns the element that invoked this element. More...
 
int getXSLToken () const
 
virtual bool isWhitespace () const
 Tell if the element will generate text which is XML whitespace. More...
 
virtual const XalanQNamegetNameAttribute () const
 Get the QName associated with any name attribute of this element. More...
 
virtual void addToStylesheet (StylesheetConstructionContext &constructionContext, Stylesheet &theStylesheet)
 Called during compilation when an instance is not parented by another element, and thus, is a child of the stylesheet. More...
 
virtual void setDefaultTemplate (bool value)
 Sets a flag indicating this is the default template. More...
 
const NamespacesHandlergetNamespacesHandler () const
 Get the namespaces handler for this element. More...
 
const StylesheetgetStylesheet () const
 Retrieve the stylesheet from which this element comes. More...
 
void setFinishedConstruction (bool fValue)
 Set the flag indicating construction of the element is completed. More...
 
bool getFinishedConstruction () const
 Get the flag indicating construction of the element is completed. More...
 
virtual ElemTemplateElementgetFirstChildElem () const
 Get the first child. More...
 
virtual const ElemTemplateElementbeginExecuteChildren (StylesheetExecutionContext &executionContext) const
 Method to initiate the execution of the element's children. More...
 
virtual void endExecuteChildren (StylesheetExecutionContext &executionContext) const
 Method to indicate the execution of the element's children is complete. More...
 
const ElemTemplateElementbeginChildrenToString (StylesheetExecutionContext &executionContext, XalanDOMString &result) const
 Method to initiate output from the children to a string. More...
 
void endChildrenToString (StylesheetExecutionContext &executionContext) const
 Method to indicate string output from the children is complete. More...
 
virtual void setFirstChildElem (ElemTemplateElement *theChild)
 Set the first child. More...
 
virtual ElemTemplateElementgetLastChildElem () const
 Get the last child. More...
 
virtual ElemTemplateElementgetNextSiblingElem () const
 Get the next sibling. More...
 
virtual const ElemTemplateElementgetFirstChildElemToExecute (StylesheetExecutionContext &executionContext) const
 Returns the first sub-element (i.e. More...
 
virtual bool executeChildElement (StylesheetExecutionContext &executionContext, const ElemTemplateElement *element) const
 Filters sub-elements that should be executed. More...
 
virtual void setNextSiblingElem (ElemTemplateElement *theSibling)
 Set the next sibling. More...
 
virtual ElemTemplateElementgetPreviousSiblingElem () const
 Get the previous sibling. More...
 
virtual void setPreviousSiblingElem (ElemTemplateElement *theSibling)
 Set the previous sibling. More...
 
virtual ElemTemplateElementgetParentNodeElem () const
 Get the parent node. More...
 
virtual void setParentNodeElem (ElemTemplateElement *theParent)
 Set the parent node. More...
 
virtual ElemTemplateElementappendChildElem (ElemTemplateElement *newChild)
 Append a child. More...
 
virtual const XalanDOMStringgetNamespaceForPrefix (const XalanDOMString &prefix) const
 Retrieve a namespace corresponding to a prefix. More...
 
virtual const XalanDOMStringgetURI () const
 Retrieve the base URI for the resolver. More...
 
XalanFileLoc getLineNumber () const
 
XalanFileLoc getColumnNumber () const
 
bool hasParams () const
 
bool hasVariables () const
 
bool hasSingleTextChild () const
 
bool hasChildren () const
 
bool hasDirectTemplate () const
 
bool canGenerateAttributes () const
 
bool isDefaultTemplate () const
 
- Public Member Functions inherited from xalanc::PrefixResolver
 PrefixResolver ()
 
 PrefixResolver (const PrefixResolver &)
 
virtual ~PrefixResolver ()
 

Protected Member Functions

 ElemForEach (StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, XalanFileLoc lineNumber, XalanFileLoc columnNumber, int xslToken)
 Construct an object derived from ElemForEach. More...
 
virtual const NodeRefListBasecreateSelectedAndSortedNodeList (StylesheetExecutionContext &executionContext) const
 
virtual void releaseSelectedAndSortedNodeList (StylesheetExecutionContext &executionContext) const
 
virtual const NodeRefListBasesortChildren (StylesheetExecutionContext &executionContext, const NodeRefListBase &selectedNodeList, MutableNodeRefList &sortedNodeList) const
 
- Protected Member Functions inherited from xalanc::ElemTemplateElement
void canGenerateAttributes (bool value)
 
void hasPrefix (bool value)
 
bool hasPrefix () const
 
void preserveSpace (bool value)
 
bool preserveSpace () const
 
void disableOutputEscaping (bool value)
 
bool disableOutputEscaping () const
 
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 prefix exclusion. More...
 
const XalanDOMStringgetNamespaceForPrefixInternal (const XalanDOMString &prefix) const
 Get the namespace for a given prefix. More...
 
virtual const ElemTemplateElementfindTemplateToTransformChild (StylesheetExecutionContext &executionContext, const ElemTemplateElement &xslInstruction, const ElemTemplateElement *theTemplate, XalanNode *child) const
 Given an element, find the corresponding template. More...
 
virtual const ElemTemplateElementfindTemplateToTransformChild (StylesheetExecutionContext &executionContext, const ElemTemplateElement &xslInstruction, const ElemTemplateElement *theTemplate, XalanNode *child, XalanNode::NodeType nodeType) const
 Given an element, find the corresponding template. More...
 
virtual bool childTypeAllowed (int xslToken) const
 Given an xsl token type, determine whether or not a child of that type is allowed. More...
 
virtual void namespacesPostConstruction (StylesheetConstructionContext &constructionContext, const NamespacesHandler &theParentHandler, NamespacesHandler &theHandler)
 Called after construction is completed. More...
 
const NamespacesHandlergetNamespaces () const
 
void error (StylesheetExecutionContext &theContext, XalanMessages::Codes theCode) const
 A convenience function for loading a message and reporting an error through the provided StylesheetExecutionContext instance. More...
 
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 StylesheetExecutionContext instance. More...
 
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 StylesheetExecutionContext instance. More...
 
void warn (StylesheetExecutionContext &theContext, XalanMessages::Codes theCode) const
 A convenience function for loading a message and reporting a warning through the provided StylesheetExecutionContext instance. More...
 
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 StylesheetExecutionContext instance. More...
 
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 StylesheetExecutionContext instance. More...
 
void error (StylesheetConstructionContext &theContext, XalanMessages::Codes theCode)
 A convenience function for loading a message and reporting an error through the provided StylesheetConstructionContext instance. More...
 
void error (StylesheetConstructionContext &theContext, XalanMessages::Codes theCode, const XalanDOMString &theToken)
 A convenience function for loading a message and reporting an error through the provided StylesheetConstructionContext instance. More...
 
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 StylesheetConstructionContext instance. More...
 
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 StylesheetConstructionContext instance. More...
 
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 StylesheetConstructionContext instance. More...
 
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 StylesheetConstructionContext instance. More...
 
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 StylesheetConstructionContext instance. More...
 

Protected Attributes

const XPathm_selectPattern
 

Additional Inherited Members

- Static Public Member Functions inherited from xalanc::ElemTemplateElement
static bool isValidNCName (const XalanDOMString &s)
 Validate that the string is an NCName. More...
 
- Static Protected Attributes inherited from xalanc::ElemTemplateElement
static const XalanDOMString s_emptyString
 

Detailed Description

Definition at line 58 of file ElemForEach.hpp.

Member Typedef Documentation

◆ SortElemsVectorType

Definition at line 81 of file ElemForEach.hpp.

Constructor & Destructor Documentation

◆ ElemForEach() [1/2]

xalanc::ElemForEach::ElemForEach ( StylesheetConstructionContext constructionContext,
Stylesheet stylesheetTree,
const AttributeListType atts,
XalanFileLoc  lineNumber,
XalanFileLoc  columnNumber 
)

Construct an object corresponding to an "xsl:for-each" element.

Parameters
constructionContextcontext for construction of object
stylesheetTreestylesheet containing element
attslist of attributes for element
lineNumberline number in document
columnNumbercolumn number in document

◆ ~ElemForEach()

virtual xalanc::ElemForEach::~ElemForEach ( )
virtual

◆ ElemForEach() [2/2]

xalanc::ElemForEach::ElemForEach ( StylesheetConstructionContext constructionContext,
Stylesheet stylesheetTree,
XalanFileLoc  lineNumber,
XalanFileLoc  columnNumber,
int  xslToken 
)
protected

Construct an object derived from ElemForEach.

Parameters
constructionContextcontext for construction of object
stylesheetTreestylesheet containing element
lineNumberline number in document
columnNumbercolumn number in document
xslTokenan integer representing the type of instance.

Member Function Documentation

◆ createSelectedAndSortedNodeList()

virtual const NodeRefListBase* xalanc::ElemForEach::createSelectedAndSortedNodeList ( StylesheetExecutionContext executionContext) const
protectedvirtual

◆ endElement()

virtual void xalanc::ElemForEach::endElement ( StylesheetExecutionContext executionContext) const
virtual

Completes "post-processing" afer any sub-elements are invoked (i.e.

children, attribute sets and templates). If there are no sub-elements it does nothing

Parameters
executionContextcontext to execute this element

Reimplemented from xalanc::ElemTemplateElement.

Reimplemented in xalanc::ElemApplyTemplates.

◆ getElementName()

virtual const XalanDOMString& xalanc::ElemForEach::getElementName ( ) const
virtual

Get a string for the name of the element.

Useful for debugging purposes, and error reporting.

Returns
A string containing the name of the element.

Implements xalanc::ElemTemplateElement.

Reimplemented in xalanc::ElemApplyTemplates.

◆ getNextChildElemToExecute()

virtual const ElemTemplateElement* xalanc::ElemForEach::getNextChildElemToExecute ( StylesheetExecutionContext executionContext,
const ElemTemplateElement currentElem 
) const
virtual

Returns the next sub-element (i.e.

children, attribute-sets, templates) to execute.

Parameters
executionContextcontext to execute element
currentElemthe last sub-element to be executed
Returns
next sub-element to execute, 0 only if no more sub-elements to execute

Reimplemented from xalanc::ElemTemplateElement.

Reimplemented in xalanc::ElemApplyTemplates.

◆ getXPath()

virtual const XPath* xalanc::ElemForEach::getXPath ( XalanSize_t  index) const
virtual

Get XPath pattern/expression of one of the element atribute.

@index number of the attribute. If an attribute has more then one attribute with pattern/expression,the order of the returned expressions are undefined

Returns
pointer or null

Reimplemented from xalanc::ElemTemplateElement.

◆ postConstruction()

virtual void xalanc::ElemForEach::postConstruction ( StylesheetConstructionContext constructionContext,
const NamespacesHandler theParentHandler 
)
virtual

Called after construction is completed.

Reimplemented from xalanc::ElemTemplateElement.

◆ processSortElement()

virtual void xalanc::ElemForEach::processSortElement ( StylesheetConstructionContext constructionContext,
Stylesheet theStylesheet,
const AttributeListType atts,
const Locator *  locator = 0 
)
virtual

Called during compilation to process xsl:sort elements in the stylesheet.

Parameters
constructionContextThe current construction context
theStylesheetThe owning stylesheet
attsThe list of attributes for the sort element
locatorA Locator instance for error reporting, if available.
Returns
nothing

Reimplemented from xalanc::ElemTemplateElement.

◆ releaseSelectedAndSortedNodeList()

virtual void xalanc::ElemForEach::releaseSelectedAndSortedNodeList ( StylesheetExecutionContext executionContext) const
protectedvirtual

◆ sortChildren()

virtual const NodeRefListBase* xalanc::ElemForEach::sortChildren ( StylesheetExecutionContext executionContext,
const NodeRefListBase selectedNodeList,
MutableNodeRefList sortedNodeList 
) const
protectedvirtual

◆ startElement()

virtual const ElemTemplateElement* xalanc::ElemForEach::startElement ( StylesheetExecutionContext executionContext) const
virtual

Completes "pre-processing" before any sub-elements are invoked (i.e.

children, attribute sets and templates). If there are no sub-elements it executes the primary function of the element.

Parameters
executionContextcontext to execute this element

Reimplemented from xalanc::ElemTemplateElement.

Reimplemented in xalanc::ElemApplyTemplates.

Member Data Documentation

◆ m_selectPattern

const XPath* xalanc::ElemForEach::m_selectPattern
protected

Definition at line 220 of file ElemForEach.hpp.


The documentation for this class was generated from the following file: