From 522e84e35eab9b115ad955574f3912217a153fbb Mon Sep 17 00:00:00 2001 From: Syd Bauman Date: Fri, 6 Oct 2023 21:44:50 -0400 Subject: [PATCH] Fix #631 (I hope): 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.) --- Test/expected-results/test.rng | 6 +- Test/expected-results/test15.odd.rnc | 6 +- Test/expected-results/test21.odd.rnc | 6 +- Test/expected-results/test30.rnc | 6 +- Test/expected-results/test33.rnc | 6 +- Test/expected-results/test34.rnc | 6 +- Test/expected-results/test35.rnc | 6 +- Test2/expected-results/testAttValQuant.rng | 6 +- Test2/expected-results/testPure1.rng | 6 +- odds/odd2relax.xsl | 152 +++++++++++++-------- odds/teiodds.xsl | 15 +- 11 files changed, 135 insertions(+), 86 deletions(-) diff --git a/Test/expected-results/test.rng b/Test/expected-results/test.rng index e2a2bd35c..f116905e0 100644 --- a/Test/expected-results/test.rng +++ b/Test/expected-results/test.rng @@ -68,7 +68,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -7277,7 +7277,7 @@ Suggested values include: 1] sent; 2] received; 3] transmitted; 4] redirected; 5 (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata] - + diff --git a/Test/expected-results/test15.odd.rnc b/Test/expected-results/test15.odd.rnc index 5d8dbe21e..a2844a2ba 100644 --- a/Test/expected-results/test15.odd.rnc +++ b/Test/expected-results/test15.odd.rnc @@ -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 @@ -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, diff --git a/Test/expected-results/test21.odd.rnc b/Test/expected-results/test21.odd.rnc index 33cd31fbd..22a44fbb8 100644 --- a/Test/expected-results/test21.odd.rnc +++ b/Test/expected-results/test21.odd.rnc @@ -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 @@ -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, diff --git a/Test/expected-results/test30.rnc b/Test/expected-results/test30.rnc index 0af31fc7c..d323bc7bd 100644 --- a/Test/expected-results/test30.rnc +++ b/Test/expected-results/test30.rnc @@ -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 @@ -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, diff --git a/Test/expected-results/test33.rnc b/Test/expected-results/test33.rnc index e7a452db1..7fabe7167 100644 --- a/Test/expected-results/test33.rnc +++ b/Test/expected-results/test33.rnc @@ -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, @@ -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, diff --git a/Test/expected-results/test34.rnc b/Test/expected-results/test34.rnc index 2749ee8b6..56f28e374 100644 --- a/Test/expected-results/test34.rnc +++ b/Test/expected-results/test34.rnc @@ -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, @@ -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, diff --git a/Test/expected-results/test35.rnc b/Test/expected-results/test35.rnc index cfba7812e..78716f919 100644 --- a/Test/expected-results/test35.rnc +++ b/Test/expected-results/test35.rnc @@ -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, @@ -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, diff --git a/Test2/expected-results/testAttValQuant.rng b/Test2/expected-results/testAttValQuant.rng index eb6be5e95..06c3c24f9 100644 --- a/Test2/expected-results/testAttValQuant.rng +++ b/Test2/expected-results/testAttValQuant.rng @@ -53,7 +53,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -6718,7 +6718,7 @@ Suggested values include: 1] sent; 2] received; 3] transmitted; 4] redirected; 5 (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata] - + diff --git a/Test2/expected-results/testPure1.rng b/Test2/expected-results/testPure1.rng index 97bb0a7ec..59e5fb99a 100644 --- a/Test2/expected-results/testPure1.rng +++ b/Test2/expected-results/testPure1.rng @@ -70,7 +70,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -7019,7 +7019,7 @@ Suggested values include: 1] sent; 2] received; 3] transmitted; 4] redirected; 5 (non-TEI metadata) provides a container element into which metadata in non-TEI formats may be placed. [2.5. Non-TEI Metadata] - + diff --git a/odds/odd2relax.xsl b/odds/odd2relax.xsl index fc425c21a..bb23356d9 100644 --- a/odds/odd2relax.xsl +++ b/odds/odd2relax.xsl @@ -27,7 +27,7 @@ Unported License http://creativecommons.org/licenses/by-sa/3.0/ 2. http://www.opensource.org/licenses/BSD-2-Clause - + Redistribution and use in source and binary forms, with or without @@ -73,12 +73,12 @@ of this software, even if advised of the possibility of such damage. -1 dtd - + - + @@ -220,9 +220,26 @@ of this software, even if advised of the possibility of such damage. - - - + + + + + + + @@ -242,7 +259,7 @@ of this software, even if advised of the possibility of such damage. Schema generated - + @@ -299,7 +316,7 @@ of this software, even if advised of the possibility of such damage. - + @@ -309,9 +326,9 @@ of this software, even if advised of the possibility of such damage. + select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability"> - This material is dual-licensed. + This material is dual-licensed. @@ -327,14 +344,20 @@ of this software, even if advised of the possibility of such damage. - + - - - - - + + + + + + + + @@ -357,7 +380,10 @@ of this software, even if advised of the possibility of such damage. ' - + + + + @@ -404,8 +430,9 @@ of this software, even if advised of the possibility of such damage. - , 'http://www.tei-c.org/ns/1.0' + + , 'http://www.tei-c.org/ns/1.0' + @@ -477,38 +504,32 @@ of this software, even if advised of the possibility of such damage. + mode='pass2'> - - - + + + - + - - - - - - - + + + - + - + @@ -520,11 +541,28 @@ of this software, even if advised of the possibility of such damage. + + + + + + + + + + + + debug: pass2 has: + + + + + @@ -550,20 +588,20 @@ of this software, even if advised of the possibility of such damage. - + - - - - - - - + + + + + + + @@ -585,7 +623,7 @@ of this software, even if advised of the possibility of such damage. - + - + @@ -650,13 +688,13 @@ of this software, even if advised of the possibility of such damage. prefix --> - - - - + + + + diff --git a/odds/teiodds.xsl b/odds/teiodds.xsl index 6990b6ae7..38f5ee9d9 100644 --- a/odds/teiodds.xsl +++ b/odds/teiodds.xsl @@ -190,6 +190,13 @@ of this software, even if advised of the possibility of such damage. + + + + 0 + + + @@ -328,15 +335,19 @@ of this software, even if advised of the possibility of such damage. + + + + - + - +