Documente Academic
Documente Profesional
Documente Cultură
org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-pref
ixes="msxsl"
xmlns:cs="urn:cs">
<msxsl:script language="C#" implements-prefix="cs">
<msxsl:using namespace="System"/>
<![CDATA[
public string fnDate(string DueDateTime)
{
return Convert.ToDateTime(DueDateTime).AddDays(90).ToString("dd/
MM/yyyy");
}
public string TrailingSpace(int i, string A, st
ring B )
{
string str=A;
if (A.Length < i)
{
for(int temp=A.Length; temp<i;temp++){
str=str+B;}
return str;
}
else
{
return str;
}
}
public string LeadingChar(int i, string A, string B)
{
string str = "";
if (A.Length < i)
{
for(int temp=A.Length; temp<i;temp++){
str=str + B;
}
return str + A;
}
else
{
return A.Substring(0,i);
}
}
public string ReplaceChar(string A, string B, string C)
{
return A.Replace(B,C);
}
]]>
</msxsl:script>
<xsl:output method="text"/>
<!-- variables -->
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwx
yz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWX
YZ'" />
<xsl:template match="/">
<xsl:value-of select="Export/Record/H_RecordID" />
<xsl:value-of select="Export/Record/H_FileCreation" />
<xsl:value-of select="Export/Record/H_PayGroup" />
<xsl:value-of select="Export/Record/H_Filer" />
<xsl:text disable-output-escaping="yes">
</xsl:text>
<xsl:for-each select="Export/Record">
<xsl:if test="string-length(normalize-space(TermDate)) = 0 or (stringlength(normalize-space(TermDate)) > 0 and cs:DaysAgo(TermDate) < 180)">
<xsl:value-of select="RecordID" />
<xsl:choose>
<xsl:when test="string-length(normalize-space(CheckDate)) != 0">
<xsl:value-of select="CheckDate" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="EmployeeSSN" />
<xsl:value-of select="FirstName" />
<xsl:value-of select="MiddleName" />
<xsl:value-of select="Lastname" />
<xsl:value-of select="Filer" />
<xsl:choose>
<xsl:when test="normalize-space(PayrollCompany) = 42010">
<xsl:text>002</xsl:text>
</xsl:when>
<xsl:when test="normalize-space(PayrollCompany) = 12010">
<xsl:text>002</xsl:text>
</xsl:when>
<xsl:when test="normalize-space(PayrollCompany) = 32010">
<xsl:text>002</xsl:text>
</xsl:when>
<xsl:when test="normalize-space(PayrollCompany) = 02000">
<xsl:text>001</xsl:text>
</xsl:when>
<xsl:text>000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="Filer_1" />
<xsl:choose>
<xsl:when test="string-length(normalize-space(MailAddr1)) != 0">
<xsl:value-of select="translate(MailAddr2,'&',' ')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(HomeAddr1,'&',' ')" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(MailAddr1)) != 0">
<xsl:value-of select="cs:TrailingSpace(35,normalize-space(translate(Ma
ilAddr1,'&',' ')),' ')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(HomeAddr2,'&',' ')" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(MailAddr1)) != 0">
<xsl:value-of select="translate(MailCity,'&',' ')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="HomeCity" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(MailAddr1)) != 0">
<xsl:value-of select="translate(MailState,'&',' ')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="HomeState" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(MailAddr1)) != 0">
<xsl:value-of select="substring(translate(MailZip,'-',''),0,10)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(translate(HomeZip,'-',''),0,10)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="Filer_2" />
<xsl:choose>
<xsl:when test="EmploymentStatus = 'ON LEAVE'">
<xsl:text>02</xsl:text>
</xsl:when>
<!--xsl:when test="EmploymentStatus = 'TERMINATED'"-->
<xsl:when test="translate(EmploymentStatus , $smallcase, $uppercase) = '
TERMINATED'">
<xsl:text>03</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>01</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="TermReasonID = '03'">
<xsl:text>R</xsl:text>
</xsl:when>
<xsl:when test="TermReasonID = '11'">
<xsl:text>I</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '04'">
<xsl:text>X</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '01'">
<xsl:text>D</xsl:text>
</xsl:when>
<xsl:when test="string-length(normalize-space(TermDate)) > 0">
<xsl:text>T</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="EmployeeSex" />
<xsl:value-of select="Filer_3" />
<xsl:choose>
<xsl:when test="string-length(normalize-space(EmployeeBirthDate)) != 0">
<xsl:value-of select="EmployeeBirthDate" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(HireDate)) != 0">
<xsl:value-of select="HireDate" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(DateLastHire)) != 0">
<xsl:value-of select="DateLastHire" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(normalize-space(VestingDate)) != 0">
<xsl:value-of select="VestingDate" />
</xsl:when>
<xsl:when test="string-length(normalize-space(HireDate)) != 0">
<xsl:value-of select="HireDate" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(
cs:ReplaceChar(CompanyGuaranteeContrib1,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar(
CompanyGuaranteeContrib1,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="substring(CompanySpecialContrib,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:R
eplaceChar(CompanySpecialContrib,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar(Comp
anySpecialContrib,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="substring(CompanySeniorValueContrib,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:R
eplaceChar(CompanySeniorValueContrib,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar(Comp
anySeniorValueContrib,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="substring(ProfitSharing,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:R
eplaceChar(ProfitSharing,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar(Prof
itSharing,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>0000000000000</xsl:text>
<xsl:choose>
<xsl:when test="substring(LoanPayment1,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:R
eplaceChar(LoanPayment1,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar(Loan
Payment1,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="substring(LoanPayment2,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:R
eplaceChar(LoanPayment2,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar(Loan
Payment2,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:text>+</xsl:text>
<xsl:value-of select="YTDDBPlanCoveredPay" />
<xsl:choose>
<xsl:when test="TerminationCode = '11'">
<xsl:text>11</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '08'">
<xsl:text>08</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '09'">
<xsl:text>09</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '03'">
<xsl:text>03</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '05'">
<xsl:text>05</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '10'">
<xsl:text>16</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '15'">
<xsl:text>15</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '10'">
<xsl:text>10</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '06'">
<xsl:text>06</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '13'">
<xsl:text>13</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '14'">
<xsl:text>14</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '12'">
<xsl:text>12</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '01'">
<xsl:text>01</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '02'">
<xsl:text>02</xsl:text>
</xsl:when>
<xsl:when test="TerminationCode = '04'">
<xsl:text>04</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>00</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="EmploymentStatus = 'ON LEAVE'">
<xsl:value-of select="LeaveStartDate1" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="EmploymentStatus = 'ACTIVE' and TermReasonID = 'Reinstat
'">
<xsl:value-of select="LeaveStartDate1" />
</xsl:when>
<xsl:otherwise>
<xsl:text>00000000</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="EmployeeNumber1" />
<xsl:value-of select="Filer_8" />
<xsl:text disable-output-escaping="yes">
</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="Export/Record/T_RecordID" />
<xsl:value-of select="Export/Record/T_Filer" />
<xsl:variable name="Var_PreTax">
<xsl:value-of select="format-number(sum(//Export/Record/PreTaxContrib)+sum
(//Export/Record/PreTaxContrib1), '#.00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_PreTax,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_PreTax,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_P
reTax,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Var_EmpMatchCont">
<xsl:value-of select="format-number(sum(//Export/Record/EmployerMatchingCo
ntrib)+sum(//Export/Record/EmployerMatchingContrib1)+ sum(//Export/Record/Employ
erMatchingContrib2), '#.00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_EmpMatchCont,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_EmpMatchCont,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_E
mpMatchCont,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Var_CompGuarCont">
<xsl:value-of select="format-number(sum(//Export/Record/CompanyGuaranteeCo
ntrib)+sum(//Export/Record/CompanyGuaranteeContrib1), '#.00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_CompGuarCont,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_CompGuarCont,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_C
ompGuarCont,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Var_CompSpecCont">
<xsl:value-of select="format-number(sum(//Export/Record/CompanySpecialCont
rib), '#.00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_CompSpecCont,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_CompSpecCont,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_C
ompSpecCont,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Var_CompSeniorCont">
<xsl:value-of select="format-number(sum(//Export/Record/CompanySeniorValue
Contrib), '#.00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_CompSeniorCont,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_CompSeniorCont,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_C
ompSeniorCont,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Var_ProfitSharing">
<xsl:value-of select="format-number(sum(//Export/Record/ProfitSharing), '#
.00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_ProfitSharing,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_ProfitSharing,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_P
rofitSharing,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="Export/Record/T_Filer1" />
<xsl:variable name="Var_LoanPayment1">
<xsl:value-of select="format-number(sum(//Export/Record/LoanPayment1), '#.
00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_LoanPayment1,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_LoanPayment1,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_L
oanPayment1,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="Var_LoanPayment2">
<xsl:value-of select="format-number(sum(//Export/Record/LoanPayment2), '#.
00')" />
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($Var_LoanPayment2,1,1) = '-'">
<xsl:value-of select="concat('-',cs:LeadingChar(12,cs:ReplaceChar(cs:Rep
laceChar($Var_LoanPayment2,'-',''),'.',''),'0'))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('+',cs:LeadingChar(12,cs:ReplaceChar($Var_L
oanPayment2,'.',''),'0'))" />
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="Export/Record/T_Filer2" />
</xsl:template>
<xsl:template name="padRightSide">
<xsl:param name="stringToPad"/>
<xsl:param name="totalLength"/>
<xsl:param name="padChar" select="' '"/>
<xsl:param name="padBuffer" select=
"concat($padChar,$padChar,$padChar,$padChar,$padChar,
$padChar,$padChar,$padChar,$padChar,$padChar
)"/>
<xsl:variable name="vNewString" select=
"concat($stringToPad, $padBuffer)"/>
<xsl:choose>
<xsl:when test="not(string-length($vNewString) >= $totalLength)">
<xsl:call-template name="padRightSide">
<xsl:with-param name="stringToPad" select="$vNewString"/>
<xsl:with-param name="totalLength" select="$totalLength"/>
<xsl:with-param name="padChar" select="$padChar"/>
<xsl:with-param name="padBuffer" select="$padBuffer"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=
"substring($vNewString,
string-length($vNewString) - $totalLength + 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Special Offers.
Ads By Torntv V9.0