-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthority-schematron.sch
executable file
·40 lines (30 loc) · 1.73 KB
/
authority-schematron.sch
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
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<!-- currently, these are basic rules relating to correct entry of names and ids. Later they may be expanded to cover other areas. -->
<pattern>
<rule context="tei:person">
<assert test="count(tei:persName[@type='display']) = 1" role="warn">One persName element should have @type=display</assert>
</rule>
<rule context="tei:org">
<assert test="count(tei:orgName[@type='display']) = 1" role="warn">One orgName element should have @type=display</assert>
</rule>
<rule context="tei:place">
<assert test="count(tei:placeName[@type='index']) = 1" role="warn">One placeName element should have @type=index</assert>
</rule>
</pattern>
<pattern>
<rule context="tei:text/tei:body/tei:listBibl/tei:bibl[@xml:id]">
<assert test="matches(@xml:id, 'work_\d+')">The bibl element must have an xml:id attribute matching the pattern 'work_[digits]'</assert>
<assert test="count(tei:title[@type='uniform']) = 1">One title element only must have @type=uniform</assert>
<!--<assert test="tei:textLang[@mainLang]">Works should have language(s) specified in a textLang element which must have an attribute @mainLang</assert>-->
</rule>
</pattern>
<!--
<pattern>
<rule context="tei:text/tei:body/tei:listBibl/tei:bibl[not(tei:author)]">
<assert test="tei:note[@type='subject']">Works without an author should have one or more subject headings</assert>
</rule>
</pattern>
-->
</schema>