Skip to content

Commit

Permalink
More work on TEIC#607:
Browse files Browse the repository at this point in the history
Get output to pass tests:
 * Update routine so that it deals with both “P5 Version …” and “Version …”
 * Update Makefile so that test35.rnc has these comments stripped out correctly
 * Update some expected results because of *slight* comment differences that should be ignored
  • Loading branch information
sydb committed May 1, 2023
1 parent f9bd5d5 commit 4d17c5f
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,11 @@ test-namespaces: actual

$(BINDIR)/teitornc $(FLAGS) test35.odd $(AR)/test35.rnc
perl -p -i -e 's/generated from ODD source .*//' $(AR)/test35.rnc
perl -i -pe 'BEGIN{undef $$/;} s/# ?Schema[^#]+#[^#]+#[^#]+#[^#]+#\n//smg' $(AR)/test35.rnc
perl -i -pe 'BEGIN{undef $$/;} s/# ?Schema[^#]+#[^#]+#[^#]+#\n//smg' $(AR)/test35.rnc
if [ $(DIFFNOW) -eq 1 ]; \
then diff -bBw $(AR)/test35.rnc $(ER)/test35.rnc; \
else echo "==deferring: \` diff -bBw $(AR)/test35.rnc $(ER)/test35.rnc \`"; fi

#HBS 2022-04-30 tests attributes @include and @except
$(BINDIR)/teitornc $(FLAGS) testClass.odd $(AR)/testClass.rnc
perl -p -i -e 's/generated from ODD source .*//' $(AR)/testClass.rnc
Expand Down
2 changes: 0 additions & 2 deletions Test/expected-results/test-pure.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xlink = "http://www.w3.org/1999/xlink"


#

sch:ns [ prefix = "tei" uri = "http://www.tei-c.org/ns/1.0" ]
stuff =

Expand Down
2 changes: 0 additions & 2 deletions Test/expected-results/test-pure2.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xlink = "http://www.w3.org/1999/xlink"


#

sch:ns [ prefix = "tei" uri = "http://www.tei-c.org/ns/1.0" ]
stuffPart = bob | bit
stuff =
Expand Down
2 changes: 0 additions & 2 deletions Test/expected-results/test15.odd.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xi = "http://www.w3.org/2001/XInclude"
namespace xlink = "http://www.w3.org/1999/xlink"


#
macro.abContent = (text | model.paraPart | ab)*
macro.paraContent = (text | model.paraPart)*
macro.limitedContent = (text | model.limitedPhrase | model.inter)*
Expand Down
8 changes: 3 additions & 5 deletions Test/expected-results/test21.odd.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xi = "http://www.w3.org/2001/XInclude"
namespace xlink = "http://www.w3.org/1999/xlink"


#
macro.abContent = (text | model.paraPart | ab)*
macro.paraContent = (text | model.paraPart)*
macro.limitedContent = (text | model.limitedPhrase | model.inter)*
Expand Down Expand Up @@ -8093,9 +8091,9 @@ facsimile =
sch:report [
test = "child::text()[ normalize-space(.) ne '']"
"\x{a}" ~
" A facsimile element represents a text with images, thus\x{a}" ~
" transcribed text should not be present within it.\x{a}" ~
" "
" A facsimile element represents a text with images, thus\x{a}" ~
" transcribed text should not be present within it.\x{a}" ~
" "
]
"\x{a}" ~
" "
Expand Down
8 changes: 3 additions & 5 deletions Test/expected-results/test30.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xi = "http://www.w3.org/2001/XInclude"
namespace xlink = "http://www.w3.org/1999/xlink"


#
Tmacro.abContent = (text | Tmodel.paraPart | Tab)*
Tmacro.paraContent = (text | Tmodel.paraPart)*
Tmacro.limitedContent = (text | Tmodel.limitedPhrase | Tmodel.inter)*
Expand Down Expand Up @@ -6488,9 +6486,9 @@ Tfacsimile =
sch:report [
test = "child::text()[ normalize-space(.) ne '']"
"\x{a}" ~
" A facsimile element represents a text with images, thus\x{a}" ~
" transcribed text should not be present within it.\x{a}" ~
" "
" A facsimile element represents a text with images, thus\x{a}" ~
" transcribed text should not be present within it.\x{a}" ~
" "
]
"\x{a}" ~
" "
Expand Down
2 changes: 0 additions & 2 deletions Test/expected-results/test33.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xi = "http://www.w3.org/2001/XInclude"
namespace xlink = "http://www.w3.org/1999/xlink"


#
tei_macro.abContent = (text | tei_model.paraPart | tei_ab)*
tei_macro.paraContent = (text | tei_model.paraPart)*
tei_macro.limitedContent =
Expand Down
2 changes: 0 additions & 2 deletions Test/expected-results/test34.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xi = "http://www.w3.org/2001/XInclude"
namespace xlink = "http://www.w3.org/1999/xlink"


#
tei_macro.abContent = (text | tei_model.paraPart | tei_ab)*
tei_macro.paraContent = (text | tei_model.paraPart)*
tei_macro.limitedContent =
Expand Down
6 changes: 6 additions & 0 deletions debian-tei-xsl/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
tei-xsl (7.56.0a) natty; urgency=low

* new release from upstream

-- TEI <[email protected]> Mon, 01 May 2023 12:16:18 -0400

tei-xsl (7.55.0a) natty; urgency=low

* new release from upstream
Expand Down
4 changes: 2 additions & 2 deletions odds/teiodds.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1869,13 +1869,13 @@ select="$makeDecls"/></xsl:message>
<!-- SB modified 2023-05-01 —
* Simplify code
* Correctly extract only the version number itself per ticket #607
- But note that it is quite fragile, in that it is searching for a very particular string
- Note that we need to be prepared for both "P5 Version&#xA0;…" and just "Version&#xA0;…"
* Normalize space of “TEI Edition” output so it is all on one line
-->
<xsl:variable name="TEIVersion" select="ancestor-or-self::tei:TEI/processing-instruction()[name() eq 'TEIVERSION'][1]"/>
<xsl:variable name="TEIVersion-edition" select="substring-before( $TEIVersion, ' Last')"/>
<xsl:variable name="TEIVersion-datestring" select="concat(' Last', substring-after( $TEIVersion, ' Last') )"/>
<xsl:variable name="TEIVersion-only" select="replace( $TEIVersion-edition, '^P5 Version&#xA0;(\d+\.\d+\.\d+[abABɑΑΒβ]?)\.$', '$1')"/>
<xsl:variable name="TEIVersion-only" select="replace( $TEIVersion-edition, '^(P5 )?Version&#xA0;(\d+\.\d+\.\d+[abABɑΑΒβ]?)\.$', '$2')"/>
<xsl:variable name="versionURL" select="concat( $defaultTEIServer, $TEIVersion-only, '/')"/>
<xsl:sequence select="'&#x0A;TEI Edition: '||normalize-space($TEIVersion)"/>
<xsl:sequence select="'&#x0A;TEI Edition Location: '||$versionURL"/>
Expand Down

0 comments on commit 4d17c5f

Please sign in to comment.