[XSL SORT] utilisation d'un paramètre / clé de tri

"RACHOVITCH Yoni" <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <[email protected]>
Bonjour,
je récupère un paramètre au début de mon styleshhet afin de l'utiliser pour trier mes données dans un xsl:sort.
Le problème vient que le tri ne fonctionne pas quand c'est le paramètre qui est déclaré dans le select, or cela marche quand j'écris "en dur" la clé de tri.
si vous avez des idées
en vous remerciant
Cordialement

Yoni Rachovitch

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
   <xsl:output method="html" indent="yes"/> 
    

	<xsl:param name="order"/> 
   	<xsl:param name="incode"/> 
	<xsl:param name="field"/>  <= affectation de la valeur "sub2xml/tech" dans un script à part...             xslProc.addParameter("field",  "sub2xml/tech" ); 
    
<xsl:template match="/"> 
	<xsl:apply-templates select="dml">
	</xsl:apply-templates>
	</xsl:template> 
	
<xsl:template match="xml"> 

<table> 
	<xsl:variable name="neworder"> 
	<xsl:if test="$order='ascending'">descending</xsl:if> 
	<xsl:if test="$order='descending'">ascending</xsl:if> 
	</xsl:variable> 

	<tr>
		<th><a href="javascript:tri(sub2xml/tech','{$neworder}')">tech</a></th>
		<th><a href="javascript:tri(sub2xml/tech2,'{$neworder}')">tech</a></th>
	</tr> 

	<xsl:apply-templates select="subxml/add">
		<xsl:sort select="sub2xml/tech" order="{$order}"/>   <== CA MARCHE
		<!--
				<xsl:sort select="*[name()=$field]" order="{$order}"/> <== CA NE MARCHE PAS
		-->
	</xsl:apply-templates>
	
</table> 

</xsl:template> 
.
.
.
.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.