This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Displaying every 2 element values in 1 rowy
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Displaying every 2 element values in 1 rowy
- From: "Selva, Francis" <Francis dot Selva at purchasepro dot com>
- Date: Wed, 26 Apr 2000 09:44:26 -0700
- Reply-To: xsl-list at mulberrytech dot com
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?
Francis
>
>
> > How can I display every two element node values in one row
> by checking the
> > position?
> >
> > If I have an xml like:
> >
> > <eno>A21</eno>
> > <eno>A22</eno>
> > <eno>A23</eno>
> > <eno>A24</eno>
> > <eno>A25</eno>
> > <eno>A26</eno>
>
> <!-- 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"/>
> </xsl:when>
> <xsl:otherwise> </xsl:otherwise>
> </td>
> </tr>
> </xsl:for-each>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list