com.icl.saxon.pattern
Class LocationPathPattern
public final class LocationPathPattern
A LocationPathPattern represents a path, e.g. of the form A/B/C... The components are represented
as a linked list, each component pointing to its predecessor
void | addFilter(Expression filter) - Add a filter to the pattern (while under construction)
|
int | getFingerprint() - Determine the fingerprint of nodes to which this pattern applies.
|
short | getNodeType() - Determine the types of nodes to which this pattern applies.
|
boolean | isRelative() - Determine if the pattern uses positional filters
|
boolean | matches(NodeInfo node, Context context) - Determine whether this Pattern matches the given Node
|
boolean | matchesX(NodeInfo node, Context context) - Determine whether the pattern matches a given node.
|
Pattern | simplify() - Simplify the pattern: perform any context-independent optimisations
|
getDefaultPriority , getFingerprint , getLineNumber , getNodeType , getStaticContext , getSystemId , make , matches , setOriginalText , setStaticContext , simplify , toString |
ancestorPattern
public Pattern ancestorPattern
firstElementPattern
protected boolean firstElementPattern
lastElementPattern
protected boolean lastElementPattern
numberOfFilters
protected int numberOfFilters
parentPattern
public Pattern parentPattern
specialFilter
protected boolean specialFilter
addFilter
public void addFilter(Expression filter)
Add a filter to the pattern (while under construction)
filter
- The predicate (a boolean expression or numeric expression) to be added
getFingerprint
public int getFingerprint()
Determine the fingerprint of nodes to which this pattern applies.
Used for optimisation.
- getFingerprint in interface Pattern
- the fingerprint of nodes matched by this pattern.
getNodeType
public short getNodeType()
Determine the types of nodes to which this pattern applies. Used for optimisation.
For patterns that match nodes of several types, return Node.NODE
- getNodeType in interface Pattern
- the type of node matched by this pattern. e.g. Node.ELEMENT or Node.TEXT
isRelative
public boolean isRelative()
throws XPathException
Determine if the pattern uses positional filters
- true if there is a numeric filter in the pattern, or one that uses the position()
or last() functions
matches
public boolean matches(NodeInfo node,
Context context)
throws XPathException
Determine whether this Pattern matches the given Node
- matches in interface Pattern
node
- The NodeInfo representing the Element or other node to be tested against the Patterncontext
- The context in which the match is to take place. Only relevant if the pattern
uses variables.
- true if the node matches the Pattern, false otherwise
matchesX
public boolean matchesX(NodeInfo node,
Context context)
throws XPathException
Determine whether the pattern matches a given node.
node
- the node to be tested
- true if the pattern matches, else false