Created
November 5, 2019 09:46
-
-
Save SebDeclercq/23b063cdbb192db75b882ec14420fd37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<table> | |
<thead> | |
<td>A</td> | |
<td>B</td> | |
<td>C</td> | |
</thead> | |
<tbody> | |
<tr> | |
<td>3</td> | |
<td>3</td> | |
<td>3</td> | |
<td>3</td> | |
</tr> | |
<tr> | |
<td>4</td> | |
<td>-1</td> | |
<td>2</td> | |
</tr> | |
</tbody> | |
</table> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> | |
<!-- **Tous elements et attributs *********************************** --> | |
<xsl:template match="*"> | |
<xsl:element name="{name()}"> | |
<xsl:apply-templates select="@*"/> | |
<xsl:apply-templates/> | |
</xsl:element> | |
</xsl:template> | |
<xsl:template match="attribute::*"> | |
<xsl:attribute name="{name()}"> | |
<xsl:value-of select="."/> | |
</xsl:attribute> | |
</xsl:template> | |
<xsl:template match="//thead"> | |
<tr><xsl:copy-of select="*"/> | |
<th>Total</th></tr> | |
</xsl:template> | |
<xsl:template name="iter-tbody" match="//tbody"> | |
<xsl:for-each select="tr"> | |
<xsl:copy> | |
<xsl:apply-templates select="*"/> | |
<td><xsl:value-of select="sum(td)"/></td> | |
</xsl:copy> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment