Help not duplicating previous matches

J

johkar

New to XSL and in need of assistance. I am building the tags fine
iterating from a to b to c, now just need to keep the values from repeating
if previously matched. Note that within the Extensions nodes, I am only
concerned with those with fieldTypeCode of 10-17. There will be a maximum
of four fieldTypeCode that will meet this criteria.

Thank you

What I want outputted:

<box12a-1>L</box12a-1> <box12a-2>6635.86</box12a-2>

<box12b-1>J</box12b-1> <box12b-2>663.00</box12b-2>

<box12c-1>N</box12c-1> <box12c-2>5.86</box12c-2>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
<xsl:eek:utput method="html" />
<xsl:variable name="TaxRecordNode" select="ptrsTaxRecord/TaxRecord" />
<xsl:variable name="ExtensionNode"
select="$TaxRecordNode/taxDetail/extensions/Extension" />
<xsl:variable name="FieldTypeNode"
select="$TaxRecordNode/taxReturnType/fieldTypes/FieldType" />

<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="$ExtensionNode">
<xsl:with-param name="minNode">9</xsl:with-param>
</xsl:apply-templates>

</body>
</html>
</xsl:template>

<xsl:template match="Extension">
<xsl:param name="minNode" />
<xsl:variable name="num">
<xsl:number count="*" />
</xsl:variable>

<!-- I DID HAVE SOME CODE HERE WHICH VERIFIED THAT FIELDTYPECODE WAS > 9 AND
< 18 -->
&lt;box12
<xsl:number value="$num" format="a" />
-1&gt;
<xsl:value-of select="$FieldTypeNode[fieldTypeCode = *]/description" />
&lt;/box12
<xsl:number value="$num" format="a" />
-1&gt; &lt;box12
<xsl:number value="$num" format="a" />
-2&gt;
<xsl:value-of select="$ExtensionNode[fieldTypeCode = *]/reportableAmount" />
&lt;/box12
<xsl:number value="$num" format="a" />
-2&gt;
<br />

</xsl:template>

</xsl:stylesheet>

<?xml version="1.0" encoding="UTF-8"?>
<ptrsTaxRecord>
<TaxRecord>
<taxDetail>
<extensions>
<Extension>
<reportableText />
<fieldTypeCode>11</fieldTypeCode>
<reportableAmount>6635.86</reportableAmount>
</Extension>
<Extension>
<reportableText />
<fieldTypeCode>14</fieldTypeCode>
<reportableAmount>663.00</reportableAmount>
</Extension>
<Extension>
<reportableText />
<fieldTypeCode>16</fieldTypeCode>
<reportableAmount>5.86</reportableAmount>
</Extension>
<Extension>
<reportableText />
<fieldTypeCode>20</fieldTypeCode>
<reportableAmount>0.00</reportableAmount>
</Extension>
</extensions>
</taxDetail>
<taxReturnType>
<fieldTypes>
<FieldType>
<description>D</description>
<fieldTypeCode>10</fieldTypeCode>
</FieldType>
<FieldType>
<description>L</description>
<fieldTypeCode>11</fieldTypeCode>
</FieldType>
<FieldType>
<description>Z</description>
<fieldTypeCode>12</fieldTypeCode>
</FieldType>
<FieldType>
<description>G</description>
<fieldTypeCode>13</fieldTypeCode>
</FieldType>
<FieldType>
<description>J</description>
<fieldTypeCode>14</fieldTypeCode>
</FieldType>
<FieldType>
<description>M</description>
<fieldTypeCode>15</fieldTypeCode>
</FieldType>
<FieldType>
<description>N</description>
<fieldTypeCode>16</fieldTypeCode>
</FieldType>
<FieldType>
<description>P</description>
<fieldTypeCode>17</fieldTypeCode>
</FieldType>
</fieldTypes>
</taxReturnType>
</TaxRecord>
</ptrsTaxRecord>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

xsl:number as abc problem Please help? 0
Matching parameters 2
News Ticker 2
XSL node as string 1
Replace String 6
Problem in xml transformation using xslt 0
Cleaning out my disk 3
Merging tables with XSLT 2

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top