In Workday integrations, XSLT is used to transform XML data, such as the output from an Enterprise Interface Builder (EIB) or a web service-enabled report, into a desired format for third-party systems. In this scenario, you need to write XSLT to process wd:Dependents_Group elements and output a relationship code based on the value of the wd:Relationship attribute or element. The requirement is tooutput "SP" for a "Spouse" relationship, "CH" for a "Child" relationship, and "OTHER" for any other relationship, using an statement within a template matching wd:Dependents_Group.
Here’s why option C is correct:
XSLT <xsl:choose> Structure: The element in XSLT provides conditional logic similar to a switch statement. It evaluates conditions in elements sequentially, executing the first matching condition, and uses for any case that doesn’t match.
Relationship as an Attribute: Based on the provided XML snippet, wd:Relationship is an attribute (e.g., Spouse within wd:Dependents_Group). However, in Workday XML for integrations, wd:Relationship is often represented as an attribute (@wd:Relationship) rather than a child element, especially in contexts like dependent data in reports. The syntax @wd:Relationship in the test attribute of correctly references this attribute, aligning with Workday’s typical XML structure for such data.
Context in Template: Since the template matches on wd:Dependents_Group, the test conditions operate on the current wd:Dependents_Group element and its attributes, ensuring the correct relationship code is output for each dependent. The XML snippet shows wd:Relationship as an element, but Workday documentation and integration practices often standardize it as an attribute in XSLT transformations, making @wd:Relationship appropriate.
Why not the other options?
xml
WrapCopy
SP
CH
OTHER
This assumes wd:Relationship is a child element of wd:Dependents_Group, not an attribute. The XML snippet shows wd:Relationship as an element, but in Workday integrations, XSLT often expects attributes for efficiency and consistency, especially in report outputs. Using wd:Relationship without @ would not match the attribute-based structure commonly used, making it incorrect for this context.
xml
WrapCopy
SP
CH
OTHER
This correctly uses @wd:Relationship for an attribute but has a logical flaw: if wd:Relationship='Child', the second would output "CH," but the order of conditions matters. However, the primaryissue is that it doesn’t match the exact structure or intent as clearly as option C, and Workday documentation often specifies exact attribute-based conditions like those in option C.
xml
WrapCopy
SP
CH
OTHER
This uses an absolute path (/wd:Relationship), which searches for a wd:Relationship element at the root of the XML document, not within the current wd:Dependents_Group context. This would not work correctly for processing dependents in the context of the template matching wd:Dependents_Group, making it incorrect.
To implement this in XSLT:
Within your template matching wd:Dependents_Group, you would include the statement from option C to evaluate the wd:Relationship attribute and output the appropriate relationship code ("SP," "CH," or "OTHER") based on its value. This ensures the transformation aligns with Workday’s XML structure and integration requirements for processing dependent data in an EIB or web service-enabled report, even though the provided XML shows wd:Relationship as an element—XSLT transformations often normalize to attributes for consistency.
References:
Workday Pro Integrations Study Guide: Section on "XSLT Transformations for Workday Integrations" – Details the use of , , , and XPath for conditional logic in XSLT, including handling attributes like @wd:Relationship.
Workday EIB and Web Services Guide: Chapter on "XML and XSLT for Report Data" – Explains the structure of Workday XML (e.g., wd:Dependents_Group, @wd:Relationship) and how to use XSLT to transform dependent data, including attribute-based conditions.
Workday Reporting and Analytics Guide: Section on "Web Service-Enabled Reports" – Covers integrating report outputs with XSLT for transformations, including examples of conditional logic for relationship codes.