[xsl] xrefs (count,preceding,keys,node-set)

Subject: [xsl] xrefs (count,preceding,keys,node-set)
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Mon, 15 Apr 2002 16:58:58 +0100
Hi all,

With xml data like this:

<xref id="link1"/>
.......
<figure id="link1"/>

I need to tie the two together based on the @id.  The xref needs to take the
number given to its corresponding figure based on its position within all
the figure's [ie. count(preceding::figure|.)]

How do find I the correct number when I am processing the xref element?

This kind of linking has to be done several times in each file and really
could do with being as fast as possible - is there a better way of doing
this using keys, or by building a name-value node-set and using the node-set
extention?


example data

<root>
  <xref id="foo"/>
  <xref id="bar"/>
  <figure id="foo"/>
  <figure id="bar"/>
</root>

example required output

<a href="#fig1">Fig 1</a>
<a href="#fig2">Fig 2</a>
<a name="fig1">Figure 1</a>
<a name="fig2">Figure 2</a>


cheers
andrew

************************************************************************
*<a href="http://www.thebristoldirectory.com"; >The Bristol Directory</a>*
************************************************************************

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/2002



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


Current Thread