|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Creating Columnar Table format with XML data
Please try this XSLT stylesheet -
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="yes" />
<xsl:template match="/root">
<html>
<head>
<title/>
</head>
<body>
<table>
<tr>
<xsl:apply-templates select="column" />
</tr>
<xsl:call-template name="printRows">
<xsl:with-param name="list"
select="descendant::bullet[@ID='1'] | descendant::bullet[@ID='3']" />
</xsl:call-template>
<xsl:call-template name="printRows">
<xsl:with-param name="list" select="descendant::bullet[@ID='2'] |
descendant::bullet[@ID='4']" />
</xsl:call-template>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="column">
<td>
<xsl:value-of select="@title" />
</td>
</xsl:template>
<xsl:template name="printRows">
<xsl:param name="list" />
<tr>
<xsl:for-each select="$list">
<xsl:if test="((count($list) = 1) and (($list/@ID = '3') or
($list/@ID = '4')))">
<td/>
</xsl:if>
<td>
<xsl:value-of select="tip" />
</td>
<xsl:if test="((count($list) = 1) and (($list/@ID = '1') or
($list/@ID = '2')))">
<td/>
</xsl:if>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
|
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








