Skip to content

Commit

Permalink
Fixing duplicate elementSpec and adding sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
joeytakeda committed Jun 4, 2024
1 parent bfa0355 commit 2efdd1c
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 51 deletions.
23 changes: 11 additions & 12 deletions schema/lim.full.odd
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,17 @@
<classes mode="change">
<memberOf key="att.global.analytic" mode="add"/>
</classes>
<constraintSpec ident="item.indexItemsMustHaveTitleAndNum" scheme="schematron" mode="add">
<desc>All index items must contain a title and a number</desc>
<constraint>
<sch:pattern>
<sch:rule context="tei:div[@type='index']/tei:list/tei:item">
<sch:assert test="count(tei:num) gt 0">ERROR: All index items must contain at least one num element.</sch:assert>
<sch:assert test="count(descendant::tei:title) gt 0">ERROR: All index items must contain at least one title element.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</elementSpec><elementSpec ident="l" module="core" mode="change">
<classes mode="change">
<memberOf key="att.global.analytic" mode="add"/>
Expand Down Expand Up @@ -2910,18 +2921,6 @@
</valList>
</attDef>
</attList>
</elementSpec><elementSpec ident="item" mode="change" module="textstructure">
<constraintSpec ident="item.indexItemsMustHaveTitleAndNum" scheme="schematron" mode="add">
<desc>All index items must contain a title and a number</desc>
<constraint>
<sch:pattern>
<sch:rule context="tei:div[@type='index']/tei:list/tei:item">
<sch:assert test="count(tei:num) gt 0">ERROR: All index items must contain at least one num element.</sch:assert>
<sch:assert test="count(descendant::tei:title) gt 0">ERROR: All index items must contain at least one title element.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</elementSpec><elementSpec ident="opener" module="textstructure" mode="change">
<content>
<macroRef key="lim.macro.openerAndCloserContent"/>
Expand Down
2 changes: 1 addition & 1 deletion schema/lim.rng
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="http://www.tei-c.org/ns/1.0"><!--
Schema generated from ODD source 2024-06-03T22:12:17Z. .
Schema generated from ODD source 2024-06-04T05:23:14Z. .
TEI Edition: P5 Version 4.7.0. Last updated on
16th November 2023, revision e5dd73ed0
TEI Edition Location: https://www.tei-c.org/Vault/P5/P5 Version 4.7.0/
Expand Down
15 changes: 13 additions & 2 deletions schema/modules/core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<?xml-model href="https://tei-c.org/release/xml/tei/custom/schema/relaxng/tei_odds.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://tei-c.org/release/xml/tei/custom/schema/relaxng/tei_odds.rng" type="application/xml"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="../odd/lim-odd.sch" type="application/xml"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0"
xmlns:sch="http://purl.oclc.org/dsdl/schematron"
xml:id="core">
Expand Down Expand Up @@ -246,6 +244,19 @@
<classes mode="change">
<memberOf key="att.global.analytic" mode="add"/>
</classes>
<constraintSpec ident="item.indexItemsMustHaveTitleAndNum"
scheme="schematron"
mode="add">
<desc>All index items must contain a title and a number</desc>
<constraint>
<sch:pattern>
<sch:rule context="tei:div[@type='index']/tei:list/tei:item">
<sch:assert test="count(tei:num) gt 0">ERROR: All index items must contain at least one num element.</sch:assert>
<sch:assert test="count(descendant::tei:title) gt 0">ERROR: All index items must contain at least one title element.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</elementSpec>
<!--l-->
<elementSpec ident="l" module="core" mode="change">
Expand Down
7 changes: 5 additions & 2 deletions schema/modules/corpus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<!--settingDesc-->
<elementSpec ident="settingDesc" module="corpus" mode="change">
<content>
<elementRef key="setting" minOccurs="1" maxOccurs="unbounded"/>
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<sequence>
<elementRef key="setting" minOccurs="1" maxOccurs="unbounded"/>
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
</sequence>

</content>
</elementSpec>
</schemaSpec>
Expand Down
48 changes: 30 additions & 18 deletions schema/modules/namesdates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,12 @@
<memberOf key="att.docStatus" mode="delete"/>
</classes>
<content>
<elementRef key="objectName" minOccurs="0" maxOccurs="1"/>
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
<sequence>
<elementRef key="objectName" minOccurs="0" maxOccurs="1"/>
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
</sequence>

</content>
<remarks mode="add">
<p>Our use of object is not TEI conformant, but the break is fairly
Expand All @@ -235,14 +238,17 @@
<memberOf key="att.global.linking" mode="add"/>
</classes>
<content>
<!--Orgs must have an orgName-->
<elementRef key="orgName" minOccurs="1" maxOccurs="unbounded"/>
<!--Also needs a note-->
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<!--And may include a ptrGrp-->
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
<!--And may have a list of suborganizations below it-->
<elementRef key="listOrg" minOccurs="0" maxOccurs="1"/>
<sequence>
<!--Orgs must have an orgName-->
<elementRef key="orgName" minOccurs="1" maxOccurs="unbounded"/>
<!--Also needs a note-->
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<!--And may include a ptrGrp-->
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
<!--And may have a list of suborganizations below it-->
<elementRef key="listOrg" minOccurs="0" maxOccurs="1"/>
</sequence>

</content>
<attList>
<attDef ident="xml:id" mode="change" usage="req">
Expand Down Expand Up @@ -306,9 +312,12 @@
<memberOf key="att.global.linking" mode="add"/>
</classes>
<content>
<macroRef key="lim.personMacro"/>
<!--Add linkGrp optionally only for person, not persona-->
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
<sequence>
<macroRef key="lim.personMacro"/>
<!--Add linkGrp optionally only for person, not persona-->
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
</sequence>

</content>
<constraintSpec ident="person.constraints" scheme="schematron">
<desc>Various constraints for the different models for contributors and non-contributors.</desc>
Expand Down Expand Up @@ -353,10 +362,13 @@
<memberOf key="att.global.linking" mode="add"/>
</classes>
<content>
<elementRef key="placeName" minOccurs="0" maxOccurs="unbounded"/>
<elementRef key="location" minOccurs="0" maxOccurs="1"/>
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
<sequence>
<elementRef key="placeName" minOccurs="0"
maxOccurs="unbounded"/>
<elementRef key="location" minOccurs="0" maxOccurs="1"/>
<elementRef key="note" minOccurs="0" maxOccurs="1"/>
<elementRef key="linkGrp" minOccurs="0" maxOccurs="1"/>
</sequence>
</content>
<constraintSpec ident="place.mustHaveProperId" scheme="schematron">
<desc>All people must have a proper id.</desc>
Expand Down
16 changes: 0 additions & 16 deletions schema/modules/textstructure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@
</attDef>
</attList>
</elementSpec>
<!--item-->
<elementSpec ident="item" mode="change" module="textstructure">
<constraintSpec ident="item.indexItemsMustHaveTitleAndNum"
scheme="schematron"
mode="add">
<desc>All index items must contain a title and a number</desc>
<constraint>
<sch:pattern>
<sch:rule context="tei:div[@type='index']/tei:list/tei:item">
<sch:assert test="count(tei:num) gt 0">ERROR: All index items must contain at least one num element.</sch:assert>
<sch:assert test="count(descendant::tei:title) gt 0">ERROR: All index items must contain at least one title element.</sch:assert>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</elementSpec>
<!--opener-->
<elementSpec ident="opener" module="textstructure" mode="change">
<content>
Expand Down

0 comments on commit 2efdd1c

Please sign in to comment.