Skip to content

Upgrade Saxon-HE from 9.9 to 12.5; eliminate exist-saxon-regex fork#6212

Open
joewiz wants to merge 2 commits intoeXist-db:developfrom
joewiz:v2/saxon-12-upgrade
Open

Upgrade Saxon-HE from 9.9 to 12.5; eliminate exist-saxon-regex fork#6212
joewiz wants to merge 2 commits intoeXist-db:developfrom
joewiz:v2/saxon-12-upgrade

Conversation

@joewiz
Copy link
Copy Markdown
Member

@joewiz joewiz commented Apr 6, 2026

Summary

Upgrades Saxon-HE from 9.9.1-8 to 12.5, eliminating the exist-saxon-regex fork module. Includes regex API migration for fn:replace/fn:matches/fn:analyze-string (StringView/UnicodeString API).

What Changed

  • Saxon-HE 9.9.1-8 → 12.5
  • exist-saxon-regex module removed (Saxon 12 has the needed regex classes)
  • fn:replace, fn:matches, fn:analyze-string: migrated to Saxon 12 regex API
  • fn:replace function-replacement callbacks: updated for UnicodeString parameters
  • Unicode block name fallback (\p{Is...}\p{In...}) preserved

Tests

  • exist-core: 6,746 run, 0 failures, 0 errors
  • Codacy: 0 new issues

Test plan

  • exist-core unit tests pass (6,746 run, 0 failures)
  • fn:replace with replacement functions works
  • Regex patterns with Unicode blocks work
  • No Saxon API deprecation warnings in logs

🤖 Generated with Claude Code

joewiz and others added 2 commits April 13, 2026 09:25
…egex fork

Upgrade Saxon-HE from 9.9.1-8 to 12.5 and remove the exist-saxon-regex
fork (org.exist-db:exist-saxon-regex:9.4.0-9.e1), a copy of Saxon 9.4's
internal regex classes that has been maintained separately for over a decade.
Saxon 12's public regex API makes the fork unnecessary.

Saxon 12 API migration:
- FastStringBuffer removed: use FloatValue.floatToString() and
  DoubleValue.doubleToString() for XPath-compliant formatting
- Regex APIs now take UnicodeString: wrap with StringView.of()
- XPathException.getErrorCodeLocalPart() replaced by
  getErrorCodeQName().getLocalPart()
- RegexIterator.MatchHandler moved to top-level RegexMatchHandler
- Xslt30Transformer.setInitialMode() now throws SaxonApiException
- Saxon 12 rejects duplicate document-URIs in the document pool
- Saxon 12 rejects null URIResolver and explicit xml namespace
  declarations in DOM and SAX pipelines
- Saxon 12's LinkedTreeBuilder rejects duplicate startDocument events

exist-saxon-regex replaced by Saxon 12's JavaRegularExpression API.

Full exist-core test suite: 6533 tests, 0 failures, 0 errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Gate FORX0003 (empty-matching regex) on XQuery version in FunReplace
  and FunTokenize: raise the error in XQ 3.1 mode, allow empty matches
  in XQ 4.0 mode
- Add xquery version "4.0" support to XQueryTree.g tree walker
- Declare replace.xqm test module as xquery version "4.0"
- Fix unnecessary FQN in FunReplace (PMD)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@joewiz joewiz force-pushed the v2/saxon-12-upgrade branch from de5057f to b11bb87 Compare April 13, 2026 13:26
joewiz added a commit to joewiz/exist that referenced this pull request Apr 14, 2026
… update statuses

- Replace closed eXist-db#6213 (v2/jetty-12-upgrade) with eXist-db#6145 (feature/websocket-core)
- Add CI Health Note explaining known noise: integration hangs, container image
  HTTP 502, XQTS runner Saxon 12 crash, and complementary empty-match failures
  in eXist-db#6212/eXist-db#6218
- Update XQTS runner: eXist-db#45 closed, eXist-db#49 is the active PR
- Update cross-repo PR table accordingly
- Update "Also Ready to Merge" table: mark eXist-db#6142, eXist-db#6146 merged; eXist-db#6186 superseded
  by eXist-db#6224; correct eXist-db#6087 approver; add status notes for eXist-db#6182, eXist-db#6184

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@joewiz joewiz marked this pull request as ready for review April 14, 2026 13:43
@joewiz joewiz requested a review from a team as a code owner April 14, 2026 13:43
@joewiz
Copy link
Copy Markdown
Member Author

joewiz commented Apr 14, 2026

[This response was co-authored with Claude Code. -Joe]

CI state: 6/9 checks pass. Of the 3 failures:

  • 1 (windows integration) is a pre-existing test hang
  • 1 (W3C XQuery Test Suite) is the XQTS runner crashing with NoSuchMethodError: AnyURIValue.<init>(CharSequence) — the CI runner still uses the Saxon 9.9 API against the Saxon 12 classpath. exist-xqts-runner #49 adds Saxon 12 compatibility and should merge alongside this PR.
  • 1 (ubuntu unit) is replace.empty-match-fails — Saxon 12 now permits empty-match patterns where Saxon 9.9 raised FORX0003. The XQ 3.1 / XQ 4.0 version-gating for this behavior lives in #6218 (v2/xq4-core-functions). These two PRs have complementary failures that cancel out when merged together.

Dependencies: Wave 2 (independent of other v2/ PRs, but should merge before the grammar PRs in Wave 3). Pair with exist-xqts-runner #49 for XQTS coverage.

For full context on all 7.0 PRs and the merge order, see the Reviewer Guide.

@duncdrum duncdrum added dependencies Pull requests that update a dependency file java Issues or pull requests that change Java code or are related to the JVM labels Apr 14, 2026
@duncdrum duncdrum added this to v7.0.0 Apr 14, 2026
@duncdrum duncdrum moved this to Ready in v7.0.0 Apr 14, 2026
@duncdrum duncdrum added this to the eXist-7.0.0 milestone Apr 14, 2026
@duncdrum duncdrum added ON-HOLD Do not pull-in and removed ON-HOLD Do not pull-in labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file java Issues or pull requests that change Java code or are related to the JVM

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

2 participants