public class LoopLifter extends java.lang.ObjectClass to handle loop-lifting optimization, that is, extraction of subexpressions appearing within a loop when there is no dependency on the controlling variable of the loop. This handles both focus-dependent loops (such as xsl:for-each) and variable-dependent loops (such as XPath for-expressions), and also takes into account specialist loops such as xsl:for-each-group, xsl:merge, and xsl:analyze-string. The class is instantiated to perform optimization of a component such as a function or template, and it contains temporary instance-level data pertaining to that function or template.
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
gatherInfo(Expression exp)Gather information about an expression.
process(Expression exp, ExpressionVisitor visitor, ContextItemStaticInfo contextInfo)Apply loop-lifting to an expression (typically the body of a template or function)
public static Expression process(Expression exp, ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathExceptionApply loop-lifting to an expression (typically the body of a template or function)
exp- the expression to which loop lifting is applied
visitor- the expression visitor
contextInfo- the static type of the context item
- the optimized expression
XPathException- if any error occurs
public Expression getRoot()
public void gatherInfo(Expression exp)Gather information about an expression. The information (in the form of an ExpInfo object) is added to the expInfoMap, which is indexed by expression.
exp- the expression for which information is required