|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Conditionally showing a record
> I want to only show the Records when the element Line is evenly
> divisiable by 10.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="html" indent="yes"/>
<xsl:template match="Example">
<table>
<xsl:for-each select="Record/Order[Line mod 10 = 0]">
<tr>
<td><xsl:value-of select="Line"/></td>
<td><xsl:value-of select="Item"/></td>
<td><xsl:value-of select="Price"/></td>
</tr>
</xsl:for-each>
<tr>
<td>Total</td>
<td/>
<td><xsl:value-of select="sum(Record/Order[Line mod 10 = 0]/Price)"/></td>
</tr>
<tr>
<td>Other Total</td>
<td/>
<td><xsl:value-of select="sum(Record/Order[Line mod 10 != 0]/Price)"/></td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
<table>
<tr>
<td>10</td><td>100</td><td>10.00</td>
</tr>
<tr>
<td>20</td><td>300</td><td>30.00</td>
</tr>
<tr>
<td>Total</td><td></td><td>40</td>
</tr>
<tr>
<td>Other Total</td><td></td><td>60</td>
</tr>
</table>
David
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








