Closed sydb closed 1 year ago
Actually, the work is already done, but it is internally inconsistent. Here are the three constraint specifications from dataFacet.xml.
restrictDataFacet:
<sch:rule context="tei:dataRef[tei:dataFacet]">
<sch:assert test="@name" role="nonfatal">Data facets can only be specified for references to datatypes specified by
XML Schemas: Part 2: Datatypes</sch:assert>
</sch:rule>
restrictAttRestriction:
<sch:rule context="tei:dataRef[tei:dataFacet]">
<sch:report test="@restriction" role="nonfatal">The attribute restriction cannot be used when dataFacet elements are present.</sch:report>
</sch:rule>
restrictAttResctrictionName:
<sch:rule context="tei:dataRef">
<sch:report test="@restriction and not(@name)" role="fatal">The attribute restriction can only be used with a name attribute.</sch:report>
</sch:rule>
@context
and one in @test
; the third tests one condition in the @context
and two in the @test
.<dataRef>
specify an XSD datatype by use of @name
), but in the first case describes it by the kind of datatype referred to (XSD), and in the third by the attribute used to refer to it (@name
).
Should have Schematron to enforce
<dataFacet>
or@restriction
can occur iff@name
, as the remarks in the dataRef tagdoc make clear.(Note that #1744 may have some bearing on this, but it will take a long time, and thus should not stop us from an explicit constraint on the current system.)