Skip to content

Commit

Permalink
Merge pull request #650 from TEIC/sydb_646
Browse files Browse the repository at this point in the history
ignore `@version` of `<application>` when comparing in tests
  • Loading branch information
raffazizzi authored Jan 26, 2024
2 parents 6f17be9 + ecee7bf commit ef14844
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 17 deletions.
1 change: 1 addition & 0 deletions Test/cleanup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
s/SAXON HE 9.*//;
s/XSLT stylesheets version [1-9].*//;
s/on 20[0-9][0-9].[0-9][0-9].[0-9][0-9]T.*Z\.?//;
s/(<application.*version\s*=\s*)['"][0-9.a-z]+['"]/$1"9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22"/;
print;
}
2 changes: 1 addition & 1 deletion Test/expected-results/hyperlinktest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test-indexes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test-rtf2tei.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test11a.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test18.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test19.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test29.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test37.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test39.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
2 changes: 1 addition & 1 deletion Test/expected-results/test40.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
20 changes: 18 additions & 2 deletions Test2/cleanForDiff.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

4. Remove any timestamps that are generated during processing, since
these will be different each time a test is run.

5. Replace the value of the @version attribute of any &lt;application>
elements that have “tei” (case insensitive) in either their @xml:id
or @ident attribute with a dummy value (per issue #646).
</xd:p>
</xd:desc>
</xd:doc>
Expand Down Expand Up @@ -64,12 +68,24 @@
<xsl:copy-of select="@*"/>
</xsl:copy>
</xsl:template>


<!-- And versions from <application>s we (probably) inserted. -->
<xsl:template match="tei:application[ matches( string-join( ( @xml:id, '␝', @ident ) ), 'tei', 'i') ]">
<!-- Note that any character legal in an XML attribute could
be used to separate the @xml:id from the @ident, above,
EXCEPT one of ‘t’, ‘T’, ‘e’, ‘E’, ‘i’, or ‘I’. -->
<xsl:copy>
<xsl:copy-of select="@* except @version"/>
<xsl:attribute name="version" select="'9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22'"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

<!-- Default identity transform. -->
<xsl:template match="@* | node()" priority="-1" mode="#all">
<xsl:copy>
<xsl:apply-templates mode="#current" select="@*|node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
</xsl:stylesheet>
4 changes: 3 additions & 1 deletion Test2/expected-results/testDocxIndexes1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei"
ident="TEI_fromDOCX"
version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
4 changes: 3 additions & 1 deletion Test2/expected-results/testDocxListsTables1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei"
ident="TEI_fromDOCX"
version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
4 changes: 3 additions & 1 deletion Test2/expected-results/testNotes2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei"
ident="TEI_fromDOCX"
version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down
4 changes: 3 additions & 1 deletion Test2/expected-results/testShelfmarkMs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</fileDesc>
<encodingDesc>
<appInfo>
<application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
<application xml:id="docxtotei"
ident="TEI_fromDOCX"
version="9thisisaplaceholder88.777soisthis6666.55555thistoo4444.333lastone22">
<label>DOCX to TEI</label>
</application>
</appInfo>
Expand Down

0 comments on commit ef14844

Please sign in to comment.