From: cyberatlas@videotron.ca
Date: 11/10/2003 - 19:20
Bonjour,
J'aimerais savoir comment capter la valeur d'un paramètre à partir d'un xsl.
Je m'explique:
J'appelle un fichier xml avec un paramètre de la façon suivante:
produits.xml?prod=DEF
Comment capter la valeur du paramètre prod ? C'est parfaitement faisable en
javascript, mais comment le passer au xsl.
Soit le fichier xml suivant:
<?xml-stylesheet type="text/xsl" href="produits.xsl"?>
<Produits>
<produit id="ABC">
<nom>nom 1</FROM>
</produit>
<produit id="DEF"> ??? noed que je veux afficher
<nom>nom 2</FROM>
</produit>
<produit id="GHI">
<nom>nom 3</FROM>
</produit>
</Produits>
Voici son xsl:
<xsl:template match="Produits">
<html>
<head>
<title>Produit demandé</title>
</head>
<body>
<table border="1">
<th>Nom</th>
<xsl:apply-templates select="produit/@id[.=$valeur-de-prod]"/>
???? Comment capter le paramètre ?
</table>
</body>
</html>
</xsl:template>
<xsl:template match="produit/@id">
<tr>
<td>
<xsl:value-of select="nom"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Merci de vos réponse
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|