Skip to content

Commit

Permalink
Merge pull request #632 from TEIC/sydb_631
Browse files Browse the repository at this point in the history
Separate pattern for every instance of <anyElement> — fixes #631 (I hope)
  • Loading branch information
raffazizzi authored Nov 9, 2023
2 parents d466cd2 + 6a81640 commit a495b3c
Show file tree
Hide file tree
Showing 12 changed files with 384 additions and 294 deletions.
6 changes: 3 additions & 3 deletions Test/expected-results/test.rng
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</choice>
</zeroOrMore>
</define>
<define name="anyElement-xenoData">
<define name="anyElement_xenoData_1">
<element>
<anyName>
<except>
Expand All @@ -84,7 +84,7 @@
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_xenoData_1"/>
</choice>
</zeroOrMore>
</element>
Expand Down Expand Up @@ -7290,7 +7290,7 @@ Suggested values include: 1] sent; 2] received; 3] transmitted; 4] redirected; 5
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]</a:documentation>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_xenoData_1"/>
</choice>
<ref name="att.global.attributes"/>
<ref name="att.declarable.attributes"/>
Expand Down
6 changes: 3 additions & 3 deletions Test/expected-results/test15.odd.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ macro.specialPara =
| model.inter
| model.divPart
| model.global)*
anyElement-xenoData =
anyElement_xenoData_1 =
element * - (tei:* | teix:egXML) {
attribute * { text }*,
(text | anyElement-xenoData)*
(text | anyElement_xenoData_1)*
}
att.anchoring.attributes =
att.anchoring.attribute.anchored, att.anchoring.attribute.targetEnd
Expand Down Expand Up @@ -4807,7 +4807,7 @@ xenoData =

## (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]
element xenoData {
(text | anyElement-xenoData),
(text | anyElement_xenoData_1),
att.global.attributes,
att.declarable.attributes,
att.typed.attributes,
Expand Down
6 changes: 3 additions & 3 deletions Test/expected-results/test21.odd.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ macro.specialPara =
| model.divPart
| model.global)*
macro.xtext = (text | model.gLike)*
anyElement-xenoData =
anyElement_xenoData_1 =
element * - (tei:* | teix:egXML) {
attribute * { text }*,
(text | anyElement-xenoData)*
(text | anyElement_xenoData_1)*
}
att.anchoring.attributes =
att.anchoring.attribute.anchored, att.anchoring.attribute.targetEnd
Expand Down Expand Up @@ -6476,7 +6476,7 @@ xenoData =

## (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]
element xenoData {
(text | anyElement-xenoData),
(text | anyElement_xenoData_1),
att.global.attributes,
att.declarable.attributes,
att.typed.attributes,
Expand Down
6 changes: 3 additions & 3 deletions Test/expected-results/test30.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Tmacro.specialPara =
| Tmodel.divPart
| Tmodel.global)*
Tmacro.xtext = (text | Tmodel.gLike)*
anyElement-xenoData =
anyElement_xenoData_1 =
element * - (tei:* | ns2:* | teix:egXML) {
attribute * { text }*,
(text | anyElement-xenoData)*
(text | anyElement_xenoData_1)*
}
Tatt.anchoring.attributes =
Tatt.anchoring.attribute.anchored, Tatt.anchoring.attribute.targetEnd
Expand Down Expand Up @@ -5111,7 +5111,7 @@ TxenoData =

## (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]
element xenoData {
(text | anyElement-xenoData),
(text | anyElement_xenoData_1),
Tatt.global.attributes,
Tatt.declarable.attributes,
Tatt.typed.attributes,
Expand Down
6 changes: 3 additions & 3 deletions Test/expected-results/test33.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ tei_macro.specialPara =
| tei_model.inter
| tei_model.divPart
| tei_model.global)*
anyElement-xenoData =
anyElement_xenoData_1 =
element * - (tei:* | teix:egXML) {
attribute * { text }*,
(text | anyElement-xenoData)*
(text | anyElement_xenoData_1)*
}
tei_att.anchoring.attributes =
tei_att.anchoring.attribute.anchored,
Expand Down Expand Up @@ -4866,7 +4866,7 @@ tei_xenoData =

## (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]
element tei:xenoData {
(text | anyElement-xenoData),
(text | anyElement_xenoData_1),
tei_att.global.attributes,
tei_att.declarable.attributes,
tei_att.typed.attributes,
Expand Down
6 changes: 3 additions & 3 deletions Test/expected-results/test34.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ tei_macro.specialPara =
| tei_model.inter
| tei_model.divPart
| tei_model.global)*
anyElement-xenoData =
anyElement_xenoData_1 =
element * - (tei:* | teix:egXML) {
attribute * { text }*,
(text | anyElement-xenoData)*
(text | anyElement_xenoData_1)*
}
tei_att.anchoring.attributes =
tei_att.anchoring.attribute.anchored,
Expand Down Expand Up @@ -4869,7 +4869,7 @@ tei_xenoData =

## (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]
element xenoData {
(text | anyElement-xenoData),
(text | anyElement_xenoData_1),
tei_att.global.attributes,
tei_att.declarable.attributes,
tei_att.typed.attributes,
Expand Down
6 changes: 3 additions & 3 deletions Test/expected-results/test35.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ tei_macro.specialPara =
| tei_model.inter
| tei_model.divPart
| tei_model.global)*
anyElement-xenoData =
anyElement_xenoData_1 =
element * - (tei:* | teix:egXML) {
attribute * { text }*,
(text | anyElement-xenoData)*
(text | anyElement_xenoData_1)*
}
tei_att.anchoring.attributes =
tei_att.anchoring.attribute.anchored,
Expand Down Expand Up @@ -4847,7 +4847,7 @@ tei_xenoData =

## (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]
element tei:xenoData {
(text | anyElement-xenoData),
(text | anyElement_xenoData_1),
tei_att.global.attributes,
tei_att.declarable.attributes,
tei_att.typed.attributes,
Expand Down
6 changes: 3 additions & 3 deletions Test2/expected-results/testAttValQuant.rng
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</choice>
</zeroOrMore>
</define>
<define name="anyElement-xenoData">
<define name="anyElement_xenoData_1">
<element>
<anyName>
<except>
Expand All @@ -69,7 +69,7 @@
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_xenoData_1"/>
</choice>
</zeroOrMore>
</element>
Expand Down Expand Up @@ -6737,7 +6737,7 @@ Suggested values include: 1] sent; 2] received; 3] transmitted; 4] redirected; 5
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]</a:documentation>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_xenoData_1"/>
</choice>
<ref name="att.global.attributes"/>
<ref name="att.declarable.attributes"/>
Expand Down
63 changes: 54 additions & 9 deletions Test2/expected-results/testPure1.rng
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</choice>
</zeroOrMore>
</define>
<define name="anyElement-xenoData">
<define name="anyElement_address_1">
<element>
<anyName>
<except>
Expand All @@ -86,7 +86,56 @@
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_address_1"/>
</choice>
</zeroOrMore>
</element>
<pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="d9e22543-constraint">
<rule context="tei:address">
<report test="descendant::*[not(namespace-uri(.) = ('https://docbook.org/ns/docbook', 'http://www.tei-c.org/ns/1.0'))]">address descendants must be in the
namespaces
'https://docbook.org/ns/docbook', 'http://www.tei-c.org/ns/1.0'</report>
</rule>
</pattern>
</define>
<define name="anyElement_address_2">
<element>
<anyName>
<except>
<nsName ns="http://www.tei-c.org/ns/1.0"/>
<name ns="http://www.tei-c.org/ns/Examples">egXML</name>
</except>
</anyName>
<zeroOrMore>
<attribute>
<anyName/>
</attribute>
</zeroOrMore>
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement_address_2"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="anyElement_xenoData_3">
<element>
<anyName>
<except>
<nsName ns="http://www.tei-c.org/ns/1.0"/>
<name ns="http://www.tei-c.org/ns/Examples">egXML</name>
</except>
</anyName>
<zeroOrMore>
<attribute>
<anyName/>
</attribute>
</zeroOrMore>
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement_xenoData_3"/>
</choice>
</zeroOrMore>
</element>
Expand Down Expand Up @@ -4523,15 +4572,11 @@ Sample values include: 1] rubbing; 2] mildew; 3] smoke</a:documentation>
<element name="address">
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(address) contains a postal address, for example of a publisher, an organization, or an individual. [3.6.2. Addresses 2.2.4. Publication, Distribution, Licensing, etc. 3.12.2.4. Imprint, Size of a Document, and Reprint Information]</a:documentation>
<group>
<zeroOrMore>
<ref name="t_model.global"/>
</zeroOrMore>
<ref name="anyElement_address_1"/>
<oneOrMore>
<group>
<ref name="t_model.addrPart"/>
<zeroOrMore>
<ref name="t_model.global"/>
</zeroOrMore>
<ref name="anyElement_address_2"/>
</group>
</oneOrMore>
</group>
Expand Down Expand Up @@ -7038,7 +7083,7 @@ Suggested values include: 1] sent; 2] received; 3] transmitted; 4] redirected; 5
<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata]</a:documentation>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_xenoData_3"/>
</choice>
<ref name="t_att.global.attributes"/>
<ref name="t_att.declarable.attributes"/>
Expand Down
Loading

0 comments on commit a495b3c

Please sign in to comment.