|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <!-- © TEI Consortium. Dual-licensed under CC-by and BSD2 licenses; see the file COPYING.txt for details. --> |
3 | 3 | <?xml-model href="https://jenkins.tei-c.org/job/TEIP5-dev/lastSuccessfulBuild/artifact/P5/release/xml/tei/odd/p5.nvdl" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?> |
4 | | -<elementSpec xmlns="http://www.tei-c.org/ns/1.0" module="tagdocs" xml:id="gi-attList" ident="attList"> |
| 4 | +<elementSpec xmlns="http://www.tei-c.org/ns/1.0" module="tagdocs" xml:id="gi-attList" ident="attList" xmlns:sch="http://purl.oclc.org/dsdl/schematron"> |
5 | 5 | <gloss versionDate="2020-12-20" xml:lang="en">attribute list</gloss> |
6 | 6 | <gloss versionDate="2007-06-12" xml:lang="fr">liste d'attributs</gloss> |
7 | 7 | <desc versionDate="2005-01-14" xml:lang="en">contains documentation for all the attributes associated with this element, as a series of <gi>attDef</gi> elements.</desc> |
|
21 | 21 | <elementRef key="attList"/> |
22 | 22 | </alternate> |
23 | 23 | </content> |
| 24 | + <constraintSpec ident="no_duplicate_attrs" scheme="schematron" xml:lang="en"> |
| 25 | + <desc>Because it is illegal in XML to have two attributes with the |
| 26 | + same name on the same element instance, it is illegal in TEI to |
| 27 | + have two <gi>attDef</gi> elements with the same values of |
| 28 | + <att>ns</att> and <att>ident</att> in a single <gi>attList</gi>, |
| 29 | + unless the parent <gi>attList</gi> has an <att>org</att> of |
| 30 | + <val>choice</val>. This applies regardless of the <att>mode</att> |
| 31 | + of each <gi>attDef</gi>.</desc> |
| 32 | + <constraint> |
| 33 | + <sch:rule context="tei:attList[ not( ancestor::tei:attList ) ]"> |
| 34 | + <!-- |
| 35 | + Set up a dummy string that contains at least 1 character that |
| 36 | + is not legal in a URI, and thus cannot be a namespace. |
| 37 | + --> |
| 38 | + <sch:let name="notanamespace" value="'☮🄯'"/> |
| 39 | + <!-- generate a sequence of my <attDef> descendants --> |
| 40 | + <sch:let name="defs" value="descendant::tei:attDef"/> |
| 41 | + <!-- |
| 42 | + get a sequence of @ns & @ident combinations of those |
| 43 | + <attDef>s, except ignore those whose parent is an |
| 44 | + <attList> that is an alternation, and for which we have |
| 45 | + already recorded this @ident. Thus if we see |
| 46 | + <attList org="choice"> |
| 47 | + <attDef ident="klaatu"/> |
| 48 | + <attDef ident="bodsworth"/> |
| 49 | + <attDef ident="rugglesby"/> |
| 50 | + <attDef ident="klaatu"/> |
| 51 | + </attList> |
| 52 | + The sequence should be ('klaatu','bodsworth','rugglesby',''). |
| 53 | + --> |
| 54 | + <sch:let name="nsidents" |
| 55 | + value="for $ad in $defs return |
| 56 | + if ( $ad[ |
| 57 | + parent::tei:attList[ @org eq 'choice'] |
| 58 | + and |
| 59 | + preceding-sibling::tei:attDef[ |
| 60 | + @ident eq $ad/@ident |
| 61 | + and |
| 62 | + ( @ns, $notanamespace )[1] eq ( $ad/@ns, $notanamespace )[1] |
| 63 | + ] |
| 64 | + ] |
| 65 | + ) |
| 66 | + then '' |
| 67 | + else normalize-space( if ($ad/@ns) then 'Q{'||$ad/@ns||'}'||$ad/@ident else $ad/@ident ) |
| 68 | + "/> |
| 69 | + <!-- get a sequence of any that occur 2+ times: --> |
| 70 | + <sch:let name="dups" value="for $a in $nsidents return ( $nsidents[ . eq $a ][2] )"/> |
| 71 | + <!-- remove any duplicates from the list of duplicates (-: --> |
| 72 | + <sch:let name="distinct_dups" value="distinct-values( $dups )"/> |
| 73 | + <!-- |
| 74 | + if there are any values in list of distinct duplicates (other than null), |
| 75 | + warn user about them: |
| 76 | + --> |
| 77 | + <sch:assert test="count( $distinct_dups[ . ne ''] ) eq 0"> |
| 78 | + Within the attribute list defined in <sch:value-of select="ancestor::*[@ident][1]/@ident"/>, |
| 79 | + the following attributes have been defined multiple times: <sch:value-of select="$distinct_dups"/>. |
| 80 | + </sch:assert> |
| 81 | + </sch:rule> |
| 82 | + </constraint> |
| 83 | + </constraintSpec> |
24 | 84 | <attList> |
25 | 85 | <attDef ident="org"> |
26 | 86 | <gloss versionDate="2007-07-04" xml:lang="en">organization</gloss> |
|
103 | 163 | <datatype maxOccurs="unbounded"><dataRef key="teidata.pointer"/></datatype> |
104 | 164 | </attDef> |
105 | 165 | <attDef ident="mutual" usage="opt"> |
106 | | - <desc versionDate="2005-07-24" xml:lang="en">supplies a list of participants amongst all of whom the relationship holds equally.</desc> |
| 166 | + <desc versionDate="2005-07-24" xml:lang="en">supplies a list |
| 167 | + of participants amongst all of whom the relationship holds |
| 168 | + equally.</desc> |
107 | 169 | <datatype maxOccurs="unbounded"><dataRef key="teidata.pointer"/></datatype> |
108 | 170 | </attDef> |
109 | 171 | </attList> |
|
0 commit comments