Skip to content
KiweelyKiweelyKiweely

Fixing “Non-supported XPath expression with ‘@’ character” in Workday Studio XSLT 3.0

Workday Studio XSLT 3.0 streaming rejects @attribute XPath expressions that violate motionless or downward-only rules. Use fn:copy-of(.), snapshot(), xsl:accumulator, or streamable=”no” depending on payload size and lookup scope.

  • Checked against Workday on
  • Applies to Workday Extend
  • 5 min read
  • Published
  • By Kiweely
On this page

Workday Studio throws "Non-supported XPath expression with '@' character" (or a Saxon XTSE3430 streamability rejection) when an @attribute expression inside a streaming stylesheet or streaming splitter violates single-pass forward reading, such as reading a child element’s attribute after already consuming the streamed node or placing an @ predicate on a non-motionless path. The immediate fix is to ground each repeating record with fn:copy-of(.) (windowed streaming), bind the current node’s attributes into variables before descending into child elements, or set streamable="no" when the XML payload is small enough to process in memory.

Why @ expressions fail under XSLT 3.0 streaming

In XSLT 3.0 streaming (<xsl:mode streamable="yes"/>), the Saxon-EE processor reads the input XML once from top to bottom and discards nodes as soon as the parser moves past them. Every XPath expression in a streamable template is statically analyzed for its sweep: motionless expressions inspect the current node without moving the stream cursor, while consuming expressions read downward into child or descendant nodes.

Reading an attribute on the current context element (@wd:type) is motionless because XML attributes arrive inside the element’s opening start tag. Errors happen when @ is used in one of four non-streamable patterns:

  1. Multiple consuming expressions in one template or predicate: Reading wd:Worker_Reference/wd:ID[@wd:type='Employee_ID'] and then reading wd:Worker_Data/wd:Personal_Data in the same streamed template consumes the wd:Worker subtree twice, which breaks single-pass streaming.
  2. Reading an attribute after descending: Once the processor has stepped into child elements of a streamed node, it cannot step back to inspect attributes on that node or on a sibling subtree.
  3. Non-motionless match patterns or predicates: Filtering a streamed xsl:template match or xsl:for-each with a child-plus-attribute path (such as match="wd:Worker[wd:Worker_Data/wd:ID/@wd:type='Employee_ID']") requires looking ahead into child elements before matching.
  4. Streaming splitter XPath properties: Outside XSLT itself, Workday Studio’s StAX-based streaming components (such as xml-stream-splitter) only accept a restricted forward-only element path and reject @ attribute predicates. Move attribute filtering out of the splitter path and into the downstream XSLT+ step.

Before and after: fixing @attribute in a streaming template

A common Workday integration pattern extracts Employee_ID from a wd:ID[@wd:type='Employee_ID'] element and also reads fields from wd:Worker_Data inside a wd:Worker record.

Failing streaming stylesheet

In strict streamable="yes" mode, this template fails static streamability checks because it performs two separate consuming downward selections (wd:Worker_Reference/wd:ID[@wd:type='Employee_ID'] and wd:Worker_Data/...) against the same streamed wd:Worker node.

xml
<xsl:stylesheet version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:wd="urn:com.workday/bsvc">

    <xsl:mode streamable="yes" on-no-match="shallow-skip"/>

    <xsl:template match="wd:Worker">
        <Record>
            <!-- Fails: consumes wd:Worker subtree more than once under streaming -->
            <EmployeeID>
                <xsl:value-of select="wd:Worker_Reference/wd:ID[@wd:type='Employee_ID']"/>
            </EmployeeID>
            <HireDate>
                <xsl:value-of select="wd:Worker_Data/wd:Employment_Data/wd:Worker_Status_Data/wd:Hire_Date"/>
            </HireDate>
        </Record>
    </xsl:template>
</xsl:stylesheet>

Fix 1: Windowed streaming with fn:copy-of(.)

Workday’s Scaling Integrations course manual recommends windowed streaming (also called burst mode) for repeating records like wd:Worker. The stylesheet streams through the outer document and materializes one wd:Worker subtree at a time into a local variable with fn:copy-of(.). Inside that grounded copy, any @attribute predicate, backward axis, or repeated child lookup works normally.

Workday Studio’s built-in XSLT validator does not always recognize unprefixed XSLT 3.0 functions, so declare xmlns:fn="http://www.w3.org/2005/xpath-functions" and call fn:copy-of(.).

xml
<xsl:stylesheet version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:wd="urn:com.workday/bsvc"
    exclude-result-prefixes="fn wd">

    <xsl:mode streamable="yes" on-no-match="shallow-skip"/>

    <xsl:template match="wd:Worker">
        <!-- Materialize one Worker record at a time into a grounded copy -->
        <xsl:variable name="worker" select="fn:copy-of(.)"/>
        <Record>
            <EmployeeID>
                <xsl:value-of select="$worker/wd:Worker_Reference/wd:ID[@wd:type='Employee_ID']"/>
            </EmployeeID>
            <HireDate>
                <xsl:value-of select="$worker/wd:Worker_Data/wd:Employment_Data/wd:Worker_Status_Data/wd:Hire_Date"/>
            </HireDate>
        </Record>
    </xsl:template>
</xsl:stylesheet>

If you also need ancestor attributes (such as a wd:version attribute on the root wd:Get_Workers_Response element) alongside the copied record, replace fn:copy-of(.) with fn:snapshot(.). The snapshot() function copies the current wd:Worker subtree plus its ancestor chain and their attributes, so $worker/ancestor::wd:Get_Workers_Response/@wd:version evaluates without breaking streaming.

Fix 2: Bind local attributes before descending, or use xsl:accumulator

When an element itself carries attributes you need alongside its child elements, bind those attributes into variables first (a motionless read) before running a single consuming instruction on the children. If you need to carry an attribute value from an earlier sibling or parent element across the entire stream (such as a header batch ID or running total), capture it in an xsl:accumulator with streamable="yes".

xml
<xsl:stylesheet version="3.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:wd="urn:com.workday/bsvc"
    exclude-result-prefixes="xs wd">

    <xsl:mode streamable="yes" on-no-match="shallow-skip" use-accumulators="current-batch-type"/>

    <xsl:accumulator name="current-batch-type" as="xs:string" initial-value="''" streamable="yes">
        <xsl:accumulator-rule match="wd:Response_Data" select="string(@wd:Batch_Type)"/>
    </xsl:accumulator>

    <xsl:template match="wd:ID">
        <!-- Motionless attribute read happens before consuming text content -->
        <xsl:variable name="idType" select="string(@wd:type)"/>
        <xsl:if test="$idType = 'Employee_ID'">
            <EmployeeID batch="{accumulator-before('current-batch-type')}">
                <xsl:value-of select="."/>
            </EmployeeID>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>

Decision table: copy-of(.) vs snapshot() vs xsl:accumulator vs streamable="no"

Choose the pattern that matches your payload size and how far your @attribute expression reaches across the XML tree.

Pattern Best used when Memory footprint Supports @attribute lookups across
Patternfn:copy-of(.) (windowed streaming) Best used whenProcessing large Workday XML files with many repeating records (wd:Worker, wd:Journal_Entry_Line, payroll lines) Memory footprintOne record subtree at a time Supports @attribute lookups acrossAny element or attribute inside the current record
Patternfn:snapshot(.) Best used whenSame as fn:copy-of(.), but the mapping also needs attributes from parent or root elements Memory footprintOne record subtree plus its ancestor elements Supports @attribute lookups acrossCurrent record plus all ancestor elements and ancestor attributes
Patternxsl:accumulator (streamable="yes") Best used whenCarrying a header attribute, running count, or sum across millions of flat rows without buffering subtrees Memory footprintConstant (accumulator state only) Supports @attribute lookups acrossCurrent node attributes and previously visited nodes in document order
Patternstreamable="no" Best used whenSmall payloads (lookup tables, single-worker SOAP responses, small EIB or RaaS extracts) where complex cross-record XPath or sorting is needed Memory footprintFull document tree in memory Supports @attribute lookups acrossEntire document in any direction

Workday Studio XSLT+ vs legacy xslt step and Saxon behavior

Workday Studio provides two XSLT transform steps on the Palette, and picking the wrong one is a frequent source of XSLT 3.0 compilation errors:

  • Legacy xslt step: Supports XSLT 2.0 only and is compatible with assemblies versioned up to 2017.05. It does not support XSLT 3.0 streaming (xsl:mode streamable="yes", copy-of(), snapshot(), or xsl:accumulator).
  • XSLT+ step: Supports XSLT 3.0 streaming and is designed for assemblies versioned after 2017.05. Under the hood, assemblies from 2017.05 onward run on Saxon 9.7+ (Saxon-EE for streaming).

Two runtime details from Workday’s Saxon processor reference also affect XSLT 3.0 upgrades:

  1. Default transformer selection: In assemblies versioned 2022.46 or earlier, Saxon is only set as the default transformer when the mediation context property use.saxon.transformer is true. In assemblies versioned 2022.47 or later, Saxon is the default when use.saxon.transformer is true or omitted.
  2. Strict XSLT 3.0 typing: Switching a stylesheet to version="3.0" turns on strict type checking at runtime. Expressions that implicitly cast strings to booleans (such as $stringParam = true()) pass deployment but fail at runtime in Saxon. Cast attribute values explicitly with string(@wd:type) or xs:boolean(...) when comparing them against typed parameters.

Troubleshooting checklist before redeploying

  1. Confirm the mediation uses the XSLT+ step (not legacy xslt) and that the assembly version is after 2017.05.
  2. Confirm the stylesheet root declares version="3.0" and xmlns:fn="http://www.w3.org/2005/xpath-functions" if you call fn:copy-of(.) or fn:snapshot(.).
  3. Check whether the @ error is coming from an xml-stream-splitter XPath property rather than the XSLT file; if so, split on the plain element path (for example /wd:Report_Data/wd:Report_Entry) and move the @ filter into XSLT+.
  4. To isolate whether a bug is a streaming restriction or an XPath syntax mistake, temporarily set <xsl:mode streamable="no"/> and run a small test payload in Workday Studio. If it succeeds, re-enable streamable="yes" and wrap the repeating record in fn:copy-of(.).

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.