Workday raises The stylesheet (XSLT) attached to Document Transformation must be valid XML when the XML parser inside the Document Transformation step cannot parse the attached .xsl or .xslt file as a well-formed XML document. The fastest way to isolate the exact line and column is to run xmllint --noout your-stylesheet.xsl locally (or open the file in Oxygen XML Editor or Workday Studio) before touching the tenant configuration.
Workday does not validate XSLT syntax when you upload the file to an integration system, so a single stray byte, unescaped ampersand, or missing closing tag only surfaces when the integration event runs. Every XSLT stylesheet is itself an XML document first and a transformation program second. Until the file parses cleanly as XML, Workday never reaches your templates, XPath expressions, or ETV/XTT attributes.
Common root causes and exact XML fixes
Most Document Transformation failures under this error come from six specific XML defects introduced during hand edits, copy-paste from tickets or documents, or Windows text editors.
| Cause | Broken XML pattern | Valid XSLT fix |
|---|---|---|
CauseLeading whitespace or UTF-8 BOM before <?xml |
Broken XML patternBlank line, spaces, or EF BB BF bytes before <?xml version="1.0" encoding="UTF-8"?> |
Valid XSLT fixSave as plain UTF-8 without BOM with <?xml starting at byte 0, line 1, column 1 |
CauseUnescaped < or & in XPath or text |
Broken XML pattern<xsl:if test="wd:Hours < 40 and wd:Code = 'A&B'"> |
Valid XSLT fix<xsl:if test="wd:Hours < 40 and wd:Code = 'A&B'"> |
| CauseMismatched, overlapping, or unclosed tags | Broken XML pattern<xsl:value-of select="wd:ID"> (missing /) or <Row><Cell></Row></Cell> |
Valid XSLT fix<xsl:value-of select="wd:ID"/> and properly nested <Row><Cell/></Row> |
| CauseUndeclared or wrong namespace prefix | Broken XML patternUsing etv:required="true" or xtt:separator="," without declaring the prefix on <xsl:stylesheet> |
Valid XSLT fixDeclare xmlns:xsl="http://www.w3.org/1999/XSL/Transform", xmlns:etv="urn:com.workday/etv", xmlns:xtt="urn:com.workday/xtt", and the exact xmlns:wd="..." URI |
| CauseSmart quotes or wrong character encoding | Broken XML pattern<xsl:variable name=“empId” select=‘123’/> pasted from Word, Slack, or Outlook, or Windows-1252 bytes under encoding="UTF-8" |
Valid XSLT fixReplace curly quotes with straight ASCII " or ', and re-encode the file to UTF-8 |
| CauseDouble hyphen inside an XML comment | Broken XML pattern<!-- TODO -- fix hire date --> |
Valid XSLT fix<!-- TODO: fix hire date --> (XML forbids -- anywhere inside a comment body) |
A less obvious trigger is attaching the wrong file format altogether, such as an .xml sample output file, a .txt spec, or a zipped archive, to the Integration Attachment Service. Check the attached file name and contents before assuming the XSLT logic itself is broken.
Validate the XSLT locally before uploading
Run this sequence on the exact .xsl or .xslt file you plan to upload. Do not edit the file in a word processor or browser text box after validating it.
Check the first bytes for a BOM or leading whitespace. On macOS or Linux, inspect the start of the file:
bash head -c 32 transform.xsl | od -An -tx1 -tcIf the output starts with
ef bb bf(a UTF-8 BOM) or20/0a/0d(spaces or blank lines before3c 3f 78 6d 6c, which is<?xml), strip the BOM and save as plain UTF-8:bash LC_ALL=C sed -i '' '1s/^\xEF\xBB\xBF//' transform.xslRun an XML well-formedness check with
xmllint.xmllintis preinstalled on macOS and most Linux distributions (part oflibxml2):bash xmllint --noout transform.xslNo output and exit code
0means the stylesheet is well-formed XML. Any error prints the exact line number, column, and parser complaint (for example,EntityRef: expecting ';'for an unescaped&, orOpening and ending tag mismatchfor an unclosed element).Verify the root element and Workday namespaces. Confirm that the root
<xsl:stylesheet>(or<xsl:transform>) declares every prefix used anywhere in the document:xml <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wd="urn:com.workday/bsvc" xmlns:etv="urn:com.workday/etv" xmlns:xtt="urn:com.workday/xtt"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> </xsl:stylesheet>Replace
xmlns:wdwith the exact namespace URI from your source connector’s XML output (for example,urn:com.workday.report/...for a Custom Report or the PECI/Core Connector namespace shown on the root element of a real run’s XML output).Test the transformation against a real XML payload. Well-formed XML only proves the parser can read the stylesheet. Open the
.xslfile in Oxygen XML Editor or Workday Studio and run it against a sample XML output file from your parent connector. That catches XSLT 2.0/3.0 compilation errors, invalid XPath syntax, and malformed output nodes before the file reaches Workday.
Replace the stylesheet in Workday
Once xmllint --noout exits cleanly and your local test transform succeeds, upload the corrected file to the Document Transformation integration system.
- Search for the Document Transformation integration system in Workday and open its view page.
- Open the integration system’s Related Actions menu and select Integration System > Edit Integration System (or open Configure Integration Attachment Service directly from the Integration Attachment Service action menu).
- Locate the Integration Attachment Service configured on the Document Transformation system.
- Remove the broken
.xslor.xsltattachment so Workday does not keep referencing the old version. - Upload the validated
.xslfile as the new attachment and save the integration system configuration. - Launch the parent connector integration (or re-run the Document Transformation step in your test tenant) and inspect the integration event’s Messages and Output Files tabs.
If the error persists after fixing XML well-formedness
Two edge cases look similar in integration logs even after the .xsl file passes xmllint:
- Multiple attachments on the Integration Attachment Service: If an older broken stylesheet remains attached alongside the new file, Document Transformation can still read the stale attachment. Leave only the single intended
.xslfile attached. - ETV vs. XTT output mismatch: Document Transformation uses ETV (
urn:com.workday/etv) when producing validated XML output and XTT (urn:com.workday/xtt) when converting intermediate XML into delimited or fixed-width text. In both cases, your stylesheet’s<xsl:output>should produce valid XML for the Workday transformation stage (<xsl:output method="xml" .../>) when ETV or XTT attributes are processed downstream; setting<xsl:output method="text"/>where the step expects XML will fail downstream parsing.