如何使用xslt转换为TAB分隔的文本文件

时间:2019-04-11 02:05:55

标签: xslt

我已经有了xslt代码,该代码通常将数据转换为以COMMA分隔的CSV文本文件,但是我想修改此代码以将数据转换为带有TAB DELIMITED FILE的CSV。您能帮忙改变一下吗?

也请指导我一些材料以学习基础知识。 谢谢, 迪帕。

XSLT代码:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ws="urn:com.workday/workersync" xmlns:xtt="urn:com.workday/xtt" xmlns:etv="urn:com.workday/etv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xs ws" version="2.0">
<xsl:output method="xml"/>
<xsl:template match="/">
<File xmlns:xtt="urn:com.workday/xtt" xtt:quotes="csv" xtt:separator="
 ">
<xsl:for-each select="ws:Worker_Sync/ws:Worker/ws:Additional_Information">
<xsl:variable name="Current_date">
<xsl:value-of select="current-date()"/>
</xsl:variable>
<Record xtt:separator="," xtt:quotes="csv">
<PositionName>
<xsl:value-of select="ws:PositionName"/>
</PositionName>
<EffectiveStartDate xtt:dateFormat="MM/dd/yyyy">
<xsl:value-of select="$Current_date"/>
</EffectiveStartDate>
<EffectiveEndDate xtt:dateFormat="MM/dd/yyyy">
<xsl:value-of select="ws:EffectiveEndDate"/>
</EffectiveEndDate>
<EmployeeID>
<xsl:value-of select="ws:EmployeeID"/>
</EmployeeID>
<PayeeType>
<xsl:value-of select="ws:PayeeType"/>
</PayeeType>
<PlanName>
<xsl:value-of select="''"/>
</PlanName>
<ManagerName>
<xsl:value-of select="ws:ManagerName"/>
</ManagerName>
<TitleName>
<xsl:value-of select="ws:JobCode"/>
</TitleName>
<PositionGroupName>
<xsl:value-of select="''"/>
</PositionGroupName>
<TargetCompensation>
<xsl:value-of select="''"/>
</TargetCompensation>
<UnitTypeForTargetCompensation>
<xsl:value-of select="''"/>
</UnitTypeForTargetCompensation>
<BusinessUnitName>
<xsl:value-of select="ws:BusinessUnitName"/>
</BusinessUnitName>
<Description>
<xsl:value-of select="''"/>
</Description>
<JobTitle>
<xsl:value-of select="ws:JobTitle"/>
</JobTitle>
<JobProfile>
<xsl:value-of select="ws:JobProfile"/>
</JobProfile>
<TeamNumber>
<xsl:value-of select="''"/>
</TeamNumber>
<GENERICATTRIBUTE4>
<xsl:value-of select="ws:Location"/>
</GENERICATTRIBUTE4>
<GENERICATTRIBUTE5>
<xsl:value-of select="ws:PlanNo"/>
</GENERICATTRIBUTE5>
<GENERICATTRIBUTE6>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE6>
<GENERICATTRIBUTE7>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE7>
<GENERICATTRIBUTE8>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE8>
<GENERICATTRIBUTE9>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE9>
<GENERICATTRIBUTE10>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE10>
<GENERICATTRIBUTE11>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE11>
<GENERICATTRIBUTE12>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE12>
<GENERICATTRIBUTE13>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE13>
<GENERICATTRIBUTE14>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE14>
<GENERICATTRIBUTE15>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE15>
<GENERICATTRIBUTE16>
<xsl:value-of select="''"/>
</GENERICATTRIBUTE16>
<GENERICNUMBER1>
<xsl:value-of select="''"/>
</GENERICNUMBER1>
<UNITTYPEFORGENERICNUMBER1>
<xsl:value-of select="''"/>
</UNITTYPEFORGENERICNUMBER1>
<GENERICNUMBER2>
<xsl:value-of select="''"/>
</GENERICNUMBER2>
<UNITTYPEFORGENERICNUMBER2>
<xsl:value-of select="''"/>
</UNITTYPEFORGENERICNUMBER2>
<GENERICNUMBER3>
<xsl:value-of select="''"/>
</GENERICNUMBER3>
<UNITTYPEFORGENERICNUMBER3>
<xsl:value-of select="''"/>
</UNITTYPEFORGENERICNUMBER3>
<GENERICNUMBER4>
<xsl:value-of select="''"/>
</GENERICNUMBER4>
<UNITTYPEFORGENERICNUMBER4>
<xsl:value-of select="''"/>
</UNITTYPEFORGENERICNUMBER4>
<GENERICNUMBER5>
<xsl:value-of select="''"/>
</GENERICNUMBER5>
<UNITTYPEFORGENERICNUMBER5>
<xsl:value-of select="''"/>
</UNITTYPEFORGENERICNUMBER5>
<GENERICNUMBER6>
<xsl:value-of select="''"/>
</GENERICNUMBER6>
<UNITTYPEFORGENERICNUMBER6>
<xsl:value-of select="''"/>
</UNITTYPEFORGENERICNUMBER6>
<GENERICDATE1>
<xsl:value-of select="ws:JobEntryDate"/>
</GENERICDATE1>
<GENERICDATE2>
<xsl:value-of select="''"/>
</GENERICDATE2>
<GENERICDATE3>
<xsl:value-of select="''"/>
</GENERICDATE3>
<GENERICDATE4>
<xsl:value-of select="''"/>
</GENERICDATE4>
<GENERICDATE5>
<xsl:value-of select="''"/>
</GENERICDATE5>
<GENERICDATE6>
<xsl:value-of select="''"/>
</GENERICDATE6>
<GENERICBOOLEAN1>
<xsl:value-of select="''"/>
</GENERICBOOLEAN1>
<GENERICBOOLEAN2>
<xsl:value-of select="''"/>
</GENERICBOOLEAN2>
<GENERICBOOLEAN3>
<xsl:value-of select="''"/>
</GENERICBOOLEAN3>
<GENERICBOOLEAN4>
<xsl:value-of select="''"/>
</GENERICBOOLEAN4>
<GENERICBOOLEAN5>
<xsl:value-of select="''"/>
</GENERICBOOLEAN5>
<GENERICBOOLEAN6>
<xsl:value-of select="''"/>
</GENERICBOOLEAN6>
<CREDITSTARTDATE>
<xsl:value-of select="''"/>
</CREDITSTARTDATE>
<CREDITENDDATE>
<xsl:value-of select="''"/>
</CREDITENDDATE>
<PROCESSINGSTARTDATE>
<xsl:value-of select="''"/>
</PROCESSINGSTARTDATE>
<PROCESSINGENDDATE>
<xsl:value-of select="''"/>
</PROCESSINGENDDATE>
</Record>
</xsl:for-each>
</File>
</xsl:template>
</xsl:stylesheet>

0 个答案:

没有答案