ciao.
ho il seguente file xml :
ho creato il foglio di stile cosi :codice:<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="Ricettario.xsl" type="text/xsl"?> <!DOCTYPE Ricettario SYSTEM "Ricettario.dtd"> <Ricettario> <Ricetta> <Nome>xxxx</Nome> <Portata>xxxxx</Portata> <NumeroPersone>xxx</NumeroPersone> <Ingredienti> <Ingrediente>1</Ingrediente> <Ingrediente>2</Ingrediente> <Ingrediente>3</Ingrediente> <Ingrediente>4</Ingrediente> </Ingredienti> <Preparazione>aaaaaaaa</Preparazione> </Ricetta>
mi aspettavo che mi comparissero tutti gli ingredienti, ma ne esce solo uno. dove stà l'errore ??codice:<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="."> <html> <head> <Title>Ricettario di Daniele Boncompagni</Title> </head> <body bgcolor="green"> <xsl:for-each select="Ricettario"> <hr/> <h2 align="center">Ricettario</h2> <hr/> <xsl:for-each select="Ricetta"> <h2><xsl:value-of select="Nome"/></h2> <p align="left">Ingredienti per <xsl:value-of select="NumeroPersone"/> persone</p> <xsl:for-each select="Ingredienti"> <xsl:value-of select="Ingrediente"/> </xsl:for-each> Preparazione : <xsl:value-of select="Preparazione"/> </p> </xsl:for-each> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>![]()

Rispondi quotando
