Re: Comparer un parametre et une valeur 'XML4 dans une stylesheet xsl
Vincent Daanen <[email protected]>
| Newsgroups | gmane.text.xml.french.tech |
|---|---|
| Message-ID | <[email protected]> |
Nicolas Delaby a écrit : > Le 19/07/06, Vincent Daanen <[email protected]> a écrit : > >> Bonjour, >> >> j'ai un fichier XML qui contient une biblio. >> Dans chaque item de la biblio, un champ (<TYPE>) indique s'il s'agit >> d'un article, d'une conf, etc.. >> >> Bonjour, pouvez vous fournir un exemple de votre XML, afin de pouvoir vous >> > aidez ? > voici une partie du fichier xml : <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="biblio.xsl"?> <BIBLIOGRAPHY> <ITEM> <AUTHORS>Daanen V., Tonetti J. and Troccaz J.</AUTHORS> <TYPE>conference</TYPE> <TITLE>Automatic delineation of the osseous interface in ultrasound images by information fusion</TITLE> <BOOKTITLE>7th International Conference on Information Fusion (Fusion'2004)</BOOKTITLE> <MONTH>June</MONTH> <YEAR>2004</YEAR> <KEYWORDS>data fusion, segmentation, ultrasound imaging</KEYWORDS> <ADDRESS>Stockholm</ADDRESS> <URL>./downloadables/Daanen_InformationFusion_2004.pdf</URL> </ITEM> <ITEM> <TYPE>book</TYPE> <AUTHORS>Daanen V</AUTHORS> <TITLE>Suivi 3D de gestes chirurgicaux. Application a l'IRM interventionnelle</TITLE> <BOOKTITLE>Memoire de these</BOOKTITLE> <YEAR>2001</YEAR> <KEYWORDS>medical imaging, magnetic resonance imaging, interventionnal radiology, deformation correction, virtual backward loop servoing, stereovision.</KEYWORDS> <MONTH>May</MONTH> <URL>./downloadables/thesis_dissertation_2001.pdf</URL> </ITEM> </BIBLIOGRAPHY> l'appel de la template <xsl:call-template name="display"> <xsl:with-param name="doctype"> conference </xsl:with-param> </xsl:call-template> et la template qui ne veut pas fonctionner, meme avec la solution proposee par Eric van der Vlist <xsl:template name="display"> <xsl:param name="doctype" select="article" /> <!-- DEBUG : Affiche le type a afficher --> <xsl:text>doctype = </xsl:text> <xsl:value-of select="$doctype" /> <BR></BR> <xsl:for-each select="BIBLIOGRAPHY/ITEM"> <xsl:sort select="YEAR" order="descending"/> <!-- DEBUG : affiche le type de l'item --> <xsl:text>TYPE = </xsl:text> <xsl:value-of select="TYPE"/> <xsl:text> </xsl:text> <table border="1"> <xsl:if test="TYPE = $doctype"> <!-- affichage --> </xsl:if> </table> </xsl:for-each> </xsl:template> merci de votre aide Vincent -- Vincent Daanen, PhD Research Engineer, Post-Doctoral Position Laboratoire TIMC/IMAG (Univ. Joseph Fourier - CNRS UMR 5525) Equipe GMCAO Institut d'Ingénierie de l'Information de Santé (IN3S) Faculté de Médecine - 38706 La Tronche cedex - France Tel: +33 (0)4 56 52 00 54 - Fax: +33 (0)4 56 52 00 55 [email protected] "Les problèmes ne peuvent être résolus par ceux dont l'horizon se limite aux réalités quotidiennes, mais par ceux qui rêvent de choses qui n'ont jamais existées et qui se disent : Pourquoi Pas ?" J-F Kennedy, 1963.