Skip to content

Commit

Permalink
add teitalks ODD
Browse files Browse the repository at this point in the history
  • Loading branch information
lb42 committed May 10, 2015
1 parent a10f24e commit 8a2560a
Show file tree
Hide file tree
Showing 7 changed files with 10,568 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# schema

Ce répertoire contiendrait les schémas pour les "talks"
Ce répertoire contient la source des schémas utilises pour les "talks"
Il pourrait ensuite être inclus en tant que sous-module dans les présentations (http://git-scm.com/book/en/v2/Git-Tools-Submodules)

Ce répertoire pourrait contenir :
- un schéma ODD `teiTalks.odd.xml`
Ce répertoire contient :
- un schéma ODD `teitalks.odd`
- des regles schematron `teitalks.isosch`
- des versions RELAXNg du schema teitalk.rnc et teitalks.rng

Pas encore utilises:
- un répertoire de sortie `out/` pour les différents schémas générés (RelaxNG, etc.)
- un fichier make pour la génération des schémas


166 changes: 166 additions & 0 deletions teitalks.isosch
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<title>ISO Schematron rules</title>
<!-- This file generated 2014-10-12T21:34:01.915+01:00 by 'extract-isosch.xsl'. -->

<!-- ********************* -->
<!-- namespaces, declared: -->
<!-- ********************* -->
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
<ns prefix="rng" uri="http://relaxng.org/ns/structure/1.0"/>
<ns prefix="s" uri="http://www.ascc.net/xml/schematron"/>
<ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
<ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>

<!-- ********************* -->
<!-- namespaces, implicit: -->
<!-- ********************* -->
<ns prefix="dcr" uri="http://www.isocat.org/ns/dcr"/>
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<ns prefix="teix" uri="http://www.tei-c.org/ns/Examples"/>
<ns prefix="xi" uri="http://www.w3.org/2001/XInclude"/>

<!-- ************ -->
<!-- constraints: -->
<!-- ************ -->
<pattern id="teitalks-att.datable-calendar-constraint-calendar-1">
<rule context="tei:*[@calendar]">
<assert test="string-length(.) gt 0">
@calendar indicates the system or calendar to which the date represented by the content of this element
belongs, but this <name/> element has no textual content.</assert>
</rule>
</pattern>
<pattern id="teitalks-att.typed-constraint-subtypeTyped-2">
<rule context="*[@subtype]">
<assert test="@type">The <name/> element should not be categorized in detail with @subtype
unless also categorized in general with @type</assert>
</rule>
</pattern>
<pattern id="teitalks-att.pointing-targetLang-constraint-targetLang-3">
<rule context="tei:*[not(self::tei:schemaSpec)][@targetLang]">
<assert test="count(@target)">@targetLang can only be used if @target is specified.</assert>
</rule>
</pattern>
<pattern id="teitalks-att.spanning-spanTo-constraint-spanTo-2-4">
<rule context="tei:*[@spanTo]">
<assert test="id(substring(@spanTo,2)) and following::*[@xml:id=substring(current()/@spanTo,2)]">
The element indicated by @spanTo (<value-of select="@spanTo"/>) must follow the current element <name/>
</assert>
</rule>
</pattern>
<pattern id="teitalks-att.styleDef-schemeVersion-constraint-schemeVersionRequiresScheme-5">
<rule context="tei:*[@schemeVersion]">
<assert test="@scheme and not(@scheme = 'free')">
@schemeVersion can only be used if @scheme is specified.
</assert>
</rule>
</pattern>
<pattern id="teitalks-ptr-constraint-ptrAtts-6">
<rule context="tei:ptr">
<report test="@target and @cRef">Only one of the
attributes @target and @cRef may be supplied on <name/>.</report>
</rule>
</pattern>
<pattern id="teitalks-ref-constraint-refAtts-7">
<rule context="tei:ref">
<report test="@target and @cRef">Only one of the
attributes @target' and @cRef' may be supplied on <name/>
</report>
</rule>
</pattern>
<pattern id="teitalks-list-constraint-gloss-list-must-have-labels-8">
<rule context="tei:list[@type='gloss']">
<assert test="tei:label">The content of a "gloss" list should include a sequence of one or more pairs of a label element followed by an item element</assert>
</rule>
</pattern>
<pattern id="teitalks-quotation-constraint-quotationContents-9">
<rule context="tei:quotation">
<report test="not(@marks) and not (tei:p)">
On <name/>, either the @marks attribute should be used, or a paragraph of description provided</report>
</rule>
</pattern>
<pattern id="teitalks-att.identified-constraint-spec-in-module-12">
<rule 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"/>")
should correspond to an existing module, via a moduleSpec or
moduleRef</assert>
</rule>
</pattern>
<pattern id="teitalks-att.deprecated-validUntil-constraint-deprecated-13">
<rule context="tei:*[@validUntil]">
<assert test="@validUntil cast as xs:date ge current-date()">
<value-of select="if (@ident) then concat('The ',@ident) else concat('This ',local-name(.),' of ',ancestor::tei:*[@ident][1]/@ident)"/>
construct is outdated (as of <value-of select="@validUntil"/>); ODD processors may ignore it, and its use is no longer supported</assert>
<assert role="nonfatal"
test="@validUntil cast as xs:date ge (current-date() + (60*xs:dayTimeDuration('P1D')))">
<value-of select="if (@ident) then concat('The ',@ident) else concat('This ',local-name(.),' of ',ancestor::tei:*[@ident][1]/@ident)"/> construct becomes outdated on <value-of select="@validUntil"/>
</assert>
</rule>
</pattern>
<pattern id="teitalks-moduleRef-constraint-modref-14">
<rule context="tei:moduleRef">
<report test="* and @key">
Child elements of <name/> are only allowed when an external module is being loaded
</report>
</rule>
</pattern>
<pattern id="teitalks-moduleRef-prefix-constraint-not-same-prefix-15">
<rule context="tei:moduleRef">
<report test="//*[ not( generate-id(.) eq generate-id( current() ) ) ]/@prefix = @prefix">The prefix attribute
of <name/> should not match that of any other
element (it would defeat the purpose)</report>
</rule>
</pattern>
<pattern id="teitalks-sequence-constraint-sequencechilden-16">
<rule context="tei:sequence">
<assert test="count(*)&gt;1">The alternate element must have at least two child elements</assert>
</rule>
</pattern>
<pattern id="teitalks-alternate-constraint-alternatechilden-17">
<rule context="tei:alternate">
<assert test="count(*)&gt;1">The alternate element must have at least two child elements</assert>
</rule>
</pattern>
<pattern id="teitalks-constraintSpec-constraint-sch-18">
<rule context="tei:constraintSpec">

<report test="tei:constraint/s:* and not(@scheme='schematron')">
Rules in the Schematron 1.* language must be inside
a constraintSpec with a value of 'schematron' on the scheme attribute
</report>
</rule>
</pattern>
<pattern id="teitalks-constraintSpec-constraint-isosch-19">
<rule context="tei:constraintSpec">

<report test="tei:constraint/sch:* and not(@scheme='isoschematron')">
Rules in the ISO Schematron language must be inside
a constraintSpec with a value of 'isoschematron' on the scheme attribute
</report>
</rule>
</pattern>
<pattern id="teitalks-constraintSpec-constraint-needrules-20">

<rule context="tei:macroSpec/tei:constraintSpec[@scheme='isoschematron']/tei:constraint">
<report test="sch:assert|sch:report">An ISO Schematron constraint specification for a macro should not have an 'assert' or 'report' element without a parent 'rule' element</report>
</rule>
</pattern>

<!-- *********** -->
<!-- deprecated: -->
<!-- *********** -->
<pattern>
<rule context="tei:biblScope">
<report test="@type" role="nonfatal">WARNING: use of deprecated attribute — @type of the biblScope element will be removed from the TEI on 2014-12-17.
</report>
</rule>
</pattern>
<pattern>
<rule context="tei:moduleSpec|tei:schemaSpec|tei:elementSpec|tei:classSpec|tei:macroSpec|tei:constraintSpec">
<report test="@status" role="nonfatal">WARNING: use of deprecated attribute — @status of the <name/> element will be removed from the TEI on 2015-06-19.
</report>
</rule>
</pattern>
</schema>
65 changes: 65 additions & 0 deletions teitalks.nvdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" startMode="tei">
<mode name="nested">
<!-- foreign namespaces used in TEI -->
<namespace ns="http://www.ascc.net/xml/schematron">
<validate schema="schematron.rng"/>
<attach useMode="allow"/>
</namespace>
<namespace ns="http://purl.oclc.org/dsdl/schematron">
<validate schema="iso-schematron.rng"/>
<attach useMode="allow"/>
</namespace>
<namespace ns="http://relaxng.org/ns/structure/1.0">
<validate schema="relax.rng"/>
<attach useMode="allow"/>
</namespace>
<namespace ns="http://relaxng.org/ns/compatibility/annotations/1.0">
<allow/>
</namespace>
<!-- TEI examples -->
<namespace ns="http://www.tei-c.org/ns/Examples">
<validate schema="examples.rng" useMode="nested">
<option name="http://www.thaiopensource.com/validate/feasible"/>
</validate>
<attach useMode="allow"/>
</namespace>
<!-- allow XInclude without checking -->
<namespace ns="http://www.w3.org/2001/XInclude">
<allow/>
</namespace>
<!-- just used in examples, allow anything -->
<namespace ns="http://www.w3.org/1999/xhtml">
<allow/>
</namespace>
<namespace ns="http://www.w3.org/2001/SMIL20/Language">
<allow/>
</namespace>
<namespace ns="http://www.opengis.net/gml">
<allow/>
</namespace>
<namespace ns="http://www.example.org/ns/nonTEI">
<allow/>
</namespace>
<namespace ns="">
<allow/>
</namespace>
<namespace ns="http://www.w3.org/1999/XSL/Transform">
<allow/>
</namespace>
<namespace ns="http://www.gram.org">
<allow/>
</namespace>
</mode>
<mode name="tei">
<namespace ns="http://www.tei-c.org/ns/1.0">
<validate schema="teitalks.isosch" useMode="nested"/>
<validate schema="teitalks.rng" useMode="nested"/>
</namespace>
</mode>
<mode name="allow">
<anyNamespace>
<attach/>
</anyNamespace>
</mode>
</rules>
Loading

0 comments on commit 8a2560a

Please sign in to comment.