🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #9950

Re: Transformation dynamique d'un XSL ne se fait qu'une fois

#9950
From: Alain Ketterlin
Date: Wed, 31 Jan 2001 16:12
59 lines
2604 bytes
"Gilles Colombari" <gcolombari@net-up.com> writes:

>     j'ai r�ussi � faire un xsl avec un script qui permet de trier
> dynamiquement un tableau selon la colonne sur laquelle l'on a cliqu�, mais
> cela ne marche qu'une fois :-(((

J'en sais rien, mais voila une version XSLT : le fichier (appele
dynsort.xml, j'utilise le nom dans la feuille)

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="dynsort.xsl" type="text/xsl"?>
<tab>
  <l><x>a</x><y>b</y><z>b</z></l>
  <l><x>b</x><y>c</y><z>a</z></l>
  <l><x>c</x><y>a</y><z>b</z></l>
</tab>

et la feuille de style : 

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

  <xsl:param name="skey" select="'x'"/>

  <xsl:template match="/">
    <html>
      <head>
        <title>Essai</title>
      </head>
      <body>
        <table>
          <tr>
            <th><a href="dynsort.xml?skey=x">X</a></th>
            <th><a href="dynsort.xml?skey=y">Y</a></th>
            <th><a href="dynsort.xml?skey=z">Z</a></th>
          </tr>
          <xsl:apply-templates select="tab/l">
            <xsl:sort select="*[name()=$skey]"/>
          </xsl:apply-templates>
        </table>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="l">
    <tr>
      <td><xsl:value-of select="x"/></td>
      <td><xsl:value-of select="y"/></td>
      <td><xsl:value-of select="z"/></td>
      <td><xsl:value-of select="position()"/></td>
    </tr>
  </xsl:template>

</xsl:stylesheet>

Ca a l'air de marcher chez moi, avec Cocoon, donc Xalan.

-- Alain.
Technical Details
Message-ID: <wyy9vrbt0u.fsf@polya.u-strasbg.fr>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!ciril.fr!news.u-strasbg.fr!not-for-mail
References: <0zWd6.1988$oo5.4846643@nnrp4.proxad.net>

Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII
X-Google-Thread: 114f60,1be3c6b8043cbb42
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-01-31 08:13:12 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!ciril.fr!news.u-strasbg.fr!not-for-mail
From: Alain Ketterlin <alain@dpt-info.u-strasbg.fr>
Newsgroups: fr.comp.text.xml
Subject: Re: Transformation dynamique d'un XSL ne se fait qu'une fois
Date: 31 Jan 2001 17:12:01 +0100
Organization: CRC - Universite Louis Pasteur Strasbourg France
Lines: 59
Message-ID: <wyy9vrbt0u.fsf@polya.u-strasbg.fr>
References: <0zWd6.1988$oo5.4846643@nnrp4.proxad.net>
NNTP-Posting-Host: polya.u-strasbg.fr
X-Trace: news.u-strasbg.fr 980961918 15995 130.79.6.19 (31 Jan 2001 17:25:18 GMT)
X-Complaints-To: usenet@u-strasbg.fr
NNTP-Posting-Date: 31 Jan 2001 17:25:18 GMT
X-Newsreader: Gnus v5.6.45/XEmacs 21.1 - "Capitol Reef"