|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to calculate rowspan?
Hi!
How can i calculate identical nodes with attribute Type="Dimesion"? I wish
to set rowspan and ignore all of unnecessery following nodes with the same
content.
Please, help me.
I wish to get this table in HTML:
-----------------
| | | |
- ---------
| | | |
-------------
| | | |
-----------------
| | | |
-------------
| | | |
-----------------
| | | |
-----------------
My XML:
<QPivotTable>
<ROW>
<COL0 Type="Dimesion">A</COL0>
<COL1 Type="Dimesion">E</COL1>
<COL2>1</COL2>
<COL3>2</COL3>
</ROW>
<ROW>
<COL0 Type="Dimesion">A</COL0>
<COL1 Type="Dimesion">E</COL1>
<COL2>1</COL2>
<COL3>2</COL3>
</ROW>
<ROW>
<COL0 Type="Dimesion">A</COL0>
<COL1 Type="Dimesion">Gesamt</COL1>
<COL2>1</COL2>
<COL3>2</COL3>
</ROW>
<ROW>
<COL0 Type="Dimesion">B</COL0>
<COL1 Type="Dimesion">8040 Haus- u. Stra_ensamml.</COL1>
<COL2>1</COL2>
<COL3>2</COL3>
</ROW>
<ROW>
<COL0 Type="Dimesion">B</COL0>
<COL1 Type="Dimesion">8055 Sen.Gymn.</COL1>
<COL2>1</COL2>
<COL3>2</COL3>
</ROW>
<ROW>
<COL0 Type="Dimesion">C</COL0>
<COL1 Type="Dimesion">test</COL1>
<COL2>1</COL2>
<COL3>2</COL3>
</ROW>
</QPivotTable>
My XSL:
<!-- count Dimesion -->
<xsl:variable name="dim_count" select="count(
//ROW[not(descendant::node()[1][@Type='Label'])]
[1]/node()[@Type='Dimesion'] )" />
<!-- select data rows -->
<xsl:template match="//ROW[not(descendant::node()[1][@Type='Label'])]" >
<tr>
<xsl:for-each select="*">
<xsl:variable name="pos" select="position()" />
<xsl:choose>
<xsl:when test=" @Type='Dimesion' ">
<!-- HOW TO SET ROWSPAN AND IGNORE FOLLOWING
IDENTICAL NODES? -->
<xsl:value-of select="$pos" />
<xsl:if test="not(.=following::*/*[$pos])" >
<td>
<xsl:value-of select="." />
</td>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<!-- igore the firs x values -->
<xsl:if test="position() > $dim_count" >
<td>
<xsl:value-of select="." />
</td>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>
</xsl:template>
Best Regards
A. Metz
|
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








