Q:

XSLT Iterations over

I am getting an error that says that my template total-seconds-calculation does not exist. Am I doing something wrong with the for-each loop that is throwing the error at me?
My current code is:
<xsl:template match="Total-Seconds-Calculation">

    <xsl:for-each select="//SEGMENTS[TX_PART = '1']">
        <xsl:value-of select="DUR"/> 
        <xsl:variable name="Hours" select="substring($DUR,1,2)" />
        <xsl:variable name="Minutes" select="substring($DUR,4,2)" />
        <xsl:variable name="Seconds" select="substring($DUR,7,2)" />
        <xsl:variable name="TotalSeconds" select="(($Hours*3600)+($Minutes*60)+($Seconds))" />
    </xsl:for-each>
</xsl:template>

<xsl:variable name="TotalDurationShow"><xsl:call-template name="Total-Seconds-Calculation"></xsl:call-template></xsl:variable>

What I am trying to do is parse this time code and add up the total seconds of DUR. Here is the portion of the XML that I am using:
<SEGEMENTS>
    <DUR>00:12:33:21</DUR>
    <TX_PART>1</TX_PART>
</SEGEMENTS>
<SEGEMENTS>>
    <DUR>00:08:26:16</DUR>
    <TX_PART>1</TX_PART>
</SEGEMENTS>

A:

If you want to call the template by name, you have to name it.
<xsl:template name="Total-Seconds-Calculation">

You can have both a name attribute and a match attribute if you want, although I've never found a good use for that.

