## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.10

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# ElemForEach Class Reference

`#include <ElemForEach.hpp>`

Inheritance diagram for ElemForEach:

[legend]
Collaboration diagram for ElemForEach:

[legend]
List of all members.

## Public Types

- typedef XalanVector<ElemSort*> SortElemsVectorType

## Public Methods

- ElemForEach (StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, const AttributeListType &atts, int lineNumber, int columnNumber)
    Construct an object corresponding to an "xsl:for-each" element. More...
- virtual ~ElemForEach ()
- virtual const XalanDOMString& getElementName () const
    Get a string for the name of the element. More...
- virtual void processSortElement (StylesheetConstructionContext &constructionContext, Stylesheet &theStylesheet, const AttributeListType &atts, const LocatorType *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 ElemTemplateElement* startElement (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 ElemTemplateElement* getNextChildElemToExecute (StylesheetExecutionContext &executionContext, const ElemTemplateElement *currentElem) const
    Returns the next sub-element (i.e. More...
- virtual const XPath* getXPath (unsigned int index=0) const
    Get XPath pattern/expression of one of the element atribute. More...

## Protected Methods

- ElemForEach (StylesheetConstructionContext &constructionContext, Stylesheet &stylesheetTree, int lineNumber, int columnNumber, int xslToken)
    Construct an object derived from ElemForEach. More...
- virtual const NodeRefListBase* createSelectedAndSortedNodeList (StylesheetExecutionContext &executionContext) const
- virtual void releaseSelectedAndSortedNodeList (StylesheetExecutionContext &executionContext) const
- virtual const NodeRefListBase* sortChildren (StylesheetExecutionContext &executionContext, const NodeRefListBase &selectedNodeList, MutableNodeRefList &sortedNodeList) const

## Protected Attributes

- const XPath* m_selectPattern

## Member Typedef Documentation

typedef XalanVector< ElemSort *> ElemForEach::SortElemsVectorType<ElemSort*>

## Constructor & Destructor Documentation

ElemForEach::ElemForEach ( | StylesheetConstructionContext & constructionContext,
| Stylesheet & stylesheetTree,
| const AttributeListType & atts,
| int lineNumber,
| int columnNumber )

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

Parameters:

  constructionContext | context for construction of object
  stylesheetTree | stylesheet containing element
  atts | list of attributes for element
  lineNumber | line number in document
  columnNumber | column number in document

ElemForEach::~ElemForEach ( | )`[virtual]`

ElemForEach::ElemForEach ( | StylesheetConstructionContext & constructionContext,
| Stylesheet & stylesheetTree,
| int lineNumber,
| int columnNumber,
| int xslToken )`[protected]`

Construct an object derived from ElemForEach.

Parameters:

  constructionContext | context for construction of object
  stylesheetTree | stylesheet containing element
  lineNumber | line number in document
  columnNumber | column number in document
  xslToken | an integer representing the type of instance.

## Member Function Documentation

const NodeRefListBase * ElemForEach::createSelectedAndSortedNodeList ( | StylesheetExecutionContext & executionContext ) const`[protected, virtual]`

void 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:

  executionContext | context to execute this element

Reimplemented from ElemTemplateElement.

Reimplemented in ElemApplyTemplates.

const XalanDOMString & 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.

Reimplemented from ElemTemplateElement.

Reimplemented in ElemApplyTemplates.

const ElemTemplateElement * ElemForEach::getNextChildElemToExecute ( | StylesheetExecutionContext & executionContext,
| const ElemTemplateElement * currentElem ) const`[virtual]`

Returns the next sub-element (i.e.

children, attribute-sets, templates) to execute.

Parameters:

  executionContext | context to execute element
  currentElem | the last sub-element to be executed

Returns:
  next sub-element to execute, 0 only if no more sub-elements to execute

Reimplemented from ElemTemplateElement.

Reimplemented in ElemApplyTemplates.

const XPath * ElemForEach::getXPath ( | unsigned int index = 0 ) 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 ElemTemplateElement.

void ElemForEach::postConstruction ( | StylesheetConstructionContext & constructionContext,
| const NamespacesHandler & theParentHandler )`[virtual]`

| Called after construction is completed. Reimplemented from ElemTemplateElement.

void ElemForEach::processSortElement ( | StylesheetConstructionContext & constructionContext,
| Stylesheet & theStylesheet,
| const AttributeListType & atts,
| const LocatorType * locator = 0 )`[virtual]`

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

Parameters:

  constructionContext | The current construction context
  theStylesheet | The owning stylesheet
  atts | The list of attributes for the sort element
  locator | A Locator instance for error reporting, if available.

Returns:
  nothing

Reimplemented from ElemTemplateElement.

void ElemForEach::releaseSelectedAndSortedNodeList ( | StylesheetExecutionContext & executionContext ) const`[protected, virtual]`

const NodeRefListBase * ElemForEach::sortChildren ( | StylesheetExecutionContext & executionContext,
| const NodeRefListBase & selectedNodeList,
| MutableNodeRefList & sortedNodeList ) const`[protected, virtual]`

const ElemTemplateElement * 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:

  executionContext | context to execute this element

Reimplemented from ElemTemplateElement.

Reimplemented in ElemApplyTemplates.

## Member Data Documentation

const XPath * ElemForEach::m_selectPattern`[protected]`

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

- ElemForEach.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.10 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.