Skip to content

Commit

Permalink
Merge branch 'master' into slf4j-simple
Browse files Browse the repository at this point in the history
  • Loading branch information
AirQuick committed May 5, 2023
2 parents 3e0037d + 723f3bc commit 37f05e4
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 136 deletions.
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.0",
"description": "This package is configured only for testing the XSpec repository",
"devDependencies": {
"@commitlint/cli": "^17.6.1",
"@commitlint/config-angular": "^17.6.1",
"@commitlint/cli": "^17.6.3",
"@commitlint/config-angular": "^17.6.3",
"bats": "^1.8.2",
"prettier": "^2.8.8"
},
Expand Down
9 changes: 0 additions & 9 deletions src/compiler/base/combine/mode/check-combined-doc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@

<xsl:if test="namespace-uri-from-QName($qname) eq $x:xspec-namespace">
<xsl:choose>
<xsl:when test="
self::x:param
[parent::x:description]
[local-name-from-QName($qname) eq 'enable-schematron-text-location']">
<!-- Allow it -->
<!-- This global x:param is a private parameter to enable text node @location
in the "skeleton" Schematron implementation. -->
</xsl:when>

<xsl:when test="
self::x:variable
[$is-external]
Expand Down
14 changes: 7 additions & 7 deletions src/schematron/preprocessor.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
map {
'name': 'skeleton',
'stylesheets': [
resolve-uri('../../lib/iso-schematron/iso_dsdl_include.xsl'),
resolve-uri('../../lib/iso-schematron/iso_abstract_expand.xsl'),
resolve-uri('step3.xsl')
resolve-uri('iso-schematron/iso_dsdl_include.xsl'),
resolve-uri('iso-schematron/iso_abstract_expand.xsl'),
resolve-uri('iso-schematron/iso_svrl_for_xslt2.xsl')
]
},
map {
'name': 'schxslt',
'stylesheets': [
resolve-uri('../../lib/schxslt/2.0/include.xsl'),
resolve-uri('../../lib/schxslt/2.0/expand.xsl'),
resolve-uri('../../lib/schxslt/2.0/compile-for-svrl.xsl')
resolve-uri('schxslt/2.0/include.xsl'),
resolve-uri('schxslt/2.0/expand.xsl'),
resolve-uri('schxslt/2.0/compile-for-svrl.xsl')
]
}
)[doc-available(?stylesheets?1)]" static="yes" />
)[doc-available(?stylesheets?1)]" static="yes" xml:base="../../lib/" />
</xsl:stylesheet>
76 changes: 0 additions & 76 deletions src/schematron/step3.xsl

This file was deleted.

6 changes: 3 additions & 3 deletions test/ci/print-env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ java -cp "%XML_RESOLVER_JAR%" org.apache.xml.resolver.Version

echo:
echo === Check BaseX
java -cp "%BASEX_JAR%" org.basex.BaseX -h 2> NUL
java -cp "%BASEX_JAR%" org.basex.BaseX -h

echo:
echo === Check BaseX server start and stop
call "%BASEX_JAR%\..\bin\basexhttp.bat" -S 2> NUL
call "%BASEX_JAR%\..\bin\basexhttpstop.bat" 2> NUL
call "%BASEX_JAR%\..\bin\basexhttp.bat" -S
call "%BASEX_JAR%\..\bin\basexhttpstop.bat"

echo:
echo === Print environment variables
Expand Down
6 changes: 3 additions & 3 deletions test/ci/print-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ java -cp "${XML_RESOLVER_JAR}" org.apache.xml.resolver.Version

echo
echo "=== Check BaseX"
java -cp "${BASEX_JAR}" org.basex.BaseX -h 2> /dev/null
java -cp "${BASEX_JAR}" org.basex.BaseX -h

echo
echo "=== Check BaseX server start and stop"
basex_home=$(dirname -- "${BASEX_JAR}")
"${basex_home}/bin/basexhttp" -S 2> /dev/null
"${basex_home}/bin/basexhttpstop" 2> /dev/null
"${basex_home}/bin/basexhttp" -S
"${basex_home}/bin/basexhttpstop"

echo
echo "=== Print Bats version"
Expand Down
5 changes: 5 additions & 0 deletions test/ci/set-env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ if defined XMLCALABASH_CP if defined SLF4J_DIR (
rem
rem BaseX
rem

rem BaseX 10 requires Java 11
java -version 2>&1 | "%SYSTEMROOT%\system32\find" " 1.8." > NUL
if not errorlevel 1 set BASEX_VERSION=

if defined BASEX_VERSION (
rem Depends on the archive file structure
set "BASEX_JAR=%XSPEC_TEST_DEPS%\basex-%BASEX_VERSION%\basex\BaseX.jar"
Expand Down
6 changes: 6 additions & 0 deletions test/ci/set-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ fi
#
# BaseX
#

# BaseX 10 requires Java 11
if java -version 2>&1 | grep -F " 1.8." > /dev/null; then
unset BASEX_VERSION
fi

if [ -n "${BASEX_VERSION}" ]; then
# Depends on the archive file structure
export BASEX_JAR="${XSPEC_TEST_DEPS}/basex-${BASEX_VERSION}/basex/BaseX.jar"
Expand Down
1 change: 1 addition & 0 deletions test/helper_schematron.xspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xspec-test schematron-preprocessor-step3=${xspec.project.dir}/test/helper_schematron_step3.xsl?>
<x:description schematron="helper.sch" xmlns:items="x-urn:test:xspec-items"
xmlns:mirror="x-urn:test:mirror" xmlns:x="http://www.jenitennison.com/xslt/xspec">

Expand Down
48 changes: 48 additions & 0 deletions test/helper_schematron_step3.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="3.0"
xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:x="http://www.jenitennison.com/xslt/xspec" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!--
This master stylesheet is a privately patched version of the original Schematron Step 3
preprocessor.
-->

<!--
Import the original Schematron Step 3 preprocessor
-->
<xsl:include href="../src/schematron/preprocessor.xsl" />
<xsl:import _href="{$x:schematron-preprocessor?stylesheets?3}" />

<!--
Workaround for $document-uri not expecting the global context item to be absent.
XPDY0002 in this case was implemented probably by https://saxonica.plan.io/issues/5131 on Saxon 10.7.
-->
<xsl:template as="node()+" match="element()" mode="stylesheetbody">
<xsl:variable as="node()+" name="next-match">
<xsl:next-match />
</xsl:variable>

<xsl:for-each select="$next-match">
<xsl:choose>
<xsl:when test="self::xsl:variable[@name eq 'document-uri']">
<xsl:copy>
<xsl:sequence select="attribute()" />

<xsl:comment expand-text="yes">This ${@name} was modified by {static-base-uri()}</xsl:comment>

<!-- Use root() instead of / -->
<axsl:value-of select="document-uri(root())" />
</xsl:copy>
</xsl:when>

<xsl:otherwise>
<xsl:sequence select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
4 changes: 0 additions & 4 deletions test/run-bats.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ if not exist "%SAXON_JAR%" (
exit /b 1
)

rem If Java 8, unset BASEX_JAR because Java 8 is incompatible with BaseX 10
java -version 2>&1 | "%SYSTEMROOT%\system32\find" " 1.8." > NUL
if not errorlevel 1 set BASEX_JAR=

rem Check capabilities
java -cp "%SAXON_JAR%" net.sf.saxon.Version 2>&1 | "%SYSTEMROOT%\system32\find" " 9." > NUL
if not errorlevel 1 set XSLT_SUPPORTS_COVERAGE=1
Expand Down
5 changes: 0 additions & 5 deletions test/run-bats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ if [ ! -f "${SAXON_JAR}" ]; then
exit 1
fi

# If Java 8, unset BASEX_JAR because Java 8 is incompatible with BaseX 10
if java -version 2>&1 | grep -F " 1.8." > /dev/null; then
export BASEX_JAR=
fi

# Check capabilities
if java -cp "${SAXON_JAR}" net.sf.saxon.Version 2>&1 | grep -F " 9." > /dev/null; then
export XSLT_SUPPORTS_COVERAGE=1
Expand Down
4 changes: 1 addition & 3 deletions test/schematron-024.xspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xspec-test require-saxon-bug-4696-fixed?>
<?xspec-test schematron-preprocessor-step3=${xspec.project.dir}/test/schematron/enable-text-location.xsl?>
<x:description schematron="schematron/schematron-024.sch" xmlns:x="http://www.jenitennison.com/xslt/xspec">
<x:param name="only-child-elements">false</x:param>
<x:param name="visit-text">true</x:param>

<!-- Private parameter to enable text node @location in the "skeleton" Schematron implementation -->
<x:param name="x:enable-schematron-text-location" select="true()" />

<x:scenario label="Testing text node location">
<x:context>
<p>foo<span>bar</span>baz</p>
Expand Down
Loading

0 comments on commit 37f05e4

Please sign in to comment.