Re: [xsl] Order by with XSL

Subject: Re: [xsl] Order by with XSL
From: "Andrew Curry" <andrew.curry@xxxxxxxxxxxx>
Date: Mon, 29 Mar 2004 10:39:28 +0100
<xsl:for-each.....>
<xsl:sort data-type="text" select="./ammlegal" order="ascending"/>
</xsl:for-each>

Im not too sure if thats too symplistic for your query though.
But for a given set of data that will sort alphabetically ascending.
If you want a specific order you can create a sort.xml file like :

And do something like

<?xml version="1.0"?>
<sort>
 <x order="1">BBBBBBr</x>
 <x order="2">AAAAAr</x>
 <x order="3">CCCCC</x>
</sort>

 <xsl:sort data-type="number"
select="document('sort.xml')/sort/x[.=current()/./ammegal]/@order"
order="ascending"/>

----- Original Message -----
From: "Gianni Ferrari" <gferrari@xxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, March 29, 2004 10:29 AM
Subject: [xsl] Order by with XSL


> Hi, thank you for the reply, i have a similar XML, and i would like to
order
> for ammlegal. In the stylesheet, with FO, i make a table, with three
> columns. Every row is a factory, and then with company address, ammlegal
and
> resarea. How i can order my table with ammlegal?
> Thank you...
> I hope you can help me...
> Regards
>         Gianni
> ------
> <elenco>
> <title>Gerarchia GPI e HIT</title>
> <ditta company_name="sssss" Address="xxxxxx" Phone="1111111" City="eeeee">
> <ammlegal>FFFFFFF</ammlegal>
> <resarea>AAAAAAAA</resarea>
>
> </ditta>
> <ditta company_name="jjkhkj" Address="jkj" Phone="3329438" City="uihjh">
> <ammlegal>BBBBBBB</ammlegal>
> <resarea>RRRRRRRRR</resarea>
>
> </ditta>
> </ditta>

Current Thread