Subject: Re: Displaying every 2 element values in 1 rowy From: Mike Brown <mike@xxxxxxxx> Date: Tue, 25 Apr 2000 19:27:49 -0600 (MDT) |
> 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Displaying every 2 element values i, Selva, Francis | Thread | Re: Displaying every 2 element valu, Noah Nordrum |
string handling, Jeff Lansing | Date | Re: Web Connection, Scott Boag/CAM/Lotus |
Month |