Merci pour ta réponse Bul, mais peut-tu être plus clair dans les solutions que tu propose s'il te plait?
voici mon code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="
[ Lien ]" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>Exemple XML + XSLT + JavaScript</title>
<script language="JScript"><![CDATA[
// Déclaration des variables
var XSLSource = new Object();
var XMLSource = new Object();
// Chargement des documents XML et XSL
XMLSource = document.XMLDocument;
XSLSource = document.XSLDocument;
function tri (rubrique) {
// Déclaration des variables
var XSLSort = new Object();
// Sélection de l'ordre xsl:sort
XSLSort =
XSLSource.documentElement.selectNodes("//xsl:sort");
// Affectation de la rubrique de tri
if (XSLSort[0].attributes(0).text == rubrique.toString()){
if ( XSLSort[0].attributes(1).text == "ascending") {
XSLSort[0].attributes(1).text = "descending";
} else {
XSLSort[0].attributes(1).text = "ascending";
}
} else {
XSLSort[0].attributes(1).text = "ascending";
}
XSLSort[0].attributes(0).text = rubrique.toString();
// affichage de l'ordre de tri
XSLem = XSLSource.documentElement.selectNodes("///p/em");
XSLem [0].text = rubrique.toString();
XSLem [1].text = XSLSort[0].attributes(1).text ;
XSimg = XSLSource.documentElement.selectNodes("//img src="");
// Réaffichage de la page
document.body.innerHTML =
XMLSource.transformNode(XSLSource);
}]]></script>
</head>
<!--***********.::DEBUT BODY::.************-->
<body>
<img src=".gif"/>
<p>
Tri sur <em>DB</em> par ordre <em>descending</em>.
<I> Cliquez sur un titre pour changer l'ordre de tri.</I>
</p>
<!-- Compteur de Lignes sur la colone 'DB'-->
<b>Nombre de Lignes : <xsl:value-of select="count(//DB)"/></b>
<!-- Création du tableau, réaction de la tete de tableau à la souris -->
<table border="1" cellspacing="0" ALIGN="center" BGCOLOR="#EEEEEE" BORDERCOLOR="#000000">
<tr>
<th bgcolor="white" id="HeaderColumnDB"
onclick="javascript:tri('DB');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>DB</th>
<th bgcolor="white" id="HeaderColumnReqid"
onclick="javascript:tri('Reqid');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>Reqid</th>
<th bgcolor="white" id="HeaderColumnDESCRIPTION"
onclick="javascript:tri('DESCRIPTION');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>DESCRIPTION</th>
<th bgcolor="white" id="HeaderColumnSubmitted_Date"
onclick="javascript:tri('Submitted_Date');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>Submitted_Date</th>
<th bgcolor="white" id="HeaderColumnStart_Date"
onclick="javascript:tri('Start_Date');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>Start_Date</th>
<th bgcolor="white" id="HeaderColumnEnd_Date"
onclick="javascript:tri('End_Date');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>End_Date</th>
<th bgcolor="white" id="HeaderColumnApplication"
onclick="javascript:tri('Application');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>Application</th>
<th bgcolor="white" id="HeaderColumnWait_Duration"
onclick="javascript:tri('Wait_Duration');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>Wait_Duration</th>
<th bgcolor="white" id="HeaderColumnPROGRAM"
onclick="javascript:tri('PROGRAM');" onMouseOver="bgColor='#FF9900', this.style.cursor='hand';" onMouseOut="bgColor='#FFFFFF';"
>PROGRAM</th>
</tr>
<xsl:apply-templates select="NewDataSet/Table"> <!-- select TABLE -->
<xsl:sort select="DB" order="descending"/>
</xsl:apply-templates>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="Table">
<tr>
<td>
<xsl:value-of select="DB"/>
</td>
<td>
<xsl:value-of select="Reqid"/>
</td>
<td>
<xsl:value-of select="DESCRIPTION"/>
</td>
<td>
<xsl:value-of select="Submitted_Date"/>
</td>
<td>
<xsl:value-of select="Start_Date"/>
</td>
<td>
<xsl:value-of select="End_Date"/>
</td>
<td>
<xsl:value-of select="Application"/>
</td>
<td>
<xsl:value-of select="Wait_Duration"/>
</td>
<td>
<xsl:value-of select="PROGRAM"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml:stylesheet type="text/xsl" href="tri.xsl"?>