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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
//! 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 `<property id="..." role="..." scheme="...">` — a `<properties>`
/// child, generic key/value-ish metadata (ISO Schematron 2016 extension,
/// issue #5). `message` uses the same rich-content model as a check's own
/// message. Note: unlike [`Diagnostic`], this crate does not (yet) model
/// `assert|report/@properties` (the parallel IDREFS attribute the ISO
/// grammar allows on checks, mirroring `@diagnostics`) — out of scope for
/// issue #5, which only covers the top-level `<properties>` construct
/// itself; that attribute is silently unread, same as several other
/// `assert`/`report` attributes (`flag`, `subject`, ...) this crate
/// doesn't model.
/// 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="...">` variable binding — either `<let name="..."
/// value="...">` ([`LetValue::Expr`]) or `<let name="...">`, with literal
/// XML content instead of a `value` attribute ([`LetValue::Literal`],
/// issue #3). See `plan/04-let-bindings.md` for evaluation semantics
/// (schema/pattern-level `<let>` evaluate against the document root,
/// rule-level against the matched context node, per
/// [`crate::engine::evaluate`]).
/// A [`LetBinding`]'s value — see its doc comment.
/// 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). `<value-of select="...">` (Stage 2, see
/// `plan/06-value-of-interpolation.md`) and `<name path="...">` (issue #4)
/// are both evaluated — `emph`/`dir`/`span` are purely presentational
/// (HTML-ish emphasis/direction/span wrappers) with no data-dependent
/// semantics, so text nested inside those still contributes via `Text`
/// (the wrapper tag itself carries no meaning here, same as Stage 1's
/// plain-text handling), but their own tags are not otherwise modeled.
/// Whether a [`Check`] is an `<assert>` (fails when `test` evaluates to
/// false) or a `<report>` (fires when `test` evaluates to true).