1
0
mirror of https://github.com/alexandrev/xslt-lab.git synced 2026-09-16 18:23:16 +00:00
Files
xslt-lab/site/content/posts/xslt-common-errors.md
T
claude-code b666f1116c SEO phase 2: Saxon error reference (17 pages) + 2 answer-first posts
Devs search literal error messages ("XPST0017", "Content is not allowed in
prolog") with almost no competition. New /xslt/errors/ section mirrors the
function-reference pattern that already ranks:

- 17 error pages: XPST0017/0081/0008, XPTY0004, XPDY0002, XTSE0630/0010,
  XTDE1490, XTMM9000, XTRE0540, FORX0002, FODC0002, FORG0001, SXXP0003 and
  the three big XML parser messages — each with meaning, causes and
  before/after fixes
- Pillar post "XSLT error messages explained" (triage table by error-code
  prefix, links all 17)
- Post "XSLT vs DataWeave" targeting the enterprise/MuleSoft audience
- Cross-links: functions hub ↔ errors hub; FirstUpper for category headings

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MgybX3QbAWVzb9ZnroCA79
2026-07-02 21:45:18 +00:00

5.0 KiB

title, description, date, tags
title description date tags
XSLT error messages explained: the 17 most common Saxon errors and how to fix each one A practical triage guide to XSLT and Saxon errors — XPST0017, XPTY0004, XPDY0002, 'Content is not allowed in prolog' and more: what each means and the fastest fix. 2026-07-02T00:00:00Z
xslt
saxon
errors
debugging

Quick answer: most XSLT failures fall into three buckets. If the error code starts with XP/XT + "S" (XPST, XTSE) the stylesheet itself is invalid and nothing ran. If it starts with XP/XT + "D" (XPDY, XTDE) the stylesheet compiled but hit a problem at runtime with your data. If the message mentions the XML parser (SAXParseException, SXXP0003), your input document is not well-formed XML — the stylesheet never even got a chance. Find your exact error below.

Triage: read the code before the message

Prefix Layer Meaning
XPST… XPath, static Expression invalid — typo, unknown function/variable/prefix
XPTY… XPath, type Value has wrong type or cardinality (2.0+ strictness)
XPDY… XPath, dynamic Expression valid but failed on your data/context
XTSE… XSLT, static Stylesheet structure invalid
XTDE… / XTRE… XSLT, dynamic Runtime failure / recoverable condition
FO… Function library A standard function rejected its input
SXXP0003 / SAXParseException XML parser Input is not well-formed XML

Stylesheet won't compile (static errors)

Runs but fails on your data (dynamic & type errors)

Function library complaints

Your input XML is broken (parser errors)

A 3-step debugging workflow

  1. Reproduce small. Paste stylesheet + input into XSLT Playground and cut the input down to the smallest fragment that still fails — Saxon errors carry exact line numbers, so shrinking the case pinpoints the culprit.
  2. Check the layer with the table above: fix stylesheet, data, or input well-formedness — they need different tools.
  3. Trace it. For logic errors that don't raise codes at all (wrong output, empty output), enable the execution trace to see which templates fired and with what context. The debugging patterns guide covers this in depth.

Browse the full XSLT & Saxon Error Reference for every error above, each with before/after fixes you can run.