This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: "Simple" matrix transformation
- To: xsl-list at mulberrytech dot com
- Subject: Re: "Simple" matrix transformation
- From: Paul Tchistopolskii <paul at qub dot com>
- Date: Sun, 16 Jul 2000 15:07:30 -0700
- Organization: The Qub Group
- References: <200007131535.LAA16428@mulberrytech.com><005c01bfec8e$c25c4000$f4c1fea9@eric>
- Reply-To: xsl-list at mulberrytech dot com
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/doc/group">
<HTML><BODY>
<xsl:variable name="salesp" select="*"/>
<TABLE width='100%'>
<TR>
<TH> corner </TH>
<xsl:for-each select="$salesp"> <xsl:sort/>
<TH>
<xsl:value-of select="@salesperson"/>
</TH>
</xsl:for-each>
</TR>
<!-- XSL cookbook required. See page 275 of Michael's book -->
<xsl:for-each
select="group/item[ not (./@date = preceding::item/@date) ]">
<xsl:sort/>
<xsl:variable name="date" select="@date"/>
<TR>
<TD align='center'> <xsl:value-of select="$date"/> </TD>
<xsl:for-each select="$salesp"> <xsl:sort/>
<xsl:variable name="sales" select="@salesperson"/>
<TD align='center'>
<xsl:value-of
select="/doc/group/group/item
@date = $date and
../@salesperson = $sales
]"
/>
</TD>
</xsl:for-each>
</TR>
</xsl:for-each>
</TABLE>
</BODY></HTML>
</xsl:template>
</xsl:stylesheet>
---- result:
<HTML>
<BODY>
<TABLE width="100%">
<TR>
<TH> corner </TH><TH>alex</TH><TH>lynn</TH><TH>terry</TH>
</TR>
<TR>
<TD align="center">1999-07-15</TD><TD align="center">1200</TD><TD
align="center">1500</TD><TD align="center">2000</TD>
</TR>
<TR>
<TD align="center">2000-07-15</TD><TD align="center">1000</TD><TD
align="center">2000</TD><TD align="center">3000</TD>
</TR>
</TABLE>
</BODY>
</HTML>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list