Not able to transfer data as CSv from XSLT file

Hi.

I have below XSLT file for outbound port positive pay , it is giving the output file as CSV (I have created the two classes by extending the Aiffilesystemadapter and AifFileSystemSendadapter Classes to get the CSV format).

 

<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/">
<xsl:apply-templates select="//s1:BankPositivePay"></xsl:apply-templates>
</xsl:template>
<xsl:template match="//s1:BankPositivePay">
<Document>
<xsl:value-of select="'&#13;&#10;'" />
    <xsl:for-each select="s1:BankAccountTable">
       <xsl:if test="count(child::s1:BankChequeTable) >0">
          <xsl:value-of select='string("Record Type,Routing Number,Account Number,Check Number,Issue Date,Amount,Payee                 Name")'/>
<xsl:value-of select="'&#13;&#10;'" />
<xsl:for-each select="s1:BankChequeTable">
<xsl:value-of select='string("I")'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:RegistrationNumber/text()'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:AccountNum/text()'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:ChequeNum/text()'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:TransDate/text()'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:AmountCur/text()'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:BankNegInstRecipientName/text()'/>
<xsl:value-of select="'&#44;'" />
</xsl:for-each>
</xsl:if>
<xsl:value-of select='s1:RegistrationNum/text()'/>
<xsl:value-of select="'&#44;'" />
<xsl:value-of select='s1:AccountNum/text()'/>
<xsl:value-of select="'&#44;'" />
</xsl:for-each>
</Document>
</xsl:template>

I am getting the only two fields which are from bankaccounttable (AccountNum and RegistratinNum), I am not getting the remaining fields from BankCheque table (child table).

When I put the format as ".TXT" in newly created adapter classes I am getting all the fields in the Text Format.

 

Kindly suggest if anything wrong with XSLT file.

 

Thanks

  • Hi Martin,

    Could you please suggest anything ..?
  • In reply to Hariyadav:

    Your code doesn't look like a typical XSLT template; it seems you're trying to use imperative programming instead of pattern matching. Could you show us your input file, please, so we can suggest different implementation?
Related
Recommended