Package com.saxonica.ee.trans
Class AncestorCharacteristic
java.lang.Object
com.saxonica.ee.trans.Characteristic
com.saxonica.ee.trans.AncestorCharacteristic
Given an expression, this characteristic returns a boolean indicating whether
or not the context item has a parent (or ancestor, respectively) that matches
a given pattern
-
Constructor Summary
ConstructorsConstructorDescriptionAncestorCharacteristic(Pattern pattern, boolean isParent) Define an AncestorCharacteristic -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether this characteristic is the same as another characteristic.evaluate(XPathContext context) Evaluate the characteristic as applied to the context iteminthashCode()toString()Methods inherited from class com.saxonica.ee.trans.Characteristic
getSlotNumber, setSlotNumber
-
Constructor Details
-
AncestorCharacteristic
Define an AncestorCharacteristic- Parameters:
pattern- the pattern that an ancestor/parent must satisfy if the characteristic is to have the value trueisParent- true if the pattern must match the immediate parent; false if the pattern must match some ancestor
-
-
Method Details
-
evaluate
Evaluate the characteristic as applied to the context item- Specified by:
evaluatein classCharacteristic- Parameters:
context- the dynamic evaluation context; the context item is the item being matched- Returns:
- true if there is an ancestor/parent satisfying the characteristic pattern. (We wrap this in a BooleanValue because the superclass expects Object, and using Boolean causes problems with C# translation.)
- Throws:
XPathException- if pattern matching fails with a dynamic error
-
hashCode
public int hashCode() -
equals
Test whether this characteristic is the same as another characteristic. -
toString
-