Questo è il file XML (Prova.XML che richiama l'XSL Prova.XSL: sto usando l'XMLSpy)
Questo invece è appunto Prova.XSL, richiamato da Prova.XMLcodice:<?xml version="1.0" encoding="UTF-8"?> <?xml:stylesheet type="text/xsl" HREF="Prova.xsl"?> <root> <a>1</a> <a>3</a> <a>2</a> </root>
In questo caso il risultato sarà 6 (1+3+2). Forse hai dimenticato il template match nell'XSL ?codice:<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="/"> <xsl:value-of select="sum(//a)"/> </xsl:template> </xsl:stylesheet>
ciao.

Rispondi quotando