XSLT Error Reference
FODC0002
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
- Relative URI resolved against the wrong base.
document('lookup.xml')resolves relative to the stylesheet location (fordoc()in some contexts, the static base URI) — not your shell’s working directory. - The file simply is not there (typo, wrong folder, not deployed with the stylesheet).
- Sandboxed environments. Online tools have no access to your local filesystem —
doc('file:/C:/data.xml')cannot work in a browser-based tester. - 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 callingdoc(). - Verify the base URI with
base-uri(/)andstatic-base-uri()— print them withxsl: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.