[XSLT] [XPath] Nombre d'ancètres
Hello,
Je voudrais faire un template avec un match sur un élément qui n'a qu'un seul ancètre, c'est-à-dire eui est juste dans la racine.
J'ai le code suivant, mais il me met l'erreur: "Le préfixe de l'espace de noms ancestor n'est pas déclaré..."
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:def="www.ploxien.com/ns/def" xmlns:pr="http://www.arcaciel.com/profil/ns/system">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="xs:schema">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:pr="http://www.arcaciel.com/profil/ns/system">
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="xs:element[count(self::ancestor:*) = 1]">
...
<br/>
<xsl:value-of select="@type"/> : <xsl:value-of select="@name"/>
<br/>
</xsl:template>
</xsl:stylesheet> |
Vous voyez de quoi vient l'erreur?
Merci