## Xalan-C++ API Documentation

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

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

# ElemForEach Class Reference

`#include <ElemForEach.hpp>`

Inheritance diagram for ElemForEach

Collaboration diagram for ElemForEach:

List of all members.

## Public Types

- typedef std::vector<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.
- virtual void execute (StylesheetExecutionContext& executionContext) const
    Execute the element's primary function. More...

## Protected Methods

- ElemForEach ( StylesheetConstructionContext& constructionContext, Stylesheet& stylesheetTree, int lineNumber, int columnNumber, int xslToken)
    Construct an object derived from ElemForEach. More...
- void transformSelectedChildren ( StylesheetExecutionContext& executionContext, const ElemTemplateElement* theTemplate) const
    Perform a query if needed, and call transformChild for each child. More...
- void transformSelectedChildren ( StylesheetExecutionContext& executionContext, const ElemTemplateElement* theTemplate, const NodeRefListBase& sourceNodes, NodeRefListBase::size_type sourceNodesCount) const
    Perform a query if needed, and call transformChild for each child. More...
- virtual void selectAndSortChildren ( StylesheetExecutionContext& executionContext, const ElemTemplateElement* theTemplate, NodeSorter* sorter, int selectStackFrameIndex) const
    Perform a query if needed, and call transformChild for each child. More...

## Protected Attributes

- const XPath* m_selectPattern

## Member Typedef Documentation

typedef std::vector<ElemSort*> ElemForEach::SortElemsVectorType

## 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

virtual 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

virtual void ElemForEach::execute ( | StylesheetExecutionContext & executionContext ) const`[virtual]`

Execute the element's primary function.

Subclasses of this function may recursively execute down the element tree.

Parameters:

  executionContext | The current execution context

Reimplemented from ElemTemplateElement.

Reimplemented in ElemApplyTemplates.

virtual 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.

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

Called after construction is completed.

Reimplemented from ElemTemplateElement.

virtual 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::selectAndSortChildren ( | StylesheetExecutionContext & executionContext,
| const ElemTemplateElement * theTemplate,
| NodeSorter * sorter,
| int selectStackFrameIndex ) const`[protected, virtual]`

Perform a query if needed, and call transformChild for each child.

Parameters:

  executionContext | The current execution context
  template | The owning template context.
  sorter | The NodeSorter instance, if any.
  selectStackFrameIndex | stack frame context for executing the select statement

Reimplemented in ElemApplyTemplates.

void ElemForEach::transformSelectedChildren ( | StylesheetExecutionContext & executionContext,
| const ElemTemplateElement * theTemplate,
| const NodeRefListBase & sourceNodes,
| NodeRefListBase::size_type sourceNodesCount ) const`[protected]`

Perform a query if needed, and call transformChild for each child.

Parameters:

  executionContext | The current execution context
  theTemplate | The owning template context.
  sourceNodes | The source nodes to transform.
  sourceNodesCount | The count of source nodes to transform.

void ElemForEach::transformSelectedChildren ( | StylesheetExecutionContext & executionContext,
| const ElemTemplateElement * theTemplate ) const`[protected]`

Perform a query if needed, and call transformChild for each child.

Parameters:

  executionContext | The current execution context
  template | The owning template context.
  sourceNodeContext | The current source node context.

## 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.6 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.