Skip to content

Drop the EXPath File module dependency (read JMX token via unparsed-text)#2

Merged
joewiz merged 1 commit into
masterfrom
fix/drop-expath-file-dependency
Jun 6, 2026
Merged

Drop the EXPath File module dependency (read JMX token via unparsed-text)#2
joewiz merged 1 commit into
masterfrom
fix/drop-expath-file-dependency

Conversation

@joewiz
Copy link
Copy Markdown
Owner

@joewiz joewiz commented Jun 6, 2026

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

Drop the EXPath File module dependency (read JMX token via unparsed-text)

modules/app.xqm imported the EXPath File module (http://expath.org/ns/file) solely to read the JMX servlet token file ($EXIST_HOME/data/jmxservlet.token) via file:exists / file:read-text. That module isn't bundled with eXist 7 (eXist-db/exist#6257 is the pending addition), so on eXist 7 the whole module failed to load with XQST0059, breaking the dashboard UI (view.xq → app.xqm).

Change

Replace the two file: calls with the W3C fn:unparsed-text family over a file:// URI, which eXist honors natively for filesystem reads:

file:exists($p)    → unparsed-text-available("file://" || $p)
file:read-text($p) → unparsed-text("file://" || $p)

Token-parsing logic is unchanged. The usage was small (two call sites), so this drops the dependency entirely rather than taking on eXist-db/exist-file as an interim package. The dashboard now runs on stock eXist 7 without the unmerged eXist-db/exist#6257.

Verification

app.xqm now loads (the XQST0059 / expath.org/ns/file error is gone) and unparsed-text("file://" || $token-file) reads the token file correctly (confirmed against $EXIST_HOME/data/jmxservlet.token).

Heads-up (separate issue, not this PR)

With the EXPath File error cleared, the dashboard UI hits a different pre-existing problem: jinks-templates can't find templates/base-page.html (the templates dir has page-content.tpl + pages/ but no base-page.html). Tracked separately — needs investigation into whether that template is missing from the build/source or the extends-target was renamed.

…text)

modules/app.xqm imported http://expath.org/ns/file (EXPath File module)
solely to read the JMX servlet token file ($EXIST_HOME/data/jmxservlet.token)
via file:exists / file:read-text. That module is not bundled with eXist 7
(see eXist-db/exist#6257), so the whole module failed to load with
XQST0059, breaking the dashboard UI (view.xq -> app.xqm).

Replace the two file: calls with the W3C fn:unparsed-text family over a
file:// URI, which eXist honors natively for filesystem reads:
  file:exists($p)    -> unparsed-text-available("file://" || $p)
  file:read-text($p) -> unparsed-text("file://" || $p)

No behavior change to token parsing; drops the optional dependency so the
dashboard runs on stock eXist 7 without the unmerged exist#6257.

Verified: app.xqm now loads (the XQST0059 / expath.org/ns/file error is
gone) and the token file reads correctly via unparsed-text.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joewiz joewiz merged commit 4413360 into master Jun 6, 2026
4 of 8 checks passed
@joewiz joewiz deleted the fix/drop-expath-file-dependency branch June 6, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant