Chiedo scusa per questa domanda banale. Ma perchè questo codice mi restituisce il vuoto?
Nota: "classe" è un attributo del nodo attrezzatura e non funziona neanche con test="attrezzatura[@classe=$prova]"codice:<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:apply-templates select="attrezzatura"/> </body> </html> </xsl:template> <xsl:template match="attrezzatura"> <xsl:variable name="prova" select="tipoA" /> <xsl:if test="@classe=$prova"> -Elemento <xsl:apply-templates select="descrizione" /> </xsl:if> </xsl:template> <xsl:template match="descrizione"> <xsl:value-of select="text()"/> </xsl:template> </xsl:stylesheet>
Grazie

Rispondi quotando