Skip to content

Implement XPath 1.0 namespace support and explicit error stubs - #3

Merged
jeffhuen merged 9 commits into
mainfrom
feat/xpath-namespace-support
Feb 16, 2026
Merged

jeffhuen merged 9 commits into
mainfrom
feat/xpath-namespace-support

Conversation

@jeffhuen

Copy link
Copy Markdown
Owner

Summary

  • Add namespace-uri() and lang() XPath functions with correct XPath 1.0 semantics
  • Return explicit errors for id() (DTD/XXE security) and $variable references (XSLT feature)
  • Implement namespace-aware QName and wildcard node test matching
  • Document namespace axis limitation and add Known Limitations section to README

Closes #2

Test Plan

  • 137 Rust tests pass (8 new tests added)
  • 1310 Elixir tests pass
  • cargo fmt, clippy, credo --strict, dialyzer all clean

🤖 Generated with Claude Code

jeffhuen and others added 9 commits February 16, 2026 13:08
Covers issue #2: namespace-uri(), lang(), namespace axis, QName matching,
and explicit errors for id() and $variable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9 tasks: trait methods, namespace-uri(), lang(), id()/variable errors,
QName matching, namespace axis, README, verification, issue close.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the stub namespace-uri() that always returned empty string with
a full implementation that resolves namespace URIs via DocumentAccess.
Follows the same pattern as local-name(): accepts optional node-set arg,
defaults to context node, returns URI string or empty string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace silent stub values with explicit errors:
- id() now returns an error explaining DTD processing is disabled for XXE security
- $variable references now return an error explaining they are not supported

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeffhuen
jeffhuen merged commit 0f6fd1e into main Feb 16, 2026
3 checks passed
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.

XPath 1.0: Unimplemented functions (namespace-uri, id, lang) and variable references

1 participant