Skip to content

Commit

Permalink
Consistently use 'sch:' prefix rather than explicit namespace decl on…
Browse files Browse the repository at this point in the history
… Schematron, for no apparent reason other than it is mildly easier to read when consistent.
  • Loading branch information
sydb committed Dec 15, 2023
1 parent 21ba627 commit 5a517ef
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 57 deletions.
40 changes: 20 additions & 20 deletions P5/Source/Guidelines/en/TD-DocumentationElements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,11 @@ to mark any technical term, thus:
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<constraintSpec ident="subclauses" scheme="schematron">
<constraint>
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0" xmlns="http://purl.oclc.org/dsdl/schematron"/>
<rule context="tei:div" xmlns="http://purl.oclc.org/dsdl/schematron">
<report test="count( tei:div ) eq 1">if it contains any subdivisions, a
division must contain at least two of them</report>
</rule>
<sch:ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<sch:rule context="tei:div" xmlns="http://purl.oclc.org/dsdl/schematron">
<sch:report test="count( tei:div ) eq 1">if it contains any subdivisions, a
division must contain at least two of them</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
</egXML>
Expand Down Expand Up @@ -906,13 +906,13 @@ to mark any technical term, thus:
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<constraintSpec ident="alt" scheme="schematron">
<constraint>
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0" xmlns="http://purl.oclc.org/dsdl/schematron"/>
<pattern id="altTags" xmlns="http://purl.oclc.org/dsdl/schematron">
<rule context="tei:figure">
<report test="not(tei:figDesc or tei:head)"> You should provide information in a figure from
which we can construct an alt attribute in HTML </report>
</rule>
</pattern>
<sch:ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<sch:pattern id="altTags" xmlns="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="tei:figure">
<sch:report test="not(tei:figDesc or tei:head)"> You should provide information in a figure from
which we can construct an alt attribute in HTML </sch:report>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</egXML>
Expand All @@ -921,14 +921,14 @@ to mark any technical term, thus:
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<constraintSpec ident="tables" scheme="schematron">
<constraint>
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0" xmlns="http://purl.oclc.org/dsdl/schematron"/>
<pattern id="Tables" xmlns="http://purl.oclc.org/dsdl/schematron">
<rule context="tei:table">
<assert test="tei:head">A &lt;table> should have a caption, using a &lt;head>
element</assert>
<report test="parent::tei:body">Do not use tables to lay out the document body</report>
</rule>
</pattern>
<sch:ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<sch:pattern id="Tables">
<sch:rule context="tei:table">
<sch:assert test="tei:head">A &lt;table> should have a caption, using a &lt;head>
element</sch:assert>
<sch:report test="parent::tei:body">Do not use tables to lay out the document body</sch:report>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>
</egXML>
Expand Down
47 changes: 17 additions & 30 deletions P5/Source/Specs/att.identified.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,33 @@ $Date$
$Id$
-->
<?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"?>
<classSpec xmlns="http://www.tei-c.org/ns/1.0" module="tagdocs" type="atts" ident="att.identified">
<desc versionDate="2021-08-22" xml:lang="en">provides identifying attributes for elements which can be
subsequently referenced by means of a <att>key</att>
attribute.</desc>
<desc versionDate="2007-12-20" xml:lang="ko"><att>key</att> 속성에
의해 참조될 수 있는 요소의 속성을 제시한다.</desc>
<desc versionDate="2007-05-02" xml:lang="zh-TW">可利用屬性
<att>key</att>來參照的元素</desc>
<classSpec xmlns="http://www.tei-c.org/ns/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" module="tagdocs" type="atts" ident="att.identified">
<desc versionDate="2021-08-22" xml:lang="en">provides identifying attributes for elements which can be subsequently referenced by means of a <att>key</att> attribute.</desc>
<desc versionDate="2007-12-20" xml:lang="ko"><att>key</att> 속성에 의해 참조될 수 있는 요소의 속성을 제시한다.</desc>
<desc versionDate="2007-05-02" xml:lang="zh-TW">可利用屬性 <att>key</att>來參照的元素</desc>
<desc versionDate="2022-05-09" xml:lang="ja">後で<att>key</att>属性によって参照されうる要素を指定する属性を示す。</desc>
<desc versionDate="2007-06-12" xml:lang="fr">fournit les attributs
pour des éléments référençables au moyen d'un attribut
<att>key</att>.</desc>
<desc versionDate="2007-05-04" xml:lang="es">elementos a los que se
puede hacer referencia a través del atributo <att>key</att>.</desc>
<desc versionDate="2007-01-21" xml:lang="it">elementi ai quali si
può fare riferimento tramite l'attributo <att>key</att>
</desc>
<desc versionDate="2007-06-12" xml:lang="fr">fournit les attributs pour des éléments référençables au moyen d'un attribut <att>key</att>.</desc>
<desc versionDate="2007-05-04" xml:lang="es">elementos a los que se puede hacer referencia a través del atributo <att>key</att>.</desc> <desc versionDate="2007-01-21" xml:lang="it">elementi ai quali si può fare riferimento tramite l'attributo <att>key</att></desc>
<classes>
<memberOf key="att.combinable"/>
</classes>
<constraintSpec ident="spec-in-module" scheme="schematron">
<constraint>
<rule xmlns="http://purl.oclc.org/dsdl/schematron" context="tei:elementSpec[@module]|tei:classSpec[@module]|tei:macroSpec[@module]">
<assert test="(not(ancestor::tei:schemaSpec | ancestor::tei:TEI | ancestor::tei:teiCorpus)) or (not(@module) or (not(//tei:moduleSpec) and not(//tei:moduleRef)) or (//tei:moduleSpec[@ident = current()/@module]) or (//tei:moduleRef[@key = current()/@module]))">
Specification <value-of select="@ident"/>: the value of the module attribute ("<value-of select="@module"/>")
<sch:constraint>
<sch:rule context="tei:elementSpec[@module]|tei:classSpec[@module]|tei:macroSpec[@module]">
<sch:assert test="(not(ancestor::tei:schemaSpec | ancestor::tei:TEI | ancestor::tei:teiCorpus)) or (not(@module) or (not(//tei:moduleSpec) and not(//tei:moduleRef)) or (//tei:moduleSpec[@ident = current()/@module]) or (//tei:moduleRef[@key = current()/@module]))">
Specification <sch:value-of select="@ident"/>: the value of the module attribute ("<sch:value-of select="@module"/>")
should correspond to an existing module, via a moduleSpec or
moduleRef</assert>
</rule>
</constraint>
moduleRef</sch:assert>
</sch:rule>
</sch:constraint>
</constraintSpec>
<attList>
<attDef ident="ident" usage="req">
<desc versionDate="2012-12-27" xml:lang="en">supplies the identifier by which this element may be referenced.</desc>
<desc versionDate="2007-12-20" xml:lang="ko">이 요소가 참조된 확인소를 제공한다.</desc>
<desc versionDate="2007-05-02" xml:lang="zh-TW">提供被參照的元素的識別符號。</desc>
<desc versionDate="2008-04-05" xml:lang="ja">当該要素を参照する識別子を示す。</desc>
<desc versionDate="2007-06-12" xml:lang="fr">fournit l'identifiant qui référence cet
élément.</desc>
<desc versionDate="2007-06-12" xml:lang="fr">fournit l'identifiant qui référence cet élément.</desc>
<desc versionDate="2007-05-04" xml:lang="es">proporciona el identificador utilizado para indicar un elemento.</desc>
<desc versionDate="2007-01-21" xml:lang="it">specifica l'identificatore utilizzato per indicare l'elemento</desc>
<datatype><dataRef key="teidata.name"/></datatype>
Expand All @@ -54,8 +43,7 @@ should correspond to an existing module, via a moduleSpec or
<ident type="module">tei</ident> infrastructure module.</desc>
<desc versionDate="2007-12-20" xml:lang="ko"><ident type="module">tei</ident> 하부구조 모듈에서 이 대상이 미리 선언되어야 하는지를 설명한다.</desc>
<desc versionDate="2007-05-02" xml:lang="zh-TW">說明該元素集是否為全域元素集,並必須在核心中宣告。</desc>
<desc versionDate="2008-04-05" xml:lang="ja">当該オブジェクトが、<ident type="module">TEI</ident>基盤モジュー
ルで事前に宣言されるべきかどうかを示す。</desc>
<desc versionDate="2008-04-05" xml:lang="ja">当該オブジェクトが、<ident type="module">TEI</ident>基盤モジュー ルで事前に宣言されるべきかどうかを示す。</desc>
<desc versionDate="2009-05-27" xml:lang="fr">précise si cet objet nécessite une prédéfinition dans le module d'infrastructure <ident type="module">tei</ident>.</desc>
<desc versionDate="2007-05-04" xml:lang="es">declara si la clase debe ser considerada global y por tanto definida en el módulo core</desc>
<desc versionDate="2007-01-21" xml:lang="it">dichiara se la classe debba essere considerata globale e quindi definita nel modulo core</desc>
Expand All @@ -67,11 +55,10 @@ should correspond to an existing module, via a moduleSpec or
<desc versionDate="2007-12-20" xml:lang="ko">이 대상이 정의되어야 하는 모듈명을 제시한다.</desc>
<desc versionDate="2007-05-02" xml:lang="zh-TW">提供定義該元素的模組名稱。</desc>
<desc versionDate="2008-04-05" xml:lang="ja">当該オブジェクトが定義されているモジュール名を示す。</desc>
<desc versionDate="2007-06-12" xml:lang="fr">fournit le nom du module dans lequel doit
être défini cet objet.</desc>
<desc versionDate="2007-06-12" xml:lang="fr">fournit le nom du module dans lequel doit être défini cet objet.</desc>
<desc versionDate="2007-05-04" xml:lang="es">proporciona el nombre del módulo en que el objeto debe ser definido.</desc>
<desc versionDate="2007-01-21" xml:lang="it">indica il nome del modulo nel quale l'oggetto deve essere definito</desc>
<datatype><dataRef key="teidata.xmlName"/></datatype>
</attDef>
</attList>
</classSpec>
</classSpec>
14 changes: 7 additions & 7 deletions P5/Source/Specs/moduleRef.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ $Id$
<datatype minOccurs="0" maxOccurs="1"><dataRef key="teidata.xmlName"/></datatype>
<constraintSpec scheme="schematron" ident="not-same-prefix">
<constraint>
<rule xmlns="http://purl.oclc.org/dsdl/schematron" context="tei:moduleRef">
<report test="//*[ not( generate-id(.) eq generate-id( current() ) ) ]/@prefix = @prefix">The prefix attribute
<sch:rule xmlns="http://purl.oclc.org/dsdl/schematron" context="tei:moduleRef">
<sch:report test="//*[ not( generate-id(.) eq generate-id( current() ) ) ]/@prefix = @prefix">The prefix attribute
of <sch:name/> should not match that of any other
element (it would defeat the purpose)</report>
</rule>
element (it would defeat the purpose)</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec scheme="schematron" ident="not-except-and-include">
<constraint>
<rule xmlns="http://purl.oclc.org/dsdl/schematron" context="tei:moduleRef">
<report test="@except and @include">It is an error to supply both the @include and @except attributes</report>
</rule>
<sch:rule xmlns="http://purl.oclc.org/dsdl/schematron" context="tei:moduleRef">
<sch:report test="@except and @include">It is an error to supply both the @include and @except attributes</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
<remarks versionDate="2011-09-21" xml:lang="en">
Expand Down

0 comments on commit 5a517ef

Please sign in to comment.