[xsl] Getting Duplicate value while retrieving

Subject: [xsl] Getting Duplicate value while retrieving
From: "karthikeyan.balasubramanian" <karthikeyan.balasubramanian@xxxxxxxxxxxxx>
Date: Tue, 18 Nov 2003 15:48:27 +0530
Hi,

  I am not sure why I am getting duplicate values.

  I tried all permutation/combinations.

  Output Expected
  ------------------

A2873-300
36 11 49 01 150      1
A3122-8
26 12 01 02 012      3
VN936NP9C
71 21 00 01 190      2
71 21 00 01A 100   2
71 21 11 01 440      2

Current Output
-----------------

A2873-300
36 11 49 01 150      1
A3122-8
26 12 01 02 012      3
VN936NP9C
71 21 00 01 190      222
71 21 00 01A 100   222
71 21 11 01 440      222

XML Content
---------------

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="karthik_test1.xsl"?>
<NI PUBLISH="SEP 01/03">
 <HEADER>
  <PARA>ipc</PARA>
  <PARA>COMPONENT MAINTENANCE MANUAL</PARA>
 </HEADER>
 <TABLE>
  <THEAD>
   <ROW>
    <ENTRY>
     <PARA>PART NUMBER</PARA>
     <PARA>CH SECT UNIT FIG ITEM</PARA>
     <PARA>TTL. REQ.</PARA>
    </ENTRY>
    <ENTRY>
     <PARA>AIRLINE PART NO.</PARA>
    </ENTRY>
   </ROW>
  </THEAD>
  <TBODY>
   <ROW>
    <ENTRY>
     <PARA>A2873-300</PARA>
     <PARA>36 11 49 01 150</PARA>
    </ENTRY>
    <ENTRY>
     <PARA/>
     <PARA>1</PARA>
    </ENTRY>
   </ROW>
   <ROW>
    <ENTRY>
     <PARA>A3122-8</PARA>
     <PARA>26 12 01 02 012</PARA>
    </ENTRY>
    <ENTRY>
     <PARA/>
     <PARA>3</PARA>
    </ENTRY>
   </ROW>
   <ROW>
    <ENTRY>
     <PARA>VN936NP9C</PARA>
     <PARA>71 21 00 01 190</PARA>
     <PARA>71 21 00 01A 100</PARA>
     <PARA>71 21 11 01 440</PARA>
    </ENTRY>
    <ENTRY>
     <PARA/>
     <PARA>2</PARA>
     <PARA>2</PARA>
     <PARA>2</PARA>
    </ENTRY>
   </ROW>
  </TBODY>
 </TABLE>
</NI>

XSL  Content
-----------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
 <xsl:template match="NI">
  <xsl:for-each select="TABLE/TBODY/ROW">
   <table border="1">
    <tbody>
     <tr>
      <td>
       <xsl:value-of select="ENTRY[1]/PARA[1]"/>
      </td>
      <td>
       <xsl:value-of select="ENTRY[2]/PARA[1]"/>
      </td>
     </tr>
     <xsl:for-each select="ENTRY[1]/PARA">
      <xsl:if test="position() &gt; 1">
       <tr>
        <td>
         <xsl:value-of select="."/>
        </td>
        <td>
         <xsl:value-of select="../following-sibling::*[1]"/>
        </td>
       </tr>
      </xsl:if>
     </xsl:for-each>
    </tbody>
   </table>
  </xsl:for-each>
 </xsl:template>
</xsl:stylesheet>

Any suggestions?

Have a great day.

Karthikeyan B





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread