| name | xslt-xpath |
| description | Guidance for authoring and reviewing XSLT/XPath changes with modern XSLT 3.0 + XPath 3.1 practices, prioritizing SaxonJS3-compatible features and avoiding deprecated functionality. Trigger for `.xsl`/XSLT templates, XPath expressions, XForms transform logic, or SaxonJS integration edits; do not trigger for pure TypeScript/Playwright changes unless they directly modify XSLT behavior. |
XSLT + XPath Modernization (SaxonJS3-first)
When to use
Use this skill whenever making or reviewing changes in XSLT stylesheets, XPath expressions, or XSLT-driven JavaScript integration points.
Core requirements
- Prefer XSLT 3.0+ features over legacy constructs.
- Prefer XPath 3.1+ expression capabilities and function library behavior.
- Prefer SaxonJS3-compatible features and idioms.
- Avoid deprecated functionality unless absolutely required for compatibility.
- When something can be done equivalently in either XPath or XSLT, prefer the approach used by the existing codebase.
Authoring rules
- Use modern, explicit, and readable expression styles (including maps/arrays and function-oriented constructs where appropriate).
- Prefer robust XSLT 3.0 mechanisms (e.g., structured modes, explicit typing where useful, package-aware organization where relevant) over ad-hoc legacy patterns.
- Avoid introducing legacy-only compatibility code paths unless a concrete runtime constraint requires them.
- Do not add deprecated functions or syntax when an equivalent modern feature exists.
- If an unavoidable compatibility fallback is introduced, add a short comment explaining why modern-only behavior is not possible.
- When adding XSLT functions or templates, ensure they are documented using the
http://www.oxygenxml.com/ns/doc/xsl tagset.
Review checklist
- Does the change use XSLT 3.0 / XPath 3.1 idioms by default?
- Is the code compatible with SaxonJS3 behavior?
- Are any deprecated features introduced? If yes, is there explicit technical justification?
- Is there a simpler modern replacement that should be used instead?
Completion criteria
- New/updated XSLT+XPath logic follows XSLT 3.0 and XPath 3.1-first conventions.
- SaxonJS3 compatibility is preserved.
- No unnecessary deprecated functionality remains in the change.
Resources
- Use the Saxonica documentation as needed to understand the use of the
ixsl, js and saxon namespaces.