English | >> Français << | Deutsch | Magyar | 中文 | Polski | ZVON > Tutorials > XSLT Tutorial |
Intro / Chercher / ZVON |
>> Page 42 << | Précédent | Suivant | Contenu | Index des éléments |
Source XML
<source> <number>253</number> <number>sd12</number> <number>-64</number> <number>2.25.25</number> <number>2.25</number> </source> Sortie
<DIV>253</DIV> <DIV>sd12 is not a number</DIV> <DIV>-64</DIV> <DIV>2.25.25 is not a number</DIV> <DIV>2.25</DIV> Vue HTML
253
sd12 is not a number
-64
2.25.25 is not a number
2.25 |
Feuille de style XSLT
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:template match="number"> <DIV> <xsl:value-of select="."/> <xsl:if test="string(number(.))='NaN'"> is not a number</xsl:if> </DIV> </xsl:template> </xsl:stylesheet> |