[XSLT et XPath] namespace-uri
Bonjour à tous
Je désire filtrer les films qui sont dans un espace de nom
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="./ex7b.xsl"?>
<films xmlns:es="http://iut-blagnac.fr/xml/films">
<film xmlns="http://iut-blagnac.fr/xml/films">
<nom>Quatre étoiles</nom>
<note>11</note>
<critique>Pas terrible quand même</critique>
</film>
<es:film>
<nom>Sun Shine</nom>
<note>12</note>
<critique>Un peu noir</critique>
</es:film>
<film>
<nom>A bord du Darjeeling Limited</nom>
<note>18</note>
<critique>Splendide</critique>
</film>
</films> |
Je ne trouve pas le bon prédicat pour le faire dans la feuille XLST suivante.
Je pense que c'est au niveau de "film[namespace-uri(.) "
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
indent="yes" />
<xsl:template match="films">
<html>
<body>
<H1>Films dans l'espace de nom</H1>
<ul>
<xsl:apply-templates select="film[namespace-uri(.)='http://iut-blagnac.fr/xml/films']" />
</ul>
</body>
</html>
</xsl:template>
... |
D'avance merci