1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:key name="id" match="Categorie" use="."/>
<xsl:template match="/">
<html>
<head>
<title>Liste produit disponible</title>
<script language="JavaScript">
<![CDATA[function Insertion()
{
//code pour IE
if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("D:\Documents and Settings\cDucarouge\Mes documents\Etude technique Extranet\ETL\Web Service\Proto Dom_JS\fichier_xml2.xml");
XmlNodeList elemList = xmlDocument .GetElementsByTagName("Reference");
for (int i=0; i < elemList.Count; i++)
{
elemList[i].GetElementsByTag("AA000") = "BB089";
}
alert('Ici, c\'est vIE!\nSympa non ?');
}
//Code pour FireFox
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc= document.implementation.createDocument("","",null);
xmlDoc.load("D:\Documents and Settings\cDucarouge\Mes documents\Etude technique Extranet\ETL\Web Service\Proto Dom_JS\fichier_xml2.xml");
alert('Ici, c\'est votre message!\nSympa non ?');
}
else
{
alert('Votre browser en vous permet pas l\'utilisation de cet outil');
}
}
]]>
</script>
</head>
<body>
<h1> Question 2 </h1>
<xsl:apply-templates select="//Liste_des_Produits"/>
</body>
</html>
</xsl:template>
<xsl:template match="//Liste_des_Produits">
<xsl:param name="choix"> 1 </xsl:param>
<xsl:choose>
<xsl:when test="$choix=1">
<table>
<caption> Liste produit - 2 </caption>
<tr><th>Nom Produit</th> <th> Référence</th> <th> Catégorie </th></tr>
<xsl:for-each select="/Liste_des_Produits/Produit">
<xsl:sort select="Nom_Produit"/>
<tr>
<td class="nom"> <xsl:value-of select = "Nom_Produit"/> </td>
<td class="niv"><xsl:value-of select ="Reference"/></td>
<td class="emp"><xsl:value-of select ="Categorie"/> </td>
</tr>
</xsl:for-each>
</table>
<form method="post">
<TR>
<TD>
<INPUT type="submit" value="Ajouter" onclick="Insertion()"/>
</TD>
</TR>
</form>
</xsl:when>
<xsl:otherwise>
<table>
<caption> Liste produit - 1 </caption>
<tr><th>Nom Produit</th> <th> Niveau danger</th> <th> Emplacement </th></tr>
<xsl:for-each select="/Liste_des_Produits/Produit">
<xsl:sort select="Niveau_Danger"/>
<tr>
<td class="nom"> <xsl:value-of select = "Nom_Produit"/> </td>
<td class="niv"><xsl:value-of select ="Niveau_Danger"/></td>
<td class="emp"><xsl:value-of select ="Stockage/Emplacement"/> </td>
</tr>
</xsl:for-each>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> |
Partager