Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore @version of <application> when comparing in tests #650

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading