Skip to content

Commit e87b81f

Browse files
committed
Address #2543:
Added constraint to limit use of attributes of the elementRef element
1 parent 43e2037 commit e87b81f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

P5/Source/Specs/elementRef.xml

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
<memberOf key="model.contentPart"/>
1111
</classes>
1212
<content><empty/></content>
13+
<constraintSpec ident="only_sensible_attrs" scheme="schematron">
14+
<constraint>
15+
<sch:pattern>
16+
<sch:rule context="tei:elementRef[ parent::schemaSpec | parent::specGrp ]">
17+
<sch:report test="@minOccurs | @maxOccurs" role="error">An element reference is not repeatable when part of a schema specification (and thus this &lt;elementRef> should not have @minOccurs or @maxOccurs).</sch:report>
18+
</sch:rule>
19+
<sch:rule context="tei:content//tei:elementRef">
20+
<sch:report test="@source" role="error">An element reference within a content model must refer to a locally defined element specification (and thus this &lt;elementRef> should not have @source).</sch:report>
21+
</sch:rule>
22+
</sch:pattern>
23+
</constraint>
24+
</constraintSpec>
1325
<attList>
1426
<attDef ident="key" usage="req">
1527
<desc versionDate="2010-05-11" xml:lang="en">the identifier used for the required element within the
@@ -40,4 +52,4 @@
4052
<listRef>
4153
<ptr target="#TDmodules"/>
4254
</listRef>
43-
</elementSpec>
55+
</elementSpec>

0 commit comments

Comments
 (0)