Skip to content

Instantly share code, notes, and snippets.

@r4hulp
Created July 12, 2026 14:31
Show Gist options
  • Select an option

  • Save r4hulp/6fb1dc54be175828e8456dc7b92b8248 to your computer and use it in GitHub Desktop.

Select an option

Save r4hulp/6fb1dc54be175828e8456dc7b92b8248 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ws="urn:com.workday/workersync"
xmlns:xtt="urn:com.workday/xtt"
exclude-result-prefixes="xsl ws">
<xsl:output
method="xml"
encoding="UTF-8"
omit-xml-declaration="yes"/>
<xsl:template match="/">
<File xtt:separator="&#13;&#10;">
<xsl:for-each select="/ws:Worker_Sync/ws:Worker">
<Record>
<!-- Employee ID: 10 -->
<Employee_ID
xtt:fixedLength="10"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(ws:Summary/ws:Employee_ID),
1,
10
)"/>
</Employee_ID>
<!-- Legal First Name: 20 -->
<Legal_First_Name
xtt:fixedLength="20"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(
ws:Personal/ws:Name_Data/ws:First_Name
),
1,
20
)"/>
</Legal_First_Name>
<!-- Legal Last Name: 20 -->
<Legal_Last_Name
xtt:fixedLength="20"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(
ws:Personal/ws:Name_Data/ws:Last_Name
),
1,
20
)"/>
</Legal_Last_Name>
<!-- Date of Birth: not present in current Worker Sync XML -->
<Date_of_Birth
xtt:fixedLength="10"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:variable
name="birthDate"
select="normalize-space(
ws:Personal/ws:Birth_Date
)"/>
<xsl:if test="$birthDate != ''">
<xsl:value-of
select="concat(
substring($birthDate, 9, 2),
substring($birthDate, 6, 2),
substring($birthDate, 1, 4)
)"/>
</xsl:if>
</Date_of_Birth>
<!-- Home Country: not present in current Worker Sync XML -->
<Home_Address_Country
xtt:fixedLength="2"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(
ws:Personal/ws:Home_Address_Country
),
1,
2
)"/>
</Home_Address_Country>
<!-- Work Location Country: 2 -->
<Work_Location_Country
xtt:fixedLength="2"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(
ws:Position/ws:Business_Site_Country
),
1,
2
)"/>
</Work_Location_Country>
<!-- Job Profile: 15 -->
<Job_Profile
xtt:fixedLength="15"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(
ws:Position/ws:Job_Profile
),
1,
15
)"/>
</Job_Profile>
<!-- Hire Date: 8, DDMMYYYY -->
<Hire_Date
xtt:fixedLength="8"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:variable
name="hireDate"
select="normalize-space(
ws:Status/ws:Hire_Date
)"/>
<xsl:if test="$hireDate != ''">
<xsl:value-of
select="concat(
substring($hireDate, 9, 2),
substring($hireDate, 6, 2),
substring($hireDate, 1, 4)
)"/>
</xsl:if>
</Hire_Date>
<!-- Manager ID: 10 -->
<Manager_ID
xtt:fixedLength="10"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(
ws:Position/ws:Supervisor/ws:Supervisor_ID
),
1,
10
)"/>
</Manager_ID>
<!-- Cost Center: not present in current Worker Sync XML -->
<Cost_Center
xtt:fixedLength="10"
xtt:align="left"
xtt:paddingCharacter=" ">
<xsl:value-of
select="substring(
normalize-space(ws:Cost_Center),
1,
10
)"/>
</Cost_Center>
</Record>
</xsl:for-each>
</File>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment