XSLT Error Reference

FODC0002

All versions function error
Error message
Error retrieving resource / I/O error reported by XML parser processing file:/…

doc() or document() could not load the requested document: wrong relative URI, missing file, or an environment (like an online tool) with no filesystem access.

What it means

A call to doc(), document() or unparsed-text() failed to retrieve the resource — the URI did not resolve, the file does not exist, or its content is not well-formed XML.

Common causes

  1. Relative URI resolved against the wrong base. document('lookup.xml') resolves relative to the stylesheet location (for doc() in some contexts, the static base URI) — not your shell’s working directory.
  2. The file simply is not there (typo, wrong folder, not deployed with the stylesheet).
  3. Sandboxed environments. Online tools have no access to your local filesystem — doc('file:/C:/data.xml') cannot work in a browser-based tester.
  4. The resource exists but is not well-formed XML — the parse failure surfaces as a retrieval error.

How to fix it

  • Guard the lookup with doc-available() before calling doc().
  • Verify the base URI with base-uri(/) and static-base-uri() — print them with xsl:message.
  • In XSLT Playground, don’t use doc() for secondary inputs: pass extra documents as named parameters in the Input panel instead — see working with parameters and multiple inputs.