Skip to content
KiweelyKiweelyKiweely

Fix: The stylesheet (XSLT) attached to Document Transformation must be valid XML in Workday

Workday rejects a Document Transformation XSLT attachment when its XML parser fails on the stylesheet file. Isolate UTF-8 BOMs, unescaped characters, mismatched tags, or undeclared namespaces locally with xmllint before re-uploading through the Integration Attachment Service.

  • Checked against Workday on
  • Applies to Workday Integrations (Document Transformation, ETV, XTT)
  • 4 min read
  • Published
  • By Kiweely
On this page

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 &lt; 40 and wd:Code = 'A&amp;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.

  1. 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 -tc

    If the output starts with ef bb bf (a UTF-8 BOM) or 20 / 0a / 0d (spaces or blank lines before 3c 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.xsl
  2. Run an XML well-formedness check with xmllint. xmllint is preinstalled on macOS and most Linux distributions (part of libxml2):

    bash
    xmllint --noout transform.xsl

    No output and exit code 0 means the stylesheet is well-formed XML. Any error prints the exact line number, column, and parser complaint (for example, EntityRef: expecting ';' for an unescaped &, or Opening and ending tag mismatch for an unclosed element).

  3. 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:wd with 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).

  4. Test the transformation against a real XML payload. Well-formed XML only proves the parser can read the stylesheet. Open the .xsl file 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.

  1. Search for the Document Transformation integration system in Workday and open its view page.
  2. 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).
  3. Locate the Integration Attachment Service configured on the Document Transformation system.
  4. Remove the broken .xsl or .xslt attachment so Workday does not keep referencing the old version.
  5. Upload the validated .xsl file as the new attachment and save the integration system configuration.
  6. 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 .xsl file 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.

Sources checked

Build, validate, and run integrations in Workday.

Kiweely Vine builds EIBs, Studio assemblies, and connectors in your connected tenant, rehearses loads in Sandbox, and reads back every result.

Want it built for you? OnoeX , a Workday consulting firm, delivers this with Kiweely Vine.

Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.

We’ll email you once to confirm. Unsubscribe in one click from any issue.

Protected by reCAPTCHA. Google’s privacy policy and terms apply.