-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMRM_RdgWitValidate.sch
More file actions
32 lines (26 loc) · 1.18 KB
/
MRM_RdgWitValidate.sch
File metadata and controls
32 lines (26 loc) · 1.18 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding="xslt2">
<ns uri="http://www.tei-c.org/ns/1.0" prefix="tei"/>
<pattern>
<rule context="tei:TEI//@ref | tei:TEI//@who | tei:TEI//@corresp | tei:TEI//@wit">
<assert test="starts-with(., '#')">
Attributes @ref, @who, @corresp and @wit must begin with a hashtag.
</assert>
</rule>
</pattern>
<pattern>
<rule context="tei:TEI//@wit">
<let name="tokens" value="for $w in tokenize(., '\s+') return substring-after($w, '#')"/>
<assert test="every $token in $tokens satisfies $token = //tei:TEI//tei:listWit//@xml:id">
Every reading witness (@wit) after the hashtag must match an xml:id defined in the list of witnesses in this file!
</assert>
</rule>
</pattern>
<pattern>
<rule context="tei:TEI//@xml:id">
<report test="matches(., '\s+')">
@xml:id values may NOT contain white spaces!
</report>
</rule>
</pattern>
</schema>