Skip to content

XSLT try/catch + typed constructors; TypeTable plumbing; testrunner params; XPath fixes#134

Open
michaelgiraldo wants to merge 10 commits intoPaligo:mainfrom
michaelgiraldo:main
Open

XSLT try/catch + typed constructors; TypeTable plumbing; testrunner params; XPath fixes#134
michaelgiraldo wants to merge 10 commits intoPaligo:mainfrom
michaelgiraldo:main

Conversation

@michaelgiraldo
Copy link

@michaelgiraldo michaelgiraldo commented Dec 29, 2025

Summary

This is a larger XSLT/XPath enablement pass: try/catch and typed constructors,
runtime TypeTable plumbing, XPath pattern fixes, and improved XSLT test running.
It also adds targeted regressions and refreshes snapshots/docs.


Context

This PR advances several XSLT features in one go. The core behavioral additions
are try/catch and typed constructors, which require IR/compiler updates and
TypeTable propagation in the interpreter. I kept runtime changes narrow and
relied on tests for safety. Alongside that, a couple XPath fixes and testrunner
improvements unblock more of the conformance suite.

What changed

XPath parsing / priority

  • Fix pattern parsing (nested predicates) and update snapshots.
  • Fix union default priority handling.

TypeTable (runtime typing)

  • Add core TypeTable infrastructure.
  • Thread TypeTable through matching so type annotations are preserved.

XSLT AST → IR → compiler → interpreter

  • Parse xsl:try/xsl:catch in AST and update snapshots.
  • Extend IR for typing + try/catch.
  • Lower new features in the compiler (emit XmlSetType where types are declared).
  • Execute templates and try/catch in the interpreter, including rollback.

Typed constructors

  • Type propagation for:
    • xsl:element
    • xsl:attribute
    • xsl:copy
    • xsl:copy-of
    • xsl:document

Test runner

  • Support XSLT params and dependency gating.

Tests / docs

  • Add rollback + type propagation regression tests.
  • Refresh snapshots and update conformance/docs.

Commit coverage (explicit)

  • xpath: fix pattern parsing and update snapshots
  • interpreter: add TypeTable core infra
  • interpreter: thread TypeTable through matching
  • xslt-ast: parse try/catch and refresh snapshots
  • ir: extend XSLT IR model
  • compiler: lower XSLT/XPath features
  • interpreter: execute templates and try/catch
  • testrunner: support xslt params and deps
  • xslt-compiler: fix default priority for unions
  • Add XSLT regression tests and refresh docs

Review focus (risk boundaries)

  • Interpreter changes are limited to TypeTable propagation + try/catch rollback.
  • IR changes are additive; existing bytecode paths remain intact.
  • XPath changes are scoped to pattern parsing + union priority.

Regression tests added

  • test_try_catch_rollback_output (rollback behavior)
  • test_type_table_for_typed_constructors (type propagation)

Testing

  • cargo test
  • cargo run --release --bin xee-testrunner -- check vendor/xpath-tests/
  • cargo run --release --bin xee-testrunner -- check vendor/xslt-tests/
  • cargo run --release --bin xee-testrunner -- all vendor/xslt-tests/tests/insn/assert/_assert-test-set.xml

Conformance (check runs are filtered):

  • XPath QT3: Supported 21859 / Passed 20221 / Failed 0 / Error 0 / Filtered 1638 / Unsupported 9953
  • XSLT check: Supported 14595 / Passed 1136 / Failed 0 / Error 0 / Filtered 13459 / Unsupported 0
  • XSLT assert set (all): 10/10 passed

Snapshot note

Snapshots updated to reflect the new type_ field on literal elements and fn:
resolution behavior.

@faassen
Copy link
Collaborator

faassen commented Jan 5, 2026

Hey, sorry for taking a while to review. I need to improve the way this project is being maintained! I merged another branch this leads to a conflict, could you look into this?

@faassen
Copy link
Collaborator

faassen commented Jan 5, 2026

I'm also curious about the interactions with #126

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.

2 participants