I am using this algo
http://www.jenitennison.com/xslt/grouping/muenchian.html for grouping . I am able to use that algo .but I am facing one issue .I have one xml
in which i apply grouping on Over
.I am able to show my data .but sometime @over become blank
..I don't want to show that data ..
here is my code
http://xsltransform.net/pNmBxZY/1
transformation
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />
<xsl:key name="node-by-over" match="Node" use="@Over" />
<xsl:template match="/Innings">
<hmtl>
<head>
<title>New Version!</title>
</head>
<xsl:apply-templates select="Node[generate-id() = generate-id(key('node-by-over', @Over)[1])]"/>
</hmtl>
</xsl:template>
<xsl:template match="Node">
over::: <h1><xsl:value-of select="@Over"/></h1>
<table id="{Over}">
<xsl:for-each select="key('node-by-over', @Over)">
<tr>
<td>balls:::<xsl:value-of select="@Ball"/></td>
<td>runs:::<xsl:value-of select="Runs"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:transform>
current result
<!DOCTYPE html
PUBLIC "XSLT-compat">
<hmtl>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>New Version!</title>
</head>
over:::
<h1>1</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::1</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::6</td>
<td>runs:::2</td>
</tr>
</table>
over:::
<h1></h1>
<table id="">
<tr>
<td>balls:::</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::</td>
<td>runs:::0</td>
</tr>
</table>
over:::
<h1>2</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::2</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::6</td>
<td>runs:::1</td>
</tr>
</table>
over:::
<h1>3</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::1</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::1</td>
</tr>
</table>
</hmtl>
Expected output
<!DOCTYPE html
PUBLIC "XSLT-compat">
<hmtl>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>New Version!</title>
</head>
over:::
<h1>1</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::1</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::6</td>
<td>runs:::2</td>
</tr>
</table>
over:::
<h1>2</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::2</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::6</td>
<td>runs:::1</td>
</tr>
</table>
over:::
<h1>3</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::1</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::1</td>
</tr>
</table>
</hmtl>
Difference between current and expected output
over:::
<h1></h1>
<table id="">
<tr>
<td>balls:::</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::</td>
<td>runs:::0</td>
</tr>
</table>
I don't want traverse that Node
which have blank
@Over ..See example in xml
<Node Id="14" Over=""
I don't want to traverse id="14" because it don't have over value .but current code is doing that why it show above html part ? how to apply check ?
currently last node display like that
over:::
<h1>3</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::1</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::1</td>
</tr>
</table>
Can we show like that
over:::
<h1>2.5</h1>
<table id="">
<tr>
<td>balls:::1</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::2</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::3</td>
<td>runs:::1</td>
</tr>
<tr>
<td>balls:::4</td>
<td>runs:::0</td>
</tr>
<tr>
<td>balls:::5</td>
<td>runs:::1</td>
</tr>
</table>
@over.@ball (Last node)