473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Help not duplicating previous matches

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:output 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>
Jul 20 '05 #1
0 1358

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: asd | last post by:
I need to find the value/index of the previously selected item of a select list. That is, when the user selects an item from the list and a certain condition elsewhere in the form is not met, I...
1
by: Mark ??;-\) | last post by:
I would like to display a listing of files on a web page as follows: If there is only one file: display the section name and then display the current file. If there is more than one file (for...
5
by: John | last post by:
I am new in Regular Expression. Could someone please help me in following expression? 1. the string cannot be empty 2. the string can only contains AlphaNumeric characters. No space or any...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
9
by: Tris | last post by:
Hi People I need help!!! Have got a excel file that i have put into an access file so that i can create a mailing carrier sheet without re typing everybodys details in. The excel file has...
2
by: john | last post by:
Is there a hotkey in Access that pastes the previous record's value in a field? In Excel it's Ctrl-D. Thanks, john
4
by: Mike S | last post by:
I am trying to set up a query that automate pulling the previous quarters data. I have an expression field that changes Date() in to a month only(1-12) MonthNo: DatePart("m",). Then is another...
118
by: Chuck Cheeze | last post by:
This might be in the wrong group, but... Here is an example of my data: entry_id cat_id 1 20 2 25 3 30 4 25 5 35
2
by: seanh | last post by:
Hi all, I need some advice regarding phpmyadmin, I installed phpmyadmin directory in the htdocs but when I go to my http://mysite.com/phpmyadmin I get a 500 internal error. I checked the files...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.