This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Displaying every 2 element values in 1 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]