RE: automatic generation of figure numbers

Subject: RE: automatic generation of figure numbers
From: "Sebastian Rahtz" <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Oct 2000 20:24:57 +0100 (BST)
Dhruv Raheja writes:
 > The first 3 instances have unique/different "file" values, which means that 
 > they point to different image files. However the 4th instance has the same 
 > value for the  "file" attribute as the 1st instance. This measn that 
 > somewhere in the document I feel the need to refer to "Figure 1" again , 
 > i.e. I may have multiple occurences of "Figure 1" in the document. 

I am afraid my reaction is "I would not start from here". I would
assign a unique ID to each real <figure>, and if I wanted to refer
again to Figure 1, I'd use a new element <figureref id="whatever"/>,
which matched <figure id="whatever">. Then

 <xsl:template match="figureref">
  <a href="{id(@idref)/@file}">
    Figure <xsl:apply-templates select="id(idref)" mode="xref"/>
  </a>
 </xsl:template>

 <xsl:template match="figure" mode="xref">
   <xsl:number level="any">
 </xsl:template>

use the power of XSLT & XPATH.....

Sebastian


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread