-
Notifications
You must be signed in to change notification settings - Fork 0
/
mets_best_practices.xspec
295 lines (257 loc) · 12.2 KB
/
mets_best_practices.xspec
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<?xml version="1.0" encoding="UTF-8"?> <?xml-model href="xspec.rnc" type="application/relax-ng-compact-syntax"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" schematron="mets_best_practices.sch">
<x:scenario label="dmdsec-id">
<x:scenario label="with one unreferenced dmdsec (examples/dmdsec-id01.xml)">
<x:context href="examples/dmdsec-id01.xml" />
<x:expect-assert id="dmd-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with one properly referenced dmdsec (examples/dmdsec-id02.xml)">
<x:context href="examples/dmdsec-id02.xml" />
<x:expect-valid/>
</x:scenario>
<x:scenario label="with two dmdSecs, one referenced, one not (examples/dmdsec-id03.xml)">
<x:context href="examples/dmdsec-id03.xml" />
<x:expect-assert id="dmd-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with a dmdid referencing a non-dmdsec (examples/dmdsec-id04.xml)">
<x:context href="examples/dmdsec-id04.xml" />
<x:expect-assert id="dmdid-references-dmdsec"/>
</x:scenario>
<x:scenario label="with a dmdid referencing two dmdsecs (examples/dmdsec-id05.xml)">
<x:context href="examples/dmdsec-id05.xml" />
<x:expect-not-assert id="dmd-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with a dmdid referencing one dmdsec and one non-dmdsec (examples/dmdsec-id06.xml)">
<x:context href="examples/dmdsec-id06.xml" />
<x:expect-assert id="dmdid-references-dmdsec"/>
</x:scenario>
</x:scenario>
<x:scenario label="file-begin-end">
<x:scenario label="with a file with BEGIN, END, BETYPE attributes that does not have a parent file (examples/file-begin-end01.xml)">
<x:context href="examples/file-begin-end01.xml" />
<x:expect-assert id="file-begin-end-betype-has-parent" />
</x:scenario>
<x:scenario label="with a nested file with BEGIN and END but not BETYPE (examples/file-begin-end02.xml)">
<x:context href="examples/file-begin-end02.xml" />
<x:expect-assert id="begin-end-betype-has-begin-betype" />
</x:scenario>
<x:scenario label="with a nested file with BEGIN and BETYPE but not END (examples/file-begin-end03.xml)">
<x:context href="examples/file-begin-end03.xml" />
<x:expect-assert id="end-default-value" />
<x:expect-valid />
</x:scenario>
<x:scenario label="With a nested file with BEGIN, END, and BETYPE (examples/file-begin-end04.xml)">
<x:context href="examples/file-begin-end04.xml" />
<x:expect-valid />
</x:scenario>
</x:scenario>
<x:scenario label="file-id">
<x:scenario label="with one unreferenced file (examples/file-id01.xml)">
<x:context href="examples/file-id01.xml" />
<x:expect-assert id="file-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with one properly referenced file (examples/file-id02.xml)">
<x:context href="examples/file-id02.xml" />
<x:expect-valid/>
</x:scenario>
<x:scenario label="with two files, one referenced, one not (examples/file-id03.xml)">
<x:context href="examples/file-id03.xml" />
<x:expect-assert id="file-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with a fileid referencing a non-file (examples/file-id04.xml)">
<x:context href="examples/file-id04.xml" />
<x:expect-assert id="fileid-references-file"/>
</x:scenario>
</x:scenario>
<x:scenario label="fptr-fileid">
<x:scenario label="with FILEID and no children (examples/fptr-fileid01.xml)">
<x:context href="examples/fptr-fileid01.xml" />
<x:expect-valid/>
</x:scenario>
<x:scenario label="with FILEID and children (examples/fptr-fileid02.xml)">
<x:context href="examples/fptr-fileid02.xml" />
<x:expect-report id="fptr-with-children-has-no-fileid" />
</x:scenario>
<x:scenario label="with children but no FILEID (examples/fptr-fileid03.xml)">
<x:context href="examples/fptr-fileid03.xml" />
<x:expect-valid/>
</x:scenario>
<x:scenario label="with no child and no FILEID (examples/fptr-fileid04.xml)">
<x:context href="examples/fptr-fileid04.xml" />
<x:expect-assert id="fptr-without-children-has-fileid" />
</x:scenario>
</x:scenario>
<x:scenario label="mdsec-id">
<x:scenario label="with one unreferenced mdsec (examples/mdsec-id01.xml)">
<x:context href="examples/mdsec-id01.xml" />
<x:expect-assert id="mdsec-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with one properly referenced mdsec (examples/mdsec-id02.xml)">
<x:context href="examples/mdsec-id02.xml" />
<x:expect-not-assert />
<x:expect-not-report />
<x:expect-valid/>
</x:scenario>
<x:scenario label="with two mdsecs, one referenced, one not (examples/mdsec-id03.xml)">
<x:context href="examples/mdsec-id03.xml" />
<x:expect-assert id="mdsec-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with an admid referencing a non-mdsec (examples/mdsec-id04.xml)">
<x:context href="examples/mdsec-id04.xml" />
<x:expect-assert id="admid-references-mdsec"/>
</x:scenario>
<x:scenario label="with an admid referencing two mdsecs (examples/mdsec-id05.xml)">
<x:context href="examples/mdsec-id05.xml" />
<x:expect-not-assert id="mdsec-id-is-referenced"/>
<x:expect-valid/>
</x:scenario>
<x:scenario label="with an admid referencing one techmd and one dmdsec (examples/mdsec-id06.xml)">
<x:context href="examples/mdsec-id06.xml" />
<x:expect-assert id="admid-references-mdsec"/>
</x:scenario>
</x:scenario>
<x:scenario label="checksum">
<x:scenario label="with a checksumtype but no checksum (examples/file-checksum01.xml)">
<x:context href="examples/file-checksum01.xml" />
<x:expect-assert id="checksumtype-hasum" />
</x:scenario>
<x:scenario label="with a checksum but no checksumtype (examples/file-checksum02.xml)">
<x:context href="examples/file-checksum02.xml" />
<x:expect-assert id="checksum-hasumtype" />
</x:scenario>
</x:scenario>
<x:scenario label="checksum-format">
<x:scenario label="with an md5 checksum in the wrong format (examples/file-checksum-md5-bad.xml)">
<x:context href="examples/file-checksum-md5-bad.xml" />
<x:expect-assert id="checksum-md5-format" />
</x:scenario>
<x:scenario label="with an md5 checksum with the correct format (examples/file-checksum-md5-good.xml)">
<x:context href="examples/file-checksum-md5-good.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
<x:scenario label="with a sha1 checksum in the wrong format (examples/file-checksum-sha1-bad.xml)">
<x:context href="examples/file-checksum-sha1-bad.xml" />
<x:expect-assert id="checksum-sha1-format" />
</x:scenario>
<x:scenario label="with a sha1 checksum in the correct format (examples/file-checksum-sha1-good.xml)">
<x:context href="examples/file-checksum-sha1-good.xml" />
<x:expect-not-assert />
<x:expect-not-report />
<x:expect-valid />
</x:scenario>
<x:scenario label="with a sha256 checksum in the wrong format (examples/file-checksum-sha256-bad.xml)">
<x:context href="examples/file-checksum-sha256-bad.xml" />
<x:expect-assert id="checksum-sha256-format" />
</x:scenario>
<x:scenario label="with a sha256 checksum in the correct format (examples/file-checksum-sha256-good.xml)">
<x:context href="examples/file-checksum-sha256-good.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
</x:scenario>
<x:scenario label="area-attribute">
<x:scenario label="with SHAPE but not COORDS (examples/area-attribute01.xml)">
<x:context href="examples/area-attribute01.xml" />
<x:expect-assert id="area-shape-has-coords" />
</x:scenario>
<x:scenario label="with COORDS but not SHAPE (examples/area-attribute02.xml)">
<x:context href="examples/area-attribute02.xml" />
<x:expect-assert id="area-coords-has-shape" />
</x:scenario>
<x:scenario label="with both COORDS and SHAPE (examples/area-attribute03.xml)">
<x:context href="examples/area-attribute03.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
<x:scenario label="with COORDS, SHAPE, BEGIN, END, BETYPE (examples/area-attribute04.xml)">
<x:context href="examples/area-attribute04.xml" />
<x:expect-report id="area-shape-and-range" />
<x:expect-valid />
</x:scenario>
<x:scenario label="with COORDS, SHAPE, BEGIN, EXTENT, EXTTYPE (examples/area-attribute05.xml)">
<x:context href="examples/area-attribute05.xml" />
<x:expect-report id="area-shape-and-range" />
<x:expect-valid />
</x:scenario>
<x:scenario label="with BEGIN, END, BETYPE, EXTENT, EXTTYPE (examples/area-attribute06.xml)">
<x:context href="examples/area-attribute06.xml" />
<x:expect-report id="area-betype-exttype" />
<x:expect-report id="area-end-extent" />
<x:expect-valid />
</x:scenario>
<x:scenario label="with BEGIN, END, BETYPE (examples/area-attributes07.xml)">
<x:context href="examples/area-attribute07.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
<x:scenario label="with BEGIN, EXTENT, EXTTYPE (examples/area-attributes08.xml)">
<x:context href="examples/area-attribute08.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
<x:scenario label="with no area attributes (examples/area-attributes09.xml)">
<x:context href="examples/area-attribute09.xml" />
<x:expect-assert id="area-has-shape-or-begin" />
</x:scenario>
<x:scenario label="with USE on one fileGrp (examples/file-use01.xml)">
<x:context href="examples/file-use01.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
<x:scenario label="with USE on a fileGrp and a descendant file (examples/file-use02.xml)">
<x:context href="examples/file-use02.xml" />
<x:expect-valid />
<x:expect-assert id="multiple-file-use" />
</x:scenario>
<x:scenario label="with an FLocat with no USE and no USE attributes on any ancestors (examples/file-use03.xml)">
<x:context href="examples/file-use03.xml" />
<x:expect-valid />
<x:expect-assert id="no-file-use" />
</x:scenario>
<x:scenario label="with a terminal file with no USE and no USE attributes on any ancestors (examples/file-use04.xml)">
<x:context href="examples/file-use04.xml" />
<x:expect-valid />
<x:expect-assert id="no-file-use" />
</x:scenario>
<x:scenario label="with a terminal fileGrp with no USE and no USE attributes on any ancestors (examples/file-use05.xml)">
<x:context href="examples/file-use05.xml" />
<x:expect-valid />
<x:expect-assert id="no-file-use" />
</x:scenario>
<x:scenario label="with a file with SEQ=1 and a file with SEQ=3 (examples/file-seq01.xml)">
<x:context href="examples/file-seq01.xml" />
<x:expect-valid />
<x:expect-assert id="file-seq-nonsequential" />
</x:scenario>
<x:scenario label="with a file with SEQ=2 and a file with SEQ=3 (examples/file-seq02.xml)">
<x:context href="examples/file-seq02.xml" />
<x:expect-valid />
<x:expect-assert id="file-seq-bad-initial-value" />
</x:scenario>
<x:scenario label="with a file with SEQ and a sibling without SEQ (examples/file-seq03.xml)">
<x:context href="examples/file-seq03.xml" />
<x:expect-valid />
<x:expect-report id="file-seq-sibling-without-seq" />
</x:scenario>
<x:scenario label="with three files with in-order SEQ attributes starting with 1 (examples/file-seq04.xml)">
<x:context href="examples/file-seq04.xml" />
<x:expect-valid />
<x:expect-not-assert />
<x:expect-not-report />
</x:scenario>
</x:scenario>
</x:description>