Bonjour,
J'ai de nouveau un probléme d'acces au balise à transformer via xslt:
Revoilà une partie de mon XML :
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ircad.org/webservices/service1">
<anyType xsi:type="NewDevice">
<ID>3002</ID>
<ListPort>
<anyType xsi:type="Port">
<ID>300300201</ID>
<No>1</No>
<Vitesse>100</Vitesse>
<Equipement>3002</Equipement>
<MAC>00-50-ba-2e-22-7a</MAC>
</anyType>
</ListPort>
<ListConnexion>
<anyType xsi:type="Connexion">
<Pere>6006</Pere>
<Fils>300300201</Fils>
<Structurel>0</Structurel>
<Agregat>0</Agregat>
<Doublette>0</Doublette>
</anyType>
</ListConnexion>
<PriseM>0</PriseM>
<Nom>Internet-1</Nom>
<Portswitch>0</Portswitch>
</anyType>
et ce que je souhaite faire est d'acceder au champs ID pour pouvoir tester sa valeur et faire des operation en fonction de cet valeur.
Mon xslt :
<xsl:stylesheet
xmlns:cartographie="http://www.ircad.org/webservices/service1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!--
<xsl:output method="xml" indent="yes"
doctype-public="-//W3C//DTD SVG 1.0//EN"
doctype-system="http://www.w3.org/TR/2001/REC-SVG-
20010904/DTD/svg10.dtd"/>
-->
<xsl:template match="/">
<xsl:copy-of select="/xsl:stylesheet/@version"/>
<svg width="80%" height="100%" viewBox="0 0 1500 1000">
<text style="font-size:60; font-family:'Comic Sans MS';fill:teal; text-anchor:middle;" x="750" y="100">My Network</text>
<g>
<xsl:call-template name="maFunction"/>
</g>
</svg>
</xsl:template>
<xsl:template name="maFunction">
<xsl:param name="parent" select="cartographie:ArrayOfAnyType/cartographie:anyType"/>
<xsl:if test="count($parent) > 0">
<xsl:for-each select="$parent">
<xsl:variable name="ID" select="$parent/ID"/> // C'est ici ou ca pose probleme
<xsl:if test="$ID = '3002'">
<rect x="100" y="{position()* 30}" width="20" height="20" fill="#CCccCC"/>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Merci encore pour votre aide
Cordialement
---------------------------------
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Received on Tue Jul 26 10:47:00 2005