Test whether this node test is satisfied by a given node. This method is only
fully supported for a subset of NodeTests, because it doesn't provide all the information
needed to evaluate all node tests. In particular (a) it can't be used to evaluate a node
test of the form element(N,T) or schema-element(E) where it is necessary to know whether the
node is nilled, and (b) it can't be used to evaluate a node test of the form
document-node(element(X)). This in practice means that it is used (a) to evaluate the
simple node tests found in the XPath 1.0 subset used in XML Schema, and (b) to evaluate
node tests where the node kind is known to be an attribute.
Get a matching function that can be used to test whether numbered nodes in a TinyTree
or DominoTree satisfy the node test. (Calling this matcher must give the same result
as calling matchesNode(tree.getNode(nodeNr)), but it may well be faster).
the type of node matched by this pattern. e.g. Type.ELEMENT or Type.TEXT
public java.util.Optional<IntSet> getRequiredNodeNames()
Get the set of node names allowed by this NodeTest. This is returned as a set of Integer fingerprints.
A null value indicates that all names are permitted (i.e. that there are no constraints on the node name.
The default implementation returns null.
variable "item" is an instance of this item type.
XPathException - if JS code cannot be generated for this item type, for example because
the test is schema-aware.
public java.util.Optional<java.lang.String> explainMismatch(Item item,
Get extra diagnostic information about why a supplied item does not conform to this
item type, if available. If extra information is returned, it should be in the form of a complete
sentence, minus the closing full stop. No information should be returned for obvious cases.