我是 XSLT 的新手,我正在尝试将我的客户端 xml 数据转换为固定宽度的文件。有一个条件是所有行(最后一行除外)都必须以回车符结尾。我不知道如何在最后一行之后摆脱那个回车。这是我到目前为止所拥有的:-->
<xsl:for-each select="/wd:Report_Data/wd:Report_Entry">
<xsl:value-of select="substring(concat('0',wd:XMLNAME_2,$padding),1,2)"/>
<xsl:value-of select="substring(concat(wd:Company/wd:Employer_s_Federal_ID_Number,$padding),1,9)"/>
<xsl:value-of select="substring(concat((wd:Company_-_Name),$padding),1,45)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:Address_-_Formatted_Line_1,$padding),1,40)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:Address_-_Formatted_Line_2,$padding),1,40)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:Address_-_Formatted_Line_3,$padding),1,40)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:city,$padding),1,25)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:State_ISO_Code,$padding),1,2)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:Postal_Code,$padding),1,5)"/>
<xsl:value-of select="substring(concat(' ',$padding),1,4)"/>
<xsl:value-of select="substring(concat(wd:CF_NewHire_Contact_First,$padding),1,16)"/>
<xsl:value-of select="substring(concat(wd:CF_NewHire_Contact_Last,$padding),1,30)"/>
<xsl:value-of select="substring(concat(CF_NewHire_Contact_Ext,CF_NewHIre_Contact_Phone,$padding),1,10)"/>
<xsl:value-of select="substring(concat(wd:Social_Security_Number,$padding),1,9)"/>
<xsl:value-of select="substring(concat(wd:Legal_Name_-_First_Name,$padding),1,16)"/>
<xsl:value-of select="substring(concat(wd:Legal_Name_-_Middle_Name,$padding),1,6)"/>
<xsl:value-of select="substring(concat(wd:Legal_Name_-_Last_Name,$padding),1,30)"/>
<xsl:value-of select="substring(concat(wd:CF_Global_BirthDate_yyyymmdd,$padding),1,8)"/>
<xsl:value-of select="substring(concat(wd:Primary_Work_Address/wd:State_ISO_Code_2,$padding),1,2)"/>
<xsl:value-of select="substring(concat(wd:CF_Global_Hire_yyyymmdd,$padding),1,8)"/>
<xsl:value-of select="substring(concat(wd:Primary_Home_Address/wd:Address_-_Formatted_Line_1,$padding),1,40)"/>
<xsl:value-of select="substring(concat(wd:Primary_Home_Address/wd:Address_-_Formatted_Line_2,$padding),1,40)"/>
<xsl:value-of select="substring(concat(wd:Primary_Home_Address/wd:Address_-_Formatted_Line_3,$padding),1,40)"/>
<xsl:value-of select="substring(concat(wd:Primary_Home_Address/wd:city,$padding),1,25)"/>
<xsl:value-of select="substring(concat(wd:Primary_Home_Address/wd:State_ISO_Code,$padding),1,2)"/>
<xsl:value-of select="substring(concat(wd:Primary_Home_Address/wd:Postal_Code,$padding),1,5)"/>
<xsl:value-of select="substring(concat(' ',$padding),1,4)"/>
<xsl:value-of select="substring(concat(' ',$padding),1,35)"/>
<xsl:value-of select="substring(concat(' ',$padding),1,35)"/>
<xsl:value-of select="$delimiter"></xsl:value-of>
</xsl:for-each>
</xsl:template>