Re: [xsl] Bib refs

Subject: Re: [xsl] Bib refs
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 23 Feb 2001 15:36:15 GMT

> Given some para text containing an IDREF reference to something in the 
> bibliography of the document, eg <cit doc="someid">something</cit> ,
> and some biblio references at the end to be sorted, each with an 
> ID attribute, 
> how can I replicate in the <ref> template the value which HTML will 
> generate 
> for the <li> that I am placing round each bib reference after sorting 
> at the endof the doc?

Use BiTeX? Oh no, wrong list.

If it weren't for the sorting (ie if your references were ordered in
your source, you could go)

<xs:apply-templates select="id(@doc)" mode="number"/>

then you could share your templates in mode "number" between the code
that typesets the reference list and the code that typesets the
individual citations.

Howver you do want to sort, so its probably easiest to have a variable
with the sorted list then use a node-set extension to query into that.

so top level
<xsl:variable name="sorted-refs">
  <xsl:for-each select="//refs/*">
    <xsl:sort select="author/name"/>
    <ref number="{position()}">
    <xsl:copy-of select="."/>

Then something like 
 <xsl:variable name="x" select="@doc"/>
 <xsl:for-each select="$sorted-refs">
   <xsl:value-of select="id($x)/../@number"/>


This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit

 XSL-List info and archive:

Current Thread