no save
Assistance
Achat
News

Forum | webmastering
[XSL]traitement par défaut ...
teebo, le ven. 18 nov. 2005 à 15:26:09
Ben écoute, je viens de regarder un peu, même si ce n'est pas encore parfait (il faut fignoler en fonction de ce que tu as dans ton xml) mais un xsl comme ça:


<?xml version="1.0" encoding="windows-1250"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>


<xsl:template match="test">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="A">
<xsl:value-of select="."/> : Traitement noeud A;<br/>
<xsl:apply-templates select="C"/></xsl:template>

<xsl:template match="*">
<xsl:value-of select="."/> : <b>Undefined TAG;<br/></b>
</xsl:template>

</xsl:stylesheet>


avec un xml comme ça:

<?xml version="1.0" encoding="windows-1250"?>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<test>
<A>mavalA</A>
<A>mavalA <C>CdansA</C></A>
<D>mavalD <A>AdansD</A></D>
</test>


Me donne dans IE (rien de mieux sous la patte):

mavalA : Traitement noeud A;
mavalA CdansA : Traitement noeud A;
CdansA : Undefined TAG;
mavalD AdansD : Undefined TAG;


PrécédentZep3k!GnO
nov. 05
Zep3k!GnO
nov. 05
Suivant
REPONSES
mispech
nov. 05
Zep3k!GnO
nov. 05
teebo
nov. 05
Zep3k!GnO
nov. 05
Zep3k!GnO
nov. 05
teebo
nov. 05
Zep3k!GnO
nov. 05
teebo
nov. 05
Zep3k!GnO
nov. 05
teebo
nov. 05
Version Web
Réalisé par RedShift
no save