org.apache.xalan.templates

Class ElemForEach

public class ElemForEach extends ElemTemplateElement implements ExpressionOwner

Implement xsl:for-each.
 

 
 

See Also: for-each in XSLT Specification

UNKNOWN: advanced

Field Summary
booleanm_doc_cache_off
This is set by an "xalan-doc-cache-off" pi, or the old "xalan:doc-cache-off" pi.
Constructor Summary
ElemForEach()
Construct a element representing xsl:for-each.
Method Summary
ElemTemplateElementappendChild(ElemTemplateElement newChild)
Add a child to the child list.
voidcallChildVisitors(XSLTVisitor visitor, boolean callAttributes)
Call the children visitors.
voidcompose(StylesheetRoot sroot)
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.
voidendCompose(StylesheetRoot sroot)
This after the template's children have been composed.
voidexecute(TransformerImpl transformer)
Execute the xsl:for-each transformation
ExpressiongetExpression()
StringgetNodeName()
Return the node name.
ExpressiongetSelect()
Get the "select" attribute.
ElemSortgetSortElem(int i)
Get a xsl:sort element associated with this element.
intgetSortElemCount()
Get the count xsl:sort elements associated with this element.
intgetXSLToken()
Get an int constant identifying the type of element.
voidsetExpression(Expression exp)
voidsetSelect(XPath xpath)
Set the "select" attribute.
voidsetSortElem(ElemSort sortElem)
Set a xsl:sort element associated with this element.
DTMIteratorsortNodes(XPathContext xctxt, Vector keys, DTMIterator sourceNodes)
Sort given nodes
voidtransformSelectedNodes(TransformerImpl transformer)
Perform a query if needed, and call transformNode for each child.

Field Detail

m_doc_cache_off

public boolean m_doc_cache_off
This is set by an "xalan-doc-cache-off" pi, or the old "xalan:doc-cache-off" pi. The old form of the PI only works for XML parsers that are not namespace aware. It tells the engine that documents created in the location paths executed by this element will not be reparsed. It's set by StylesheetHandler during construction. Note that this feature applies _only_ to xsl:for-each elements in its current incarnation; a more general cache management solution is desperately needed.

Constructor Detail

ElemForEach

public ElemForEach()
Construct a element representing xsl:for-each.

Method Detail

appendChild

public ElemTemplateElement appendChild(ElemTemplateElement newChild)
Add a child to the child list.

Parameters: newChild Child to add to child list

Returns: Child just added to child list

callChildVisitors

public void callChildVisitors(XSLTVisitor visitor, boolean callAttributes)
Call the children visitors.

Parameters: visitor The visitor whose appropriate method will be called.

compose

public void compose(StylesheetRoot sroot)
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition. NEEDSDOC @param sroot

Throws: TransformerException

endCompose

public void endCompose(StylesheetRoot sroot)
This after the template's children have been composed.

execute

public void execute(TransformerImpl transformer)
Execute the xsl:for-each transformation

Parameters: transformer non-null reference to the the current transform-time state.

Throws: TransformerException

getExpression

public Expression getExpression()

See Also: getExpression

getNodeName

public String getNodeName()
Return the node name.

Returns: The element's name

getSelect

public Expression getSelect()
Get the "select" attribute.

Returns: The XPath expression for the "select" attribute.

getSortElem

public ElemSort getSortElem(int i)
Get a xsl:sort element associated with this element.

Parameters: i Index of xsl:sort element to get

Returns: xsl:sort element at given index

getSortElemCount

public int getSortElemCount()
Get the count xsl:sort elements associated with this element.

Returns: The number of xsl:sort elements.

getXSLToken

public int getXSLToken()
Get an int constant identifying the type of element.

Returns: The token ID for this element

See Also:

setExpression

public void setExpression(Expression exp)

See Also: setExpression

setSelect

public void setSelect(XPath xpath)
Set the "select" attribute.

Parameters: xpath The XPath expression for the "select" attribute.

setSortElem

public void setSortElem(ElemSort sortElem)
Set a xsl:sort element associated with this element.

Parameters: sortElem xsl:sort element to set

sortNodes

public DTMIterator sortNodes(XPathContext xctxt, Vector keys, DTMIterator sourceNodes)
Sort given nodes

Parameters: xctxt The XPath runtime state for the sort. keys Vector of sort keyx sourceNodes Iterator of nodes to sort

Returns: iterator of sorted nodes

Throws: TransformerException

transformSelectedNodes

public void transformSelectedNodes(TransformerImpl transformer)
Perform a query if needed, and call transformNode for each child.

Parameters: transformer non-null reference to the the current transform-time state.

Throws: TransformerException Thrown in a variety of circumstances.

UNKNOWN: advanced

Copyright B) 2006 Apache XML Project. All Rights Reserved.