Bonjour,
Comment faire un test de présence de cette ligne : car si j'enregistre plusieurs fois le fichier je l'ai plusieurs fois aussi.
1 2 3 4
| ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",
"type='text/xsl' href='StyleSheet.xslt'");
document.addContent(0,pi); |
Sinon j'ai un problème en xslt je pense que c'est au niveau du when :
Voici une ligne xml
<Analog_Input_1411 name="Analog_Input_1411 from Device_525" expected="10" test="0" property="10.0" />
voici une partie du xslt
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
| <h2>My Test</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Name </th>
<th>Test number</th>
<th>Value Expected</th>
<th>Real Value</th>
</tr>
<xsl:for-each select="Test/Inputs/*">
<tr>
<xsl:choose>
<xsl:when test="'@expected' != '@property'">
<tr bgcolor="#9acd32">
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@test"/></td>
<td><xsl:value-of select="@expected"/></td>
<td><xsl:value-of select="@property"/></td>
</tr>
</xsl:when>
<xsl:other>
<tr>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@test"/></td>
<td><xsl:value-of select="@expected"/></td>
<td><xsl:value-of select="@property"/></td>
</tr>
</xsl:other>
</xsl:choose>
</xsl:for-each>
</table> |
Partager