From bfe75982eff81e4767588c6e72627f9c969e1a7b Mon Sep 17 00:00:00 2001 From: Vincent Lizzi Date: Wed, 27 Nov 2024 23:37:56 -0500 Subject: [PATCH] Updates for BaseX version 10+: Remove use of db:chop option which was removed in BaseX version 10, and test with BaseX version 11.5 using Java version 17 (BaseX 10+ required Java 11+) --- .github/workflows/test.yml | 5 ++++- README.md | 2 +- build.gradle | 2 +- xml-catalog-resolver.xqm | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56964ef..b2f1bb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,10 @@ jobs: strategy: matrix: java: ["8", "17"] - basex: ["9.7", "9.7.3"] + basex: ["9.7", "9.7.3", "11.5"] + exclude: + - basex: "11.5" + java: "8" steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/README.md b/README.md index 3190d17..1cc8758 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![test status](https://github.com/vincentml/xml-catalog-resolver/actions/workflows/test.yml/badge.svg) -This module provides an XML Catalog Resolver in the XQuery programming language. This module was created using [BaseX](https://basex.org/) version 9.7.3. +This module provides an XML Catalog Resolver in the XQuery programming language. This module was created using [BaseX](https://basex.org/) version 9.7.3, and has been updated for BaseX version 11.5. ## Purpose diff --git a/build.gradle b/build.gradle index df7a716..7e2f260 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ repositories { } } -def basexVersion = System.getenv('BASEX_VERSION') ?: "9.7.3" +def basexVersion = System.getenv('BASEX_VERSION') ?: "11.5" dependencies { runtimeOnly "org.basex:basex:${basexVersion}" diff --git a/xml-catalog-resolver.xqm b/xml-catalog-resolver.xqm index 1a0d428..1413d32 100644 --- a/xml-catalog-resolver.xqm +++ b/xml-catalog-resolver.xqm @@ -2,7 +2,7 @@ : This module provides an XML Resolver for OASIS XML Catalogs entirely in XQuery. : Use this module to resolve the location a DTD specified in a DOCTYPE before parsing XML. : - : Tested with BaseX version 9.7.3. + : Tested with BaseX versions 9.7.3 and 11.5 : May work in other XQuery processors. : : @author Vincent Lizzi @@ -167,7 +167,7 @@ declare function resolver:parse-xml($xml as xs:string, $catalog as xs:string) as let $resolved := resolver:resolveDOCTYPE($raw, $catalog) return ( file:write-text($temp, $resolved), - (# db:dtd true #) (# db:intparse false #) (# db:chop false #) { doc($temp) }, + (# db:dtd true #) (# db:intparse false #) { doc($temp) }, file:delete($temp) ) }; @@ -187,7 +187,7 @@ declare function resolver:parse-xml($xml as xs:string, $catalog as xs:string, $p let $resolved := resolver:resolveDOCTYPE($raw, $catalog) return ( file:write-text($path, $resolved), - (# db:dtd true #) (# db:intparse false #) (# db:chop false #) { doc($path) } + (# db:dtd true #) (# db:intparse false #) { doc($path) } ) };