Project

Profile

Help

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

he / latest10 / hej / net / sf / saxon / pattern / package.html @ c10300c0

1
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
2
<!-- Copyright (c) 2014 Saxonica Limited. -->
3
<!-- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -->
4
<!-- If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
<!-- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -->
6
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
7

    
8
<html>
9

    
10
<head>
11
    <title>Package overview for net.sf.saxon.pattern</title>
12
</head>
13

    
14
<body>
15

    
16
<p>This package provides classes associated with XSLT pattern handling. </p>
17

    
18
<p>The principal classes are:</p>
19

    
20
<p><b>Pattern</b>:<br>
21
    This represents an XSLT Pattern. There is a static method Pattern.make() which is
22
    used to construct a Pattern from a String (it is a factory method rather than a
23
    constructor, because it typically returns some subclass of Pattern according
24
    to the syntax supplied). Subclasses of Pattern represent different kinds of pattern
25
    such as LocationPathPattern and IDKeyPattern. What they all have in common is a match()
26
    method, which determines whether a given node matches the pattern. A pattern is
27
    not in itself an Expression, but the class <code>PatternSponsor</code> is used
28
    to wrap a pattern making it look like an expression for the benefit of the static analysis
29
    (allowing the same mechanisms to be used for example to find all the references to a variable).</p>
30

    
31
<p><b>NodeTest</b>:<br>
32
    This represents a NodeTest within a step of an XPath expression. A NodeTest performs several
33
    roles: as well as its use in conjuction with an axis to form a step of a path expression,
34
    it acts as an ItemType used in handling type checking of nodes, and (wrapped in a NodeTestPattern)
35
    it acts as an XSLT pattern for use in constructs such as the <code>match</code> attribute of
36
    <code>xsl:template</code> and <code>xsl:key</code>.
37
    A NodeTest is used directly to implement simple patterns such as <code>match="item"</code>
38
    or <code>match="*"</code>. There are several subclasses of NodeTest, depending on the conditions
39
    to be matched: node type, node name, namespace URI, and so on. The class AnyNodeTest matches any node,
40
    while NoNodeTest matches nothing. NodeTests can also be combined using the operators of intersection,
41
    difference, and union, to describe the more complex types that are sometimes computed by the type
42
    checking machinery.</p>
43

    
44

    
45

    
46
</body>
47
</html>
(37-37/37)