Skip to content

Commit

Permalink
Updates for BaseX version 10+: Remove use of db:chop option which was…
Browse files Browse the repository at this point in the history
… removed in BaseX version 10, and test with BaseX version 11.5 using Java version 17 (BaseX 10+ required Java 11+)
  • Loading branch information
vincentml committed Nov 28, 2024
1 parent ea72263 commit bfe7598
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 3 additions & 3 deletions xml-catalog-resolver.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
)
};
Expand All @@ -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) }
)
};

Expand Down

0 comments on commit bfe7598

Please sign in to comment.