This package provides classes associated with XSLT pattern handling.
The principal classes are:
This represents an XSLT Pattern. There is a static method Pattern.make() which is used to construct a Pattern from a String (it is a factory method rather than a constructor, because it typically returns some subclass of Pattern according to the syntax supplied). Subclasses of Pattern represent different kinds of pattern such as LocationPathPattern and IDKeyPattern. What they all have in common is a match() method, which determines whether a given node matches the pattern. A pattern is not in itself an Expression, but the class
PatternSponsor is used
to wrap a pattern making it look like an expression for the benefit of the static analysis
(allowing the same mechanisms to be used for example to find all the references to a variable).
This represents a NodeTest within a step of an XPath expression. A NodeTest performs several roles: as well as its use in conjuction with an axis to form a step of a path expression, it acts as an ItemType used in handling type checking of nodes, and (wrapped in a NodeTestPattern) it acts as an XSLT pattern for use in constructs such as the
match attribute of
A NodeTest is used directly to implement simple patterns such as
match="*". There are several subclasses of NodeTest, depending on the conditions
to be matched: node type, node name, namespace URI, and so on. The class AnyNodeTest matches any node,
while NoNodeTest matches nothing. NodeTests can also be combined using the operators of intersection,
difference, and union, to describe the more complex types that are sometimes computed by the type
Interface Summary Interface Description NodePredicateInterface representing a predicate applied to a node. PatternWithPredicateRepresents a pattern with a predicate, for example item[@value=3] or .[. QNameTestInterface for tests against a QName. SchemaNodeTestMarker interface for schema-element() and schema-attribute() node tests
Class Summary Class Description AncestorQualifiedPatternAn AncestorQualifiedPattern represents a path of the form A/B or A//B, where nodes must match the pattern B and also have a parent/ancestor (respectively) that matches A. AnchorPatternThis is a special pattern that matches the "anchor node". AnyNodeTestNodeTest is an interface that enables a test of whether a node has a particular name and type. BasePatternWithPredicateClass for handling patterns with simple non-positional boolean predicates BooleanExpressionPatternA BooleanExpressionPattern is a pattern of the form .[ Expr ] introduced in XSLT 3.0. CombinedNodeTestA CombinedNodeTest combines two node tests using one of the operators union (=or), intersect (=and), difference (= "and not"). ContentTypeTestNodeTest is an interface that enables a test of whether a node matches particular conditions. DocumentNodeTestA DocumentNodeTest implements the test document-node(element(~,~)) ExceptPatternA pattern formed as the difference of two other patterns GeneralNodePatternA GeneralNodePattern represents a pattern which, because of the presence of positional predicates or otherwise, can only be evaluated "the hard way", by evaluating the equivalent expression with successive ancestors of the tested node as context item. GeneralPositionalPatternA GeneralPositionalPattern is a pattern of the form A[P] where A is an axis expression using the child axis and P is an expression that depends on the position. IntersectPatternA pattern formed as the difference of two other patterns ItemTypePatternAn ItemTypePattern is a pattern that consists simply of an ItemType; although a node test is an item type, this class is used only for non-node item types, such as atomic types, map types, array types etc. LocalNameTestNodeTest is an interface that enables a test of whether a node has a particular name and type. MultipleNodeKindTestAn MultipleNodeKindTest is a nodetest that matches nodes belonging to any subset of possible node kinds, for example element and document nodes, or attribute and namespace nodes NamespaceTestNodeTest is an interface that enables a test of whether a node has a particular name and type. NameTestNodeTest is an interface that enables a test of whether a node has a particular name and type. NodeKindTestNodeTest is an interface that enables a test of whether a node has a particular name and kind. NodeSelectorA NodeTest that wraps a general Predicate applied to nodes. NodeSetPatternA NodeSetPattern is a pattern based on an expression that is evaluated to return a set of nodes; a node matches the pattern if it is a member of this node-set. NodeTestA NodeTest is a simple kind of pattern that enables a context-free test of whether a node matches a given node kind and name. NodeTestPatternA NodeTestPattern is a pattern that consists simply of a NodeTest PatternA Pattern represents the result of parsing an XSLT pattern string. PatternMakerThis is a singleton class used to convert an expression to an equivalent pattern. PatternParserParser for XSLT patterns. PatternThatSetsCurrentThis class represents a pattern that sets the value of current() to the node being matched, and then wraps another pattern that uses the value of current() SameNameTestNodeTest is an interface that enables a test of whether a node has a particular name and type. SimplePositionalPatternA SimplePositionalPattern is a pattern of the form A[N] where A is an axis expression using the child axis and P is a numeric literal. StreamingFunctionArgumentPatternThis is a special pattern that matches the node supplied as the first argument of a call to a streamable stylesheet function; it corresponds to the pattern match="$arg" where $arg is the first argument of the function. UnionPatternA pattern formed as the union (or) of two other patterns UnionQNameTestA QNameTest that is the union of a number of supplied QNameTests UniversalPatternThe UniversalPattern matches everything VennPatternAbstract pattern formed as the union, intersection, or difference of two other patterns; concrete subclasses are used for the different operators.