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

François Torche torche at i-minds.be
Fri Feb 25 06:24:32 PST 2005


Try to use 2 consecutive xsl:sort within xsl:apply-templates
	<xsl:sort select="author" />
	<xsl:sort select="editor" /> 

As far as I remember, it does work within xsl:for-each...

Regards,
François

-----Original Message-----
From: owner-xep-support at renderx.com [mailto:owner-xep-support at renderx.com] On Behalf Of Martin Holmes
Sent: vendredi 25 février 2005 14:41
To: xep-support at renderx.com
Subject: Re: [xep-support] xsl:sort in apply-templates

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 at renderx.com 
>[mailto:owner-xep-support at renderx.com]
>Namens Martin Holmes
>Verzonden: donderdag 24 februari 2005 21:19
>Aan: xep-support at 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 at uvic.ca martin at mholmes.com mholmes at 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 at 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 at 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 at 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 at 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



More information about the Xep-support mailing list