]> granicus.if.org Git - docbook-dsssl/commitdiff
Support {table.}footnote.number.{format,symbols}
authorNorman Walsh <ndw@nwalsh.com>
Mon, 20 Jan 2003 15:29:20 +0000 (15:29 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 20 Jan 2003 15:29:20 +0000 (15:29 +0000)
xsl/fo/footnote.xsl
xsl/html/footnote.xsl

index 4f832983a14e668a3677e31bc0ece33239c27db1..dbb6c02ea8ab3b756c9153ea3a673d0573f6b792 100644 (file)
 <xsl:template match="footnote" mode="footnote.number">
   <xsl:choose>
     <xsl:when test="ancestor::tgroup">
-      <xsl:number level="any" from="tgroup" format="a"/>
+      <xsl:variable name="tfnum">
+        <xsl:number level="any" from="table|informaltable" format="1"/>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="string-length($table.footnote.number.symbols) &gt;= $tfnum">
+          <xsl:value-of select="substring($table.footnote.number.symbols, $tfnum, 1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number level="any" from="tgroup"
+                      format="{$table.footnote.number.format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
       <xsl:variable name="pfoot" select="preceding::footnote"/>
       <xsl:variable name="ptfoot" select="preceding::tgroup//footnote"/>
-      <xsl:number value="count($pfoot) - count($ptfoot) + 1" format="1"/>
+      <xsl:variable name="fnum" select="count($pfoot) - count($ptfoot) + 1"/>
+
+      <xsl:choose>
+        <xsl:when test="string-length($footnote.number.symbols) &gt;= $fnum">
+          <xsl:value-of select="substring($footnote.number.symbols, $fnum, 1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number value="$fnum" format="{$footnote.number.format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
index 7d51df8ef93182e1a19d204b48bd0363512d2b84..76fc54c429e6dcb60f1e348f39749f14d7961a40 100644 (file)
 <xsl:template match="footnote" mode="footnote.number">
   <xsl:choose>
     <xsl:when test="ancestor::tgroup">
-      <xsl:number level="any" from="table|informaltable" format="a"/>
-    </xsl:when>
-    <xsl:when test="ancestor::refentry">
-      <xsl:number level="any" from="refentry" format="1"/>
+      <xsl:variable name="tfnum">
+        <xsl:number level="any" from="table|informaltable" format="1"/>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="string-length($table.footnote.number.symbols) &gt;= $tfnum">
+          <xsl:value-of select="substring($table.footnote.number.symbols, $tfnum, 1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number level="any" from="tgroup"
+                      format="{$table.footnote.number.format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
       <xsl:variable name="pfoot" select="preceding::footnote"/>
-      <xsl:variable name="ptfoot" select="preceding::table//footnote
-                                          |preceding::informaltable//footnote"/>
-      <xsl:number value="count($pfoot) - count($ptfoot) + 1" format="1"/>
+      <xsl:variable name="ptfoot" select="preceding::tgroup//footnote"/>
+      <xsl:variable name="fnum" select="count($pfoot) - count($ptfoot) + 1"/>
+
+      <xsl:choose>
+        <xsl:when test="string-length($footnote.number.symbols) &gt;= $fnum">
+          <xsl:value-of select="substring($footnote.number.symbols, $fnum, 1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number value="$fnum" format="{$footnote.number.format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>