[feature] Add EXPath File Module 4.0 as built-in extension module#6257
[feature] Add EXPath File Module 4.0 as built-in extension module#6257joewiz wants to merge 3 commits into
Conversation
Port the EXPath File Module (http://expath.org/ns/file) from a standalone XAR package (eXist-db/exist-file) to a built-in extension module. This makes the module available out of the box without requiring XAR installation. The EXPath File Module implements the EXPath File Module 4.0 specification and coexists with eXist's native file module (http://exist-db.org/xquery/file) since they use different namespace URIs. Source: https://github.com/eXist-db/exist-file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The module was only registered in the distribution conf.xml but not in any test conf.xml files. The XQTS runner uses the test conf.xml, so all EXPath File tests fail with "unknown function" errors without this. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@joewiz I m a bit lost with this and the companion PR. I know the xq4 includes expath binary functions, should these PRs wait until XQ4? Why the split? |
|
@duncdrum The reason I returned to the idea of adding this (EXPath File) and EXPath Bin to eXist (as opposed to as separate packages) is that the QT4 tests of the |
|
Also relevant: qt4cg/qtspecs#2603 makes EXPath Bin and File optional for implementations, though since we have them and they are well tested, with up-to-date tests, in XQTS, having these in eXist (as opposed to in packages) seems like a win-win for testing and access. This PR sets the namespace prefix for EXPath File to |
|
Yes I would be very in favor of pulling in an xquery 3.1 implementation for 7.0.0 |
| final StringBuilder regex = new StringBuilder(); | ||
| for (int i = 0; i < glob.length(); i++) { | ||
| final char c = glob.charAt(i); | ||
| switch (c) { |
Addresses reinhapa's review on PR eXist-db#6257 (FileManipulation.java:511). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
[This response was co-authored with Claude Code. -Joe] Done in Separately on @duncdrum's question about whether this PR should wait until XQ 4.0: per your follow-up "Yes I would be very in favor of pulling in an xquery 3.1 implementation for 7.0.0" — that's the direction we'll take. Preparing a follow-up commit that converts the PR from XQ 4.0 record types to XQ 3.1 map types so it lands cleanly under 3.1 for the eXist 7 release. That'll be its own commit on this branch. |
|
[This response was co-authored with Claude Code. -Joe] Following up on Duncan's "should this wait until XQ 4.0?" question with concrete data: I ran the EXPath File 4.0 QT4 test suite against this PR's branch with the develop runtime (Saxon 9.9.1-8). Result: 174 of 190 tests pass (91.6%). Decomposing the 16 failures:
Static analysis also confirmed: the PR uses zero XQ 4.0-specific syntax — no record types, no XQ 4.0 numeric literals, no |
Summary
http://expath.org/ns/file) from a standalone XAR package (eXist-db/exist-file) to a built-in extension modulehttp://exist-db.org/xquery/file) since they use different namespace URIsWhat Changed
New module:
extensions/modules/expath-file/eXist-db/exist-file(48 functions)exist-expath-fileRegistration:
extensions/modules/pom.xml— addedexpath-filemoduleexist-distribution/pom.xml— addedexist-expath-fileruntime dependencyexist-distribution/src/main/config/conf.xml— registeredhttp://expath.org/ns/fileCoexistence with Legacy Module
Both modules can be used simultaneously — they have different namespace URIs:
XQTS Impact
The QT4 test suite contains 190 EXPath File tests (
expath-filetest set) and 574 EXPath Binary tests (27bin-*test sets) — 764 tests total across both modules. These tests currently all fail because the modules aren't available to the XQTS runner. Making them built-in extension modules resolves this. The standalone XAR achieved 96.3% compliance (183/190).Spec References
Test Plan
expath-filetest set (after merge to integration branch)🤖 Generated with Claude Code