[xsl] Determine number of columns in a row for a marker

Subject: [xsl] Determine number of columns in a row for a marker
From: KAATMAN Matthew <matthew.kaatman@xxxxxxxxxxxxxx>
Date: Fri, 18 Oct 2013 20:56:08 +0200
I'm working within the context of DITA and anytime a table breaks across a
page, I want to set a marker that will be retrieved in the table-head and
display the table title along with (Continued).
It's mostly working but I'm having difficulty setting fo:table-cell
number-columns-spanned.

Setting the marker within:
<xsl:template match="*[contains(@class, ' topic/row ')]" > ...
            <xsl:choose>
                <xsl:when test="count(preceding-sibling::*[contains(@class, '
topic/row ')]) = 1">
                   <fo:marker marker-class-name="continued"/>
                </xsl:when>
                <xsl:otherwise>
                    <fo:marker marker-class-name="continued">
                        <fo:table-row
xsl:use-attribute-sets="table__continued__text">
                            <fo:table-cell number-columns-spanned="{???NEED TO
FIGURE OUT HOW TO COUNT THE NUMBER OF COLUMNS}???">
                                <fo:block
padding-bottom="5pt"><xsl:apply-templates
select="ancestor-or-self::*[contains(@class,' topic/table
')]/*[contains(@class,' topic/title ')]"><xsl:with-param
name="fromContinued">true</xsl:with-param></xsl:apply-templates></fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:marker>
                </xsl:otherwise>
            </xsl:choose>

Then later the marker is retreived:
<xsl:template match="*[contains(@class, ' topic/thead ')]">
        <fo:table-header xsl:use-attribute-sets="tgroup.thead" id="{@id}">
                    <fo:retrieve-table-marker retrieve-class-name="continued"
                        retrieve-position-within-table="first-starting-within
-page"/>

Without success I've tried:
{count(preceding-sibling::*[contains(@class, ' topic/row ')])}

Any guidance would be appreciated.
Thanks!
Matt
AVIS : Ce courrier et ses pieces jointes sont destines a leur seul
destinataire et peuvent contenir des informations confidentielles appartenant
a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute
lecture, divulgation, ou reproduction de ce message et des pieces jointes est
strictement interdite. Si vous avez recu ce message par erreur merci d'en
prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes.
NOTICE: This message and attachments are intended only for the use of their
addressee and may contain confidential information belonging to bioMerieux. If
you are not the intended recipient, you are hereby notified that any reading,
dissemination, distribution, or copying of this message, or any attachment, is
strictly prohibited. If you have received this message in error, please notify
the original sender immediately and delete this message, along with any
attachments.

Current Thread