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
| <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:variable name="dico" select="document('fichier2.xml')"/>
<HTML>
<HEAD>
<title>
VALUE
</title>
</HEAD>
<BODY>
<xsl:for-each select="Value//*">
<xsl:variable name="nomP" select="name()"/>
<xsl:variable name="value" select="@Value"/>
<xsl:variable name="noeudType" select="$dico//*[name()=$nomP]"/>
<!--fichier Dico-->
<xsl:variable name="Type" select="$noeudType/@Type"/>
<xsl:variable name="selection" select="$dico//*[name()=$Type]"/>
<xsl:variable name="type" select="$selection/@Type"/>
<xsl:variable name="label" select="$selection/@Label"/>
<xsl:variable name="unit" select="$selection/@Unit"/>
<xsl:variable name="Param" select="$selection/@Name"/>
<xsl:if test="$type='String'">
<br></br>
<u><b><xsl:value-of select ="$label"/>:</b></u><xsl:value-of select ="$value"/>
</xsl:if>
<xsl:if test="$type='Double'">
<br></br>
<u><b><xsl:value-of select ="$label"/>:</b></u><xsl:value-of select ="$value"/><xsl:value-of select ="$unit"/>
</xsl:if>
<xsl:if test="$type='Boolean'">
<br></br>
<u><b><xsl:value-of select ="$label"/>:</b></u><xsl:value-of select ="$value"/>
</xsl:if>
<xsl:if test="$type='Integer'">
<br></br>
<u><b><xsl:value-of select ="$label"/>:</b></u><xsl:value-of select ="$value"/><xsl:value-of select ="$unit"/>
</xsl:if>
<xsl:if test="$type='List'">
<br></br>
<xsl:value-of select ="$Param"/>
<xsl:variable name="noeudList" select="Value//*[name()=$Param]"/>
<xsl:for-each select="$noeudList">
<br></br>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet> |
Partager