Transformation XSLT for-each
Bonjour à tous !
Alors j'ai ce fichier XML avec le nom du scenario et plusieurs erreurs qui s'enchainent :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| <?xml version="1.0" encoding="utf-8"?>
<LogTest>
<Scenario>
<Name>2009-06-22_15-26-22__SQLSERVEUR_Portail</Name>
<Error>Warning : Error screenshot - 22/06/2009 15:24:40</Error>
<Error>...</Error>
...
</Scenario>
<Scenario>
....
</Scenario>
</LogTest> |
J'aimerais effectuer une transformation XSLT afin d'avoir un rendu HTML. Pour l'instant, j'arrive à afficher ça, donc c'est à dire, le nom avec seulement la première erreur, or je veux avoir toutes les erreurs sous les noms associés :
Code:
1 2 3 4
| 2009-06-22_15-26-22__SQLSERVEUR_Portail
* Warning : Error screenshot - 22/06/2009 15:24:40
2009-05-29_15-56-28__ORACLE_Portail
* Warning : Error screenshot - 29/05/2009 15:55:13 |
Mon fichier XSLT, il manque surement un for-each ou quelque chose comme ça pour les <li> mais je ne trouve pas la solution, pouvez vous m'aider ? :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <xsl:template match="/">
<html>
<head>
<title>Errors in the tests</title>
</head>
<body>
<h2 align="center">Errors from different logs</h2>
<xsl:for-each select="LogTest/Scenario">
<p>
<xsl:value-of select="Name"/>
</p>
<ul>
<li>
<xsl:value-of select="Error"/>
</li>
</ul>
</xsl:for-each>
<p></p>
</body>
</html>
</xsl:template> |
Merci d'avance !