Positive pay ExampleXSLT coding

Hi all,

Positive pay configuration

I have trouble displaying couple of fields from my XSLT to TXT output.

XSLT:

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version=“1.0” xmlns:xsl="">www.w3.org/…/Transform"
xmlns:msxsl=“urn:schemas-microsoft-com:xslt” exclude-result-prefixes=“msxsl s0 s1 xslthelper” xmlns=“urn:iso:std:iso:20022:tech:xsd:pain.001.001.02”
xmlns:xsi="">www.w3.org/…/XMLSchema-instance" xmlns:xslthelper="">schemas.microsoft.com/…/xslthelper"
xmlns:s0="">schemas.microsoft.com/…/sharedtypes" xmlns:s1="">schemas.microsoft.com/…/BankPositivePay">
<xsl:output version=“1.0” omit-xml-declaration=“no” indent=“yes” encoding=“utf-8” method=“xml”></xsl:output>
<xsl:template match="/">
<xsl:apply-templates select="//s1:BankPositivePay"></xsl:apply-templates>
</xsl:template>
<xsl:template match="//s1:BankPositivePay">
<xsl:for-each select=“s1:BankAccountTable”>
<xsl:if test=“count(child::s1:BankChequeTable) >0”>

<xsl:for-each select=“s1:BankChequeTable”>

<xsl:value-of select=‘AccountNum/text()’/>
<xsl:value-of select="’,’" />

<xsl:value-of select=‘RegistrationNum/text()’/>
<xsl:value-of select="’,’" />

<xsl:value-of select=‘s1:ChequeNum/text()’/>
<xsl:value-of select="’,’" />

<xsl:value-of select=‘s1:AmountCur/text()’/>
<xsl:value-of select="’,’" />

<xsl:value-of select=‘s1:BankNegInstRecipientName/text()’/>
<xsl:value-of select="’ '" />
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>

Output TXT:

,1,1.00, Payee name

I am unable to display first two fields which are Bank Account number and Routing number (From: Parent table: BankAccountTable).

Please let me know how to call them inside child table using XSLT, Thanks in Advance.

-Neha

You say they’re in BankAccountTable, but you’re trying to find them under BankChequeTable, aren’t you?

By the way, you can debug XSLT code in Visual Studio.

Yes, I need a syntax to find them from BanlAccoountTable in bankChequeTable for-each loop.

I wouldn’t use any loop in the first place; you can simply use pattern matching.

Anyway, if you want to do it once for each BankAccountTable, simply move your code to the right loop. If you want to repeat the same values for each check (for the given account), you must change your selectors to get data from the right place. I guess that something like …/s1:ChequeNum/text() would do the job. It would be wise to test your XPath selector before putting it to the transformation; it’s easier to test smaller pieces in isolation and you can use tools that will help you with testing XPath.