Skip to content

Commit

Permalink
Fix #631 (I hope):
Browse files Browse the repository at this point in the history
Generate a different RELAX NG pattern (and reference to it) for every occurence of an anyElement element, and update tests to match. (Previously we were trying to generate one for every content model in which an anyElement occurred, but were generation one for every content model in which an anyElement element occurred only once.)
  • Loading branch information
sydb committed Oct 7, 2023
1 parent ce346af commit 522e84e
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 86 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 @@ -7277,7 +7277,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 @@ -4589,7 +4589,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 @@ -6428,7 +6428,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 @@ -5061,7 +5061,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 @@ -4817,7 +4817,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 @@ -4820,7 +4820,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 @@ -4798,7 +4798,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 @@ -6718,7 +6718,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 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_xenoData_1">
<element>
<anyName>
<except>
Expand All @@ -86,7 +86,7 @@
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement-xenoData"/>
<ref name="anyElement_xenoData_1"/>
</choice>
</zeroOrMore>
</element>
Expand Down Expand Up @@ -7019,7 +7019,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="t_att.global.attributes"/>
<ref name="t_att.declarable.attributes"/>
Expand Down
Loading

0 comments on commit 522e84e

Please sign in to comment.