|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: grouping headers
watch for line wraps.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="person" mode="content">
<tr><td> <xsl:value-of select="name"/></td></tr>
</xsl:template>
<xsl:template match="person">
<tr><td>
<b> <xsl:value-of select="city"/></b></td></tr>
<xsl:apply-templates select="/people/person[city = current()/city]"
mode="content"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="/people">
<html>
<body bgcolor="#FFFFFF">
<xsl:element name="table">
<xsl:attribute name="rules">all</xsl:attribute>
<xsl:attribute name="border">1</xsl:attribute>
<xsl:apply-templates
select="person[preceding-sibling::person[city]!=city]">
<xsl:sort select="city"/>
</xsl:apply-templates>
</xsl:element>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Dan
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








