Hi, how to a get a total numerical value of attributes from siblings? I need to get the total value of all the colspec/@colwidth that are a child of tgroup. Here is some code.
xml sample
Code:
<tgroup cols="2" colsep="1" rowsep="1">
<colspec colnum="1" colname="col1" colwidth="12pi" colsep="1" rowsep="1"/>
<colspec colnum="2" colname="col2" colwidth="12pi" colsep="1" rowsep="1"/>
<thead>
......
XSLT Template
Code:
<xsl:template match="colspec">
<xsl:variable name="total">
<xsl:choose>
<xsl:when test="contains(../colspec/@colwidth, 'pi')">
<xsl:value-of select="sum(number(substring-before(../colspec/@colwidth, 'pi')))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number(0)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--to do-->
</xsl:template>
Thanks for the help