2016-12-21 12 views
0

ASN IDOCをSAPからCSV形式に変換していますが、ヘッダーとコンテンツの間に空白行がないようにしたいと考えています。CSV出力の改行を削除する

マイコード:

<?xml version="1.0" encoding="UTF-8"?> 
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    exclude-result-prefixes="xs" 
    version="2.0"> 

    <xsl:output method="text" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>  

    <xsl:template match="/"> 
     <xsl:call-template name="printHeader"/> 
     <xsl:apply-templates select="DELVRY05/IDOC/E1EDL20/E1EDL24[LFIMG &gt; 0]"/>   
    </xsl:template> 

    <xsl:template name="printHeader"> 
     <xsl:text>ProductCode,Description,Invoice,Invoice Date,Batch,Expires,Barcode,Quantity&#10;</xsl:text> 
    </xsl:template> 

    <xsl:template match="E1EDL24"> 
     <xsl:value-of select="MATNR"/><xsl:text>,</xsl:text> 
     <xsl:value-of select="ARKTX"/><xsl:text>,</xsl:text> 
     <xsl:text>,</xsl:text><!--Invoice is empty--> 
     <xsl:text>,</xsl:text><!--Invoice date is empty--> 
     <xsl:value-of select="CHARG"/><xsl:text>,</xsl:text> 
     <xsl:value-of select="VFDAT"/><xsl:text>,</xsl:text> 
     <xsl:value-of select="EAN11"/><xsl:text>,</xsl:text><!--Barcode--> 
     <xsl:value-of select="LFIMG"/><xsl:text>&#10;</xsl:text> 
    </xsl:template> 

</xsl:stylesheet> 

CSV出力:Row 2 is blank and I need to remove it.

行2は空白であり、私はそれを削除する必要があり、誰かが助けてくださいすることができますか?

ありがとうございます。

+2

空白がどこから来るかをわかるように、問題を再現できるように入力サンプルを投稿しておく必要があります。 ''を追加することから始めることができます。 –

答えて

0

Hyのジャック、

は、多分それはこのために行の末尾に

&#10;

のだ:

<xsl:text>ProductCode,Description,Invoice,Invoice Date,Batch,Expires,Barcode,Quantity&#10;</xsl:text> 

関連する問題