[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Displaying every 2 element values in 1 rowy

Subject: RE: Displaying every 2 element values in 1 rowy
From: "Selva, Francis" <Francis.Selva@xxxxxxxxxxxxxxx>
Date: Wed, 26 Apr 2000 11:05:23 -0700
developer rowy
Mike,Sorry for prolonging this question.But what am I doing wrong here?.

This is my xml
<empdb>
    <emp>
        <eno>A21</eno>
    </emp>
    <emp>
        <eno>A22</eno>
    </emp>
    <emp>
        <eno>A23</eno>
    </emp>
    <emp>
        <eno>A24</eno>
    </emp>
    <emp>
        <eno>A25</eno>
    </emp>
    <emp>
        <eno>A26</eno>
    </emp>
</empdb>

And I used ur xsl as follows:

<xsl:template match="empdb//emp">
<!-- look at every 1st, 3rd, 5th, etc 'eno' element child of current node
--> 
<xsl:for-each select="eno[position() mod 2 = 1]">
  <!-- start a new table row -->
  <tr>
    <!-- cell 1: value of current 'eno' -->
    <td>
      <xsl:value-of select="."/>
    </td>
    <!-- cell 2: value of next 'eno' or a non-breaking space if none -->
    <td>
      <xsl:choose>
        <xsl:when test="following-sibling::eno">
          <xsl:value-of select="following-sibling::eno[1]"/>
        </xsl:when>
        <xsl:otherwise>&#160;</xsl:otherwise>
      </xsl:choose>
    </td>
  </tr>
</xsl:for-each>
</xsl:template>



What is it that Im not doing right?.I changed the template match in all
possible ways but still Im getting all the values in one row.

Francis




 
> 
> > Mike,Im getting all the values in one row like A21 A22 A23 
> > A24 A25 A26.I
> > need something like
> > A21 A22
> > A23 A24
> > A25 A26
> > 
> > Can u pl tell me how can I do this format?
> > >           <xsl:value-of select="following-sibling::eno"/>
> 
> Should be
>               <xsl:value-of select="following-sibling::eno[1]"/>
> 
> Mike Kay
> 
 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.