|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: rookie questions - Try 2
> Currently each time it loops through the results a </TR> is > inserted to end the row in a html table. How would I modify the style sheet > to insert that tag every other time it loops through? First you need to understand that stylesheets don't write tags, they write nodes to a tree. Creating a TR element node is one operation, you can't split it into writing a start tag and an end tag. You want to create a TR element node for every 2 items in the input, so the simplest way to do it is along the lines: <xsl:template match="item[position() mod 2 = 0]"> <tr> <td><xsl:value-of select="."/></td> <td><xsl:value-of select="following-sibling::item"/></td> </tr> </xsl:template> <xsl:template match="item[position() mod 2 != 0]"/> Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








