OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: Better FO footnote symbols


Oops, I screwed up my 1-based indexing math.. here's a correctly
substring-ing version:
<xsl:template match="footnote" mode="footnote.number">
  <xsl:choose>
    <xsl:when test="string-length(@label) != 0">
      <xsl:value-of select="@label"/>
    </xsl:when>
    <xsl:when test="ancestor::table or ancestor::informaltable">
      <xsl:variable name="tfnum">
        <xsl:number level="any" from="table|informaltable" format="1"/>
      </xsl:variable>
      <xsl:variable name="tfsymnum"
select="string-length($table.footnote.number.symbols)"/>
      <xsl:call-template name="dup">
        <xsl:with-param name="input"
select="substring($table.footnote.number.symbols, (($tfnum + 5) mod
$tfsymnum) + 1, 1)"/>
        <xsl:with-param name="count" select="ceiling($tfnum div $tfsymnum)"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="fnum">
        <!-- FIXME: list in @from is probably not complete -->
        <xsl:number level="any"

from="chapter|appendix|preface|article|refentry|bibliography"
                    count="footnote[not(@label)][not(ancestor::table)
and not(ancestor::informaltable)]|ulink[node()][@url !=
.][not(ancestor::
                    format="1"/>
                <!-- was
                    count="footnote[not(@label)][not(ancestor::table)
and not(ancestor::informaltable)]|ulink[$ulink.footnotes !=
0][node()][@u
                    -->
      </xsl:variable>
      <xsl:variable name="symnum"
select="string-length($footnote.number.symbols)"/>
      <xsl:message>
     FNum: <xsl:value-of select="$fnum"/>
     Symnum <xsl:value-of select="$symnum"/>
     Sub: <xsl:value-of select="$fnum mod $symnum"/>
     Mark: <xsl:call-template name="dup">
        <xsl:with-param name="input"
select="substring($footnote.number.symbols, (($fnum + 5) mod $symnum)
+ 1, 1)"/>
        <xsl:with-param name="count" select="ceiling($fnum div $symnum)"/>
      </xsl:call-template>
      </xsl:message>
      <xsl:call-template name="dup">
        <xsl:with-param name="input"
select="substring($footnote.number.symbols, $fnum mod $symnum, 1)"/>
        <xsl:with-param name="count" select="ceiling($fnum div $symnum)"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Any suggestions on a better way to do the math better than the ridiculous:
 substring($footnote.number.symbols, (($fnum + 5) mod $symnum) + 1, 1)
?

Thanks,
Keith


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]