Ola pessoal,
Estou tendo um probleminha na hora de usar o for-each do xsl, por exemplo :
Neste codigo :
arquivo.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>RCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1982</YEAR>
</CD>
</CATALOG>
e o arquivo.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- TODO: Auto-generated template -->
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="CATALOG/CD">
<tr>
<td><h1><xsl:value-of select="//TITLE" /></h1></td>
<td><h4><xsl:value-of select="//ARTIST"></xsl:value-of></h4></td>
<td><h4><xsl:value-of select="//COUNTRY"></xsl:value-of></h4></td>
<td><h4><xsl:value-of select="//COMPANY"></xsl:value-of></h4></td>
<td><h4><xsl:value-of select="//PRICE"></xsl:value-of></h4></td>
<td><h4><xsl:value-of select="//YEAR"></xsl:value-of></h4></td>
</tr>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Quando eu faco o parser do xml ele realmente gera html ate ai ok, mas ele faz um for sempre do primeiro no, ou seja ele gera os 3 nos CD mas, os 3 iguais sendo sempre o primeiro no.
Alguem sabe o porque esta acontencendo isso??
Flw.