Project

Profile

Help

How to connect?
Download (2.07 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.2.0.5 / hej / net / sf / saxon / pattern / package.html @ 90ee0d1a

1
<html>
2

    
3
<head>
4
<title>Package overview for net.sf.saxon.pattern</title>
5
</head>
6

    
7
<body>
8

    
9
<p>This package provides classes associated with XSLT pattern handling. </p>
10

    
11
<p>The principal classes are:</p>
12

    
13
<p><b>Pattern</b>:<br>
14
This represents an XSLT Pattern. There is a static method Pattern.make() which is
15
used to construct a Pattern from a String (it is a factory method rather than a
16
 constructor, because it typically returns some subclass of Pattern according
17
  to the syntax supplied). Subclasses of Pattern represent different kinds of pattern
18
  such as LocationPathPattern and IDKeyPattern. What they all have in common is a match()
19
  method, which determines whether a given node matches the pattern. A pattern is
20
  not in itself an Expression, but the class <code>PatternSponsor</code> is used
21
  to wrap a pattern making it look like an expression for the benefit of the static analysis
22
  (allowing the same mechanisms to be used for example to find all the references to a variable).</p>
23
  
24
<p><b>NodeTest</b>:<br>
25
This represents a NodeTest within a step of an XPath expression. A NodeTest performs several
26
roles: as well as its use in conjuction with an axis to form a step of a path expression,
27
it acts as an ItemType used in handling type checking of nodes, and (wrapped in a NodeTestPattern)
28
it acts as an XSLT pattern for use in constructs such as the <code>match</code> attribute of
29
<code>xsl:template</code> and <code>xsl:key</code>.
30
A NodeTest is used directly to implement simple patterns such as <code>match="item"</code>
31
or <code>match="*"</code>. There are several subclasses of NodeTest, depending on the conditions
32
to be matched: node type, node name, namespace URI, and so on. The class AnyNodeTest matches any node,
33
while NoNodeTest matches nothing. NodeTests can also be combined using the operators of intersection,
34
difference, and union, to describe the more complex types that are sometimes computed by the type
35
checking machinery.</p>
36

    
37

    
38
<hr>
39

    
40
<p align="center"><i>Michael H. Kay<br/>
41
Saxonica Limited<br/>
42
9 February 2005</i></p>
43
</body>
44
</html>
(24-24/24)