[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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)
automatic xslt template generation
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.