This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: automatic generation of figure numbers
- To: xsl-list at mulberrytech dot com
- Subject: RE: automatic generation of figure numbers
- From: "Sebastian Rahtz" <sebastian dot rahtz at computing-services dot oxford dot ac dot uk>
- Date: Wed, 4 Oct 2000 20:24:57 +0100 (BST)
- Cc: kcline at grci dot com
- References: <F223o2pzY4wXwOOt7vS00002dd6@hotmail.com>
- Reply-To: xsl-list at mulberrytech dot com
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