Re: [xep-support] xsl:sort in apply-templates

From: Martin Holmes <mholmes@uvic.ca>
Date: Fri Feb 25 2005 - 05:40:42 PST

HI there,

For various (complicated) reasons, I wanted to use <xsl:sort> within
<xsl:apply-templates>, rather than inside an <xsl:for-each> But my main
problem is that it seems to be sorting all the authors first, then all
the editors; is there a way to have it combine the two keys (so that if
there's an editor, it'll use that; otherwise, it'll use the first author)?

Cheers,
Martin

Henk Rutten wrote:

>Hi Martin,
>
>Try following:
>
><xsl:template match="listBibl">
> <fo:block>
> <xsl:for-each select="biblStruct">
> <xsl:sort select="author|editor" />
> <xsl:value-of select="."/>
> </xsl:for-each>
> </fo:block>
></xsl:template>
>
>
>Met vriendelijke groet,
>
>Henk Rutten
>GrafiData Deventer
>
>------------------------------------------------
>Dit e-mailbericht is slechts bestemd voor de personen of organisatie aan wie
>het is gericht. Het bericht kan informatie bevatten die persoonlijk en
>vertrouwelijk is. Tevens kan het informatie bevatten die niet
>publiekstoegankelijk van aard is. GrafiData Media & Informatie Technologie
>aanvaardt geen aansprakelijkheid indien de inhoud van dit bericht en
>eventuele bijlagen in strijd is met de Wet of de goede zeden. Voor het geval
>de ontvanger van dit bericht niet de bedoelde persoon of organisatie is,
>wordt hierbij vermeld dat verdere verspreiding, openbaarmaking of
>vermenigvuldiging van dit bericht strikt verboden is en verzoeken wij u de
>inhoud niet te gebruiken en de afzender direct te informeren. Dank voor uw
>medewerking.
>
>
>-----Oorspronkelijk bericht-----
>Van: owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com]
>Namens Martin Holmes
>Verzonden: donderdag 24 februari 2005 21:19
>Aan: xep-support@renderx.com
>Onderwerp: [xep-support] xsl:sort in apply-templates
>
>Hi there,
>
>I'm processing a list of bibliography elements, like this:
>
><listBibl>
> <biblStruct>...</biblStruct>
> <biblStruct>...</biblStruct>
> <biblStruct>...</biblStruct>
></listBibl>
>
>I want to sort them by author or editor, but it doesn't seem to be working:
>
><xsl:template match="listBibl">
> <fo:list-block provisional-distance-between-starts="0"
>provisional-label-separation="0" space-before="0.25cm" space-after="0.25cm">
> <xsl:apply-templates>
> <xsl:sort select="//author[1] | //editor[1]" />
> </xsl:apply-templates>
> </fo:list-block>
></xsl:template>
>
>Every variation I try of the select attribute has no effect at all; the
>elements are all processed in the order of the document. Can anyone see what
>I'm doing wrong here?
>
>Cheers,
>Martin
>
>______________________________________
>Martin Holmes
>University of Victoria Humanities Computing and Media Centre mholmes@uvic.ca
>martin@mholmes.com mholmes@halfbakedsoftware.com http://www.mholmes.com
>http://web.uvic.ca/hcmc/ http://www.halfbakedsoftware.com
>
>-------------------
>(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
>in the body of the message to majordomo@renderx.com from the address you are
>subscribed from.
>(*) By using the Service, you expressly agree to these Terms of Service
>http://www.renderx.com/tos.html
>
>-------------------
>(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
>in the body of the message to majordomo@renderx.com from the address
>you are subscribed from.
>(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
>
>

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
Received on Fri Feb 25 05:59:55 2005

This archive was generated by hypermail 2.1.8 : Fri Feb 25 2005 - 05:59:56 PST