Help not duplicating previous matches

Discussion in 'XML' started by johkar, Aug 8, 2003.

  1. johkar

    johkar Guest

    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>
    johkar, Aug 8, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AC
    Replies:
    0
    Views:
    518
  2. Don

    Duplicating datasheet screens

    Don, Feb 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    351
  3. Todd Plambeck

    ASP.Net Duplicating DB Entries

    Todd Plambeck, Aug 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    499
  4. George Jempty

    log4j duplicating appender entries

    George Jempty, Jan 7, 2005, in forum: Java
    Replies:
    2
    Views:
    2,470
  5. Pete Nudd
    Replies:
    3
    Views:
    337
    Denis Remezov
    Apr 16, 2004
Loading...

Share This Page