1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! Stage-1 Schematron schema model: `schema`/`ns`/`pattern`/`rule`/
//! `assert`/`report`, as produced by [`crate::parser::parse`].
//!
//! `context` and `test` are kept as raw, unparsed XPath strings — parsing
//! them is a later phase, gated on the sister crate `xpath-eval` (see
//! `plan/02-schema-parser.md`, "Voraussetzungen").
/// A parsed Schematron schema (Stage-1 subset, plus Stage-2 `<let>`).
/// A `<diagnostic id="..." role="...">` — referenced by a [`Check`]'s
/// `diagnostics` IDREFS list. `message` uses the same rich-content model
/// as a check's own message (see `plan/08-diagnostics.md`).
/// A `<phase id="..."><active pattern="..."/>...</phase>` — a named,
/// selectable subset of patterns. See `plan/05-phase-selection.md` for how
/// `Schema.default_phase`/`Schema.phases` feed into
/// [`crate::engine::evaluate_with_phase`].
/// A `<let name="..." value="...">` variable binding. `value` is the raw,
/// unparsed XPath expression (see [`Rule::context`]/[`Check::test`] for the
/// same treatment). See `plan/04-let-bindings.md` for scope (only the
/// `value`-attribute form is supported, not the `foreign-element+` literal-
/// XML-content form) and evaluation semantics (schema/pattern-level `<let>`
/// evaluate against the document root, rule-level against the matched
/// context node, per [`crate::engine::evaluate`]).
/// An `<ns prefix="..." uri="..."/>` binding, used to resolve prefixes in
/// `context`/`test` XPath expressions (not evaluated in this phase).
/// A `<pattern>` — a named or anonymous group of rules.
/// A `<rule context="...">`. `context` is the raw, unparsed XPath
/// expression selecting the nodes this rule applies to.
/// An `<assert>` or `<report>` element. `test` is the raw, unparsed XPath
/// expression. `message` is the element's rich content, rendered to a
/// final string only when the check fires — see
/// [`crate::engine::evaluate`] and `plan/06-value-of-interpolation.md`.
/// One piece of a [`Check`]'s message content, in document order.
///
/// The ISO Schematron content model for `assert`/`report` also allows
/// `name`/`emph`/`dir`/`span` markup (and arbitrary foreign-namespace
/// elements) — only `<value-of select="...">` is evaluated (Stage 2, see
/// `plan/06-value-of-interpolation.md`); text nested inside the other,
/// unsupported wrapper elements still contributes via `Text` (the wrapper
/// tag itself carries no meaning here, same as Stage 1's plain-text
/// handling), but those elements' own semantics (e.g. `<name/>` resolving
/// to the context node's name) are not implemented.
/// Whether a [`Check`] is an `<assert>` (fails when `test` evaluates to
/// false) or a `<report>` (fires when `test` evaluates to true).