Skip to content

Commit

Permalink
feat: soft deprecate Saxon 10 through 12.3 (xspec#1891)
Browse files Browse the repository at this point in the history
Print a console message to recommend migrating from
Saxon 10 through 12.3 to at least 12.4, and to state that
Saxon 9 is not supported.

Note: We currently test with 12.3 for Oxygen 26.0 and 12.4
for the latest 12.x version.

Closes  xspec#1835
  • Loading branch information
galtm committed Mar 22, 2024
1 parent 405fc94 commit ccf150c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/compiler/base/initial-check/perform-initial-check.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

<xsl:variable name="deprecation-warning" as="xs:string?">
<xsl:choose>
<xsl:when test="$x:saxon-version lt x:pack-version((9, 9))">
<xsl:text>Saxon version 9.8 or less is not supported.</xsl:text>
</xsl:when>
<xsl:when test="$x:saxon-version lt x:pack-version((10, 0))">
<xsl:text>Saxon version 9.9 is not recommended. Consider migrating to Saxon 10.</xsl:text>
<xsl:text>Saxon version 9.9 or earlier is not supported.</xsl:text>
</xsl:when>
<xsl:when test="$x:saxon-version lt x:pack-version((12, 4))">
<xsl:text>Saxon version 12.3 or earlier is not recommended. Consider migrating to Saxon 12.4 or later.</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:message>
Expand Down
32 changes: 23 additions & 9 deletions test/win-bats/collection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2060,9 +2060,11 @@
call :run ..\bin\xspec.bat ..\tutorial\escape-for-regex.xspec
call :verify_retval 0

if "%SAXON_VERSION:~0,4%"=="9.9." (
call :verify_line 4 x "WARNING: Saxon version 9.9 is not recommended. Consider migrating to Saxon 10."
) else (
if not "%SAXON_VERSION:~0,3%"=="12." if not "%SAXON_VERSION:~0,2%"=="9." (
call :verify_line 4 x "WARNING: Saxon version 12.3 or earlier is not recommended. Consider migrating to Saxon 12.4 or later."
) else if "%SAXON_VERSION:~0,4%"=="12.3" (
call :verify_line 4 x "WARNING: Saxon version 12.3 or earlier is not recommended. Consider migrating to Saxon 12.4 or later."
) else if not "%SAXON_VERSION:~0,2%"=="9." (
call :verify_line 4 x "Checking for deprecated Saxon versions: Passed"
)

Expand All @@ -2075,8 +2077,12 @@
-->

<case name="No warning on Ant (XSLT) #633">
if "%SAXON_VERSION:~0,4%"=="9.9." (
call :skip "Always expect a deprecation warning on Saxon 9.9"
if not "%SAXON_VERSION:~0,3%"=="12." (
call :skip "Always expect a deprecation warning on Saxon 10 or 11"
goto :EOF
)
if "%SAXON_VERSION:~0,4%"=="12.3" (
call :skip "Always expect a deprecation warning on Saxon 12.3"
goto :EOF
)

Expand All @@ -2097,8 +2103,12 @@
</case>

<case name="No warning on Ant (XQuery) #633">
if "%SAXON_VERSION:~0,4%"=="9.9." (
call :skip "Always expect a deprecation warning on Saxon 9.9"
if not "%SAXON_VERSION:~0,3%"=="12." (
call :skip "Always expect a deprecation warning on Saxon 10 or 11"
goto :EOF
)
if "%SAXON_VERSION:~0,4%"=="12.3" (
call :skip "Always expect a deprecation warning on Saxon 12.3"
goto :EOF
)

Expand All @@ -2119,8 +2129,12 @@
</case>

<case name="No warning on Ant (Schematron) #633">
if "%SAXON_VERSION:~0,4%"=="9.9." (
call :skip "Always expect a deprecation warning on Saxon 9.9"
if not "%SAXON_VERSION:~0,3%"=="12." (
call :skip "Always expect a deprecation warning on Saxon 10 or 11"
goto :EOF
)
if "%SAXON_VERSION:~0,4%"=="12.3" (
call :skip "Always expect a deprecation warning on Saxon 12.3"
goto :EOF
)

Expand Down
29 changes: 20 additions & 9 deletions test/xspec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2218,9 +2218,11 @@ load bats-helper
myrun ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
[ "$status" -eq 0 ]

if [ "${SAXON_VERSION:0:4}" = "9.9." ]; then
[ "${lines[3]}" = "WARNING: Saxon version 9.9 is not recommended. Consider migrating to Saxon 10." ]
else
if [ "${SAXON_VERSION:0:3}" != "12." ] && [ "${SAXON_VERSION:0:2}" != "9." ]; then
[ "${lines[3]}" = "WARNING: Saxon version 12.3 or earlier is not recommended. Consider migrating to Saxon 12.4 or later." ]
elif [ "${SAXON_VERSION:0:4}" = "12.3" ]; then
[ "${lines[3]}" = "WARNING: Saxon version 12.3 or earlier is not recommended. Consider migrating to Saxon 12.4 or later." ]
elif [ "${SAXON_VERSION:0:2}" != "9." ]; then
[ "${lines[3]}" = "Checking for deprecated Saxon versions: Passed" ]
fi

Expand All @@ -2233,8 +2235,11 @@ load bats-helper
#

@test "No warning on Ant (XSLT) #633" {
if [ "${SAXON_VERSION:0:4}" = "9.9." ]; then
skip "Always expect a deprecation warning on Saxon 9.9"
if [ "${SAXON_VERSION:0:3}" != "12." ]; then
skip "Always expect a deprecation warning on Saxon 10 or 11"
fi
if [ "${SAXON_VERSION:0:4}" = "12.3" ]; then
skip "Always expect a deprecation warning on Saxon 12.3"
fi

ant_log="${work_dir}/ant.log"
Expand All @@ -2253,8 +2258,11 @@ load bats-helper
}

@test "No warning on Ant (XQuery) #633" {
if [ "${SAXON_VERSION:0:4}" = "9.9." ]; then
skip "Always expect a deprecation warning on Saxon 9.9"
if [ "${SAXON_VERSION:0:3}" != "12." ]; then
skip "Always expect a deprecation warning on Saxon 10 or 11"
fi
if [ "${SAXON_VERSION:0:4}" = "12.3" ]; then
skip "Always expect a deprecation warning on Saxon 12.3"
fi

ant_log="${work_dir}/ant.log"
Expand All @@ -2273,8 +2281,11 @@ load bats-helper
}

@test "No warning on Ant (Schematron) #633" {
if [ "${SAXON_VERSION:0:4}" = "9.9." ]; then
skip "Always expect a deprecation warning on Saxon 9.9"
if [ "${SAXON_VERSION:0:3}" != "12." ]; then
skip "Always expect a deprecation warning on Saxon 10 or 11"
fi
if [ "${SAXON_VERSION:0:4}" = "12.3" ]; then
skip "Always expect a deprecation warning on Saxon 12.3"
fi

ant_log="${work_dir}/ant.log"
Expand Down

0 comments on commit ccf150c

Please sign in to comment.