[Home] [By Thread] [By Date] [Recent Entries]
Tempore 15:47:57, die 01/24/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit samir sawant
<cindy_mona@xxxxxxxxx>:
Need to convert this in following format where i will get 2 columns side by side on pages which will continue till the end of data. Flow of the data on the page should be down and then across Something like this might do: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="html"/> <xsl:variable name="size" select="ceiling(count(root/region/row) div 2)"/> <xsl:template match="root"> <html> <body> <xsl:apply-templates select="region"/> </body> </html> </xsl:template> <xsl:template match="region">
<table>
<thead>
<th>field A</th>
<th>field B</th>
</thead>
<xsl:apply-templates select="row[position() <= $size]"/>
</table>
</xsl:template><xsl:template match="row">
<tr>
<xsl:apply-templates select="." mode="col"/>
</tr>
<xsl:if test="position() mod 5=0">
<tr><td><br/></td><td><br/></td></tr>
</xsl:if>
</xsl:template><xsl:template match="row" mode="col"> <td style="border-right:1px solid black"> <xsl:apply-templates select="*"/> </td> <td> <xsl:apply-templates select="following-sibling::row[position()=$size]/*"/> </td> </xsl:template> <xsl:template match="field"> <xsl:apply-templates/><xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet>
|

Cart



