Static factory method to make a pattern by converting an expression. The supplied
expression is the equivalent expression to the pattern, in the sense that it takes
the same syntactic form.
This is a variant of the method PatternMaker.fromExpression(net.sf.saxon.expr.Expression, net.sf.saxon.Configuration)
,
and differs in that it creates a pattern suitable for streaming evaluation.
Note that this method does NOT check all the rules for XSLT patterns; it deliberately allows
a (slightly) wider class of expressions to be converted than XSLT allows.
The expression root() at the start of the expression has a special meaning: it refers to
the root of the subtree in which the pattern must match, which can be supplied at run-time
during pattern matching. This is used for patterns that represent streamable path expressions.
- Parameters:
expression
- the expression to be convertedconfig
- the Saxon configuration
- Throws:
XPathException
- if the expression cannot be converted