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:
- Multiple consuming expressions in one template or predicate: Reading
wd:Worker_Reference/wd:ID[@wd:type='Employee_ID']and then readingwd:Worker_Data/wd:Personal_Datain the same streamed template consumes thewd:Workersubtree twice, which breaks single-pass streaming. - 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.
- Non-motionless match patterns or predicates: Filtering a streamed
xsl:template matchorxsl:for-eachwith a child-plus-attribute path (such asmatch="wd:Worker[wd:Worker_Data/wd:ID/@wd:type='Employee_ID']") requires looking ahead into child elements before matching. - 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 downstreamXSLT+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.
<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(.).
<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".
<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
xsltstep: Supports XSLT 2.0 only and is compatible with assemblies versioned up to2017.05. It does not support XSLT 3.0 streaming (xsl:mode streamable="yes",copy-of(),snapshot(), orxsl:accumulator). XSLT+step: Supports XSLT 3.0 streaming and is designed for assemblies versioned after2017.05. Under the hood, assemblies from2017.05onward run on Saxon 9.7+ (Saxon-EE for streaming).
Two runtime details from Workday’s Saxon processor reference also affect XSLT 3.0 upgrades:
- Default transformer selection: In assemblies versioned
2022.46or earlier, Saxon is only set as the default transformer when the mediation context propertyuse.saxon.transformeristrue. In assemblies versioned2022.47or later, Saxon is the default whenuse.saxon.transformeristrueor omitted. - 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 withstring(@wd:type)orxs:boolean(...)when comparing them against typed parameters.
Troubleshooting checklist before redeploying
- Confirm the mediation uses the
XSLT+step (not legacyxslt) and that the assembly version is after2017.05. - Confirm the stylesheet root declares
version="3.0"andxmlns:fn="http://www.w3.org/2005/xpath-functions"if you callfn:copy-of(.)orfn:snapshot(.). - Check whether the
@error is coming from anxml-stream-splitterXPath 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 intoXSLT+. - 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-enablestreamable="yes"and wrap the repeating record infn:copy-of(.).