## Package net.sf.saxon.pattern

This package provides classes associated with XSLT pattern handling.

See:
Description

Class Summary
AnyChildNodePattern: An AnyChildNodePattern is the pattern node(), which matches any node except a root node, an attribute node, or a namespace node: in other words, any node that is the child of another node.
AnyNodeTest: NodeTest is an interface that enables a test of whether a node has a particular name and type.
CombinedNodeTest: A CombinedNodeTest combines two nodetests using one of the operators union (=or), intersect (=and), difference (= "and not").
ContentTypeTest: NodeTest is an interface that enables a test of whether a node matches particular conditions.
DocumentNodeTest: A DocumentNodeTest implements the test document-node(element(~,~))
IDPattern: An IDPattern is a pattern of the form id(literal)
KeyPattern: A KeyPattern is a pattern of the form key(keyname, keyvalue)
LocalNameTest: NodeTest is an interface that enables a test of whether a node has a particular name and type.
LocationPathPattern: A LocationPathPattern represents a path, for example of the form A/B/C...
NamespaceTest: NodeTest is an interface that enables a test of whether a node has a particular name and type.
NameTest: NodeTest is an interface that enables a test of whether a node has a particular name and type.
NodeKindTest: NodeTest is an interface that enables a test of whether a node has a particular name and kind.
NodeTest: A NodeTest is a simple kind of pattern that enables a context-free test of whether a node has a particular name.
NodeTestPattern: A NodeTestPattern is a pattern that consists simply of a NodeTest.
NoNodeTest: NodeTest is an interface that enables a test of whether a node has a particular name and type.
Pattern: A Pattern represents the result of parsing an XSLT pattern string.
SubstitutionGroupTest: NodeTest is an interface that enables a test of whether a node has a particular name and type.
UnionPattern: A pattern formed as the union (or) of two other patterns

## Package net.sf.saxon.pattern Description

This package provides classes associated with XSLT pattern handling.

The principal classes are:

Pattern:
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.

NodeTest:
This represents a NodeTest within a step of an XPathExpression. A NodeTest is a pattern in its own right, and is used directly to implement simple patterns such as `match="item"` or `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.

Michael H. Kay
25 April 2002