Re: [xsl] Bib refs

Subject: Re: [xsl] Bib refs
From: Peter Flynn <peter@xxxxxxxxxxx>
Date: Sat, 24 Feb 2001 16:41:24 +2400
At Friday, 23 February 2001, David Carlisle wrote:

>Use BiTeX? Oh no, wrong list.

That's for those using both TeX *and* LaTeX, presumably (biTeXuals? :-)

>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"/>

Indeed. But unfortunately the user was told when she started not to
bother manually sorting the refs, the computer can do it -- which of
course it can :-)

>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.

Aha. Cunning plot, Baldric.

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

Thanks very much, I shall try it after I've had a G&T.


I'd get tested might be incubating procedurality :-)


 XSL-List info and archive:

Current Thread