-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathiso-schematron.rnc
196 lines (163 loc) · 4.55 KB
/
iso-schematron.rnc
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# (c) International Organization for Standardization 2005.
# Permission to copy in any form is granted for use with conforming
# SGML systems and applications as defined in ISO 8879,
# provided this notice is included in all copies.
default namespace sch = "http://purl.oclc.org/dsdl/schematron"
namespace local = ""
start = schema
# Element declarations
schema = element schema {
attribute id { xsd:ID }?,
rich,
attribute schemaVersion { non-empty-string }?,
attribute defaultPhase { xsd:IDREF }?,
attribute queryBinding { non-empty-string }?,
(foreign
& inclusion*
& (title?,
ns*,
p*,
let*,
phase*,
pattern+,
p*,
diagnostics?))
}
active = element active {
attribute pattern { xsd:IDREF },
(foreign & (text | dir | emph | span)*)
}
assert = element assert {
attribute test { exprValue },
attribute flag { flagValue }?,
attribute id { xsd:ID }?,
attribute diagnostics { xsd:IDREFS }?,
rich,
linkable,
(foreign & (text | name | value-of | emph | dir | span)*)
}
diagnostic = element diagnostic {
attribute id { xsd:ID },
rich,
(foreign & (text | value-of | emph | dir | span)*)
}
diagnostics = element diagnostics {
foreign & inclusion* & diagnostic*
}
dir = element dir {
attribute value { "ltr" | "rtl" }?,
(foreign & text)
}
emph = element emph { text }
extends = element extends {
attribute rule { xsd:IDREF },
foreign-empty
}
let = element let {
attribute name { nameValue },
attribute value { string }
}
name = element name {
attribute path { pathValue }?,
foreign-empty
}
ns = element ns {
attribute uri { uriValue },
attribute prefix { nameValue },
foreign-empty
}
p = element p {
attribute id { xsd:ID }?,
attribute class { classValue }?,
attribute icon { uriValue }?,
(foreign & (text | dir | emph | span)*)
}
param = element param {
attribute name { nameValue },
attribute value { non-empty-string }
}
pattern = element pattern {
rich,
(foreign & inclusion* &
( (attribute abstract { "true" }, attribute id { xsd:ID },
title?, (p*, let*, rule*))
| (attribute abstract { "false" }?, attribute id { xsd:ID }?,
title?, (p*, let*, rule*))
| (attribute abstract { "false" }?, attribute is-a { xsd:IDREF },
attribute id { xsd:ID }?, title?, (p*, param*))
)
)
}
phase = element phase {
attribute id { xsd:ID },
rich,
(foreign & inclusion* & (p*, let*, active*))
}
report = element report {
attribute test { exprValue },
attribute flag { flagValue }?,
attribute id { xsd:ID }?,
attribute diagnostics { xsd:IDREFS }?,
rich,
linkable,
(foreign & (text | name | value-of | emph | dir | span)*)
}
rule = element rule {
attribute flag { flagValue }?,
rich,
linkable,
(foreign & inclusion*
& ((attribute abstract { "true" },
attribute id { xsd:ID }, let*, (assert | report | extends)+)
| (attribute context { pathValue },
attribute id { xsd:ID }?,
attribute abstract { "false" }?,
let*, (assert | report | extends)+)))
}
span = element span {
attribute class { classValue },
(foreign & text)
}
title = element title {
(text | dir)*
}
value-of = element value-of {
attribute select { pathValue },
foreign-empty
}
# common declarations
inclusion = element include {
attribute href { uriValue }
}
rich =
attribute icon { uriValue }?,
attribute see { uriValue }?,
attribute fpi { fpiValue }?,
attribute xml:lang { langValue }?,
attribute xml:space { "preserve" | "default" }?
linkable =
attribute role { roleValue }?,
attribute subject { pathValue }?
foreign =
foreign-attributes, foreign-element*
foreign-empty =
foreign-attributes
foreign-attributes =
attribute * - (local:* | xml:*) { text }*
foreign-element = element * - sch:* {
(attribute * { text }
| foreign-element
| schema
| text)*
}
# Data types
uriValue = xsd:anyURI
pathValue = string
exprValue = string
fpiValue = string
langValue = xsd:language
roleValue = string
flagValue = string
nameValue = string # In the default query language binding, xsd:NCNAME
classValue = string
non-empty-string = xsd:token { minLength = "1" }