---
title: "Workday Document Transformation XSLT Must Be Valid XML"
description: "Fix Workday's Document Transformation error 'The stylesheet (XSLT) attached to Document Transformation must be valid XML' with local XML checks and upload…"
url: https://kiweely.com/guides/workday-document-transformation-xslt-must-be-valid-xml
---

# 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 December 3
-   Applies to **Workday Integrations (Document Transformation, ETV, XTT)**
-   4 min read
-   Published December 3
-   By Kiweely

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 |
| --- | --- | --- |
| Leading whitespace or UTF-8 BOM before `<?xml` | Blank line, spaces, or `EF BB BF` bytes before `<?xml version="1.0" encoding="UTF-8"?>` | Save as plain **UTF-8 without BOM** with `<?xml` starting at byte 0, line 1, column 1 |
| Unescaped `<` or `&` in XPath or text | `<xsl:if test="wd:Hours < 40 and wd:Code = 'A&B'">` | `<xsl:if test="wd:Hours &lt; 40 and wd:Code = 'A&amp;B'">` |
| Mismatched, overlapping, or unclosed tags | `<xsl:value-of select="wd:ID">` (missing `/`) or `<Row><Cell></Row></Cell>` | `<xsl:value-of select="wd:ID"/>` and properly nested `<Row><Cell/></Row>` |
| Undeclared or wrong namespace prefix | Using `etv:required="true"` or `xtt:separator=","` without declaring the prefix on `<xsl:stylesheet>` | Declare `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 |
| Smart quotes or wrong character encoding | `<xsl:variable name=“empId” select=‘123’/>` pasted from Word, Slack, or Outlook, or Windows-1252 bytes under `encoding="UTF-8"` | Replace curly quotes with straight ASCII `"` or `'`, and re-encode the file to UTF-8 |
| Double hyphen inside an XML comment | `<!-- TODO -- fix hire date -->` | `<!-- 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

-   [Workday Documentation: Workday Connectors (Document Transformation, ETV, XTT)](https://doc.workday.com/workday-education/en-us/course-manuals/creating-and-securing-integrations/workday-connectors.html)
-   [Workday Documentation: Transforming Data in Workday Studio](https://doc.workday.com/workday-education/en-us/course-manuals/creating-integrations-using-workday-studio/transforming-data.html)
-   [Workday Documentation: Scaling Integrations (ETV and XTT Namespaces)](https://doc.workday.com/workday-education/en-us/course-manuals/creating-integrations-using-workday-studio/scaling-integrations.html)
-   [Workday Documentation: Troubleshooting PECI Integrations](https://doc.workday.com/workday-education/en-us/course-manuals/creating-integrations-using-global-payroll-connect/troubleshooting-peci-integrations.html)

## Related guides

[All guides](https://kiweely.com/guides)

### More guides on Integrations and APIs

[All 174 guides](https://kiweely.com/guides#integrations)

-   [How to Check When a Workday Sandbox Was Last Refreshed (Schedule, History, and Customer Central)](https://kiweely.com/guides/workday-sandbox-last-refresh-date-and-history)
-   [Can’t Find Your Configuration Package in Workday Customer Central? How to Fix It](https://kiweely.com/guides/workday-customer-central-cant-find-configuration-package)
-   [How to Send Back a Business Process Step with the Workday eventSteps REST API](https://kiweely.com/guides/workday-rest-api-eventsteps-send-back)
-   [Fix Workday Studio Error: Invalid Instance for Instance Setting in Org Data Changes](https://kiweely.com/guides/workday-studio-invalid-instance-for-instance-setting)
-   [Workday Data Cloud and AWS Integration: Apache Iceberg, Live Data Query, and Bedrock](https://kiweely.com/guides/workday-data-cloud-aws-bedrock-iceberg-integration)
-   [Workday Strategic Sourcing & Supplier Portal: RFx Events, Supplier Onboarding Sync, and Procurement Integration Fixes](https://kiweely.com/guides/workday-strategic-sourcing-scout-rfp-supplier-portal)
-   [Workday to Greenhouse, Lever, and iCIMS: External ATS Integration, Hire APIs, and Offer-to-Hire Fixes](https://kiweely.com/guides/workday-to-greenhouse-lever-icims-external-ats-integration)
-   [Workday to Active Directory and LDAP: Worker Provisioning, Attribute Mapping, and Termination Timing](https://kiweely.com/guides/workday-to-active-directory-ldap-provisioning-authentication)

### From the blog on Integrations and APIs

[All posts](https://kiweely.com/blog)

-   [Why does a Workday EIB load fail, and how do you get a clean load the first time?](https://kiweely.com/blog/why-workday-eib-load-fails)
-   [AI-Maintained Benefits Feeds and Hand-Owned Cloud Connect Maps](https://kiweely.com/blog/maintained-benefits-feeds-versus-hand-owned-cloud-connect-maps)
-   [Ask Claude, ChatGPT, or Gemini About a Failed Workday Run](https://kiweely.com/blog/ask-an-assistant-about-a-failed-workday-integration)

## 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.

[Get in touch](https://kiweely.com/vine#partners) [See Vine at work](https://kiweely.com/vine/work)

Want it built for you? [OnoeX](https://onoex.com/?utm_source=kiweely.com&utm_medium=referral&utm_campaign=cross-site&utm_content=guide-integrations) , 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.
