i am new to xsl transform. I don't know why the code is not going in template. I think its problem of namespace. Can anyone help me ASAP. Here is my code XSL Code:
<xsl:stylesheet version="1 .0" xmlns:xsl="http://ift.tt/tCZ8VR" xmlns:conv="HSW.FileConvertor" exclude-result-prefixes="conv" xmlns:x="http://ift.tt/1vbp1Xf">
<xsl:output method="xml" encoding="utf-8" indent="no"/>
<xsl:template match="/">
<xsl:value-of select="' PHONE;LANGUAGE;SMS_OPS_TYPE;CONTRACT_CODE;AMOUNT;DATE;DPD '"/>
<xsl:apply-templates select="/x:incomingPayments/x:incomingPayment" />
</xsl:template>
<xsl:template match="x:incomingPayment">
<xsl:if test="x:paymentChannel='DO_2013'">
<xsl:variable name="Contract_code" select="x:contractNumber"/>
<xsl:variable name="Amount" select="x:amount/x:moneyValue"/>
<xsl:call-template name="Contract_search">
<xsl:with-param name="Contract_code" select="$Contract_code"/>
<xsl:with-param name="Amount" select="$Amount"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="Contract_search">
<xsl:param name="Contract_code"/>
<xsl:param name="Amount"/>
<xsl:value-of select="$Contract_code"/>
<xsl:value-of select="' '"/>
<xsl:value-of select="$Amount"/>
<xsl:value-of select="' '"/>
</xsl:template>
and here is my xml code:
<?xml version="1.0" encoding="UTF-8"?>
<hsIncomingPaymentsFile xmlns="http://ift.tt/1vbp1Xf">
<incomingPayments>
<incomingPayment>
<depositDate>2014-08-11</depositDate>
<paymentChannel>DO_2013</paymentChannel>
<contractNumber>3300867119</contractNumber><!-- extracting this tag -->
<transactionDate>2014-08-11</transactionDate>
<amount>
<moneyValue>4850</moneyValue><!-- extracting this tag -->
<currency>INR</currency>
</amount>
<transactionNumber/>
<paymentType>PFC</paymentType>
</incomingPayment>
<!-- second record -->
<incomingPayment>
<depositDate>2014-08-11</depositDate>
<paymentChannel>DO_2013</paymentChannel>
<contractNumber>3300861289</contractNumber><!-- extracting this tag -->
<transactionDate>2014-08-11</transactionDate>
<amount>
<moneyValue>960</moneyValue><!-- extracting this tag -->
<currency>INR</currency>
</amount>
<transactionNumber/>
<paymentType>PFC</paymentType>
</incomingPayment>
</incomingPayments>
</hsIncomingPaymentsFile >
Please help me asap.
No comments:
Post a Comment