ho solo un altra domanda:
ho questo file xml e xsl:
Codice PHP:
<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="Catalogo/Prodotti/Categoria">
<a>
<xsl:attribute name="href">
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="."/>
</a>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Codice PHP:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Stile.xsl"?>
<Catalogo>
<Prodotti>
<Categoria id="1">Personal Computer</Categoria>
<Categoria id="2">Notebook</Categoria>
<Categoria id="3">Palmari</Categoria>
<Categoria id="4">Server</Categoria>
<Categoria id="5">Workstation</Categoria>
</Prodotti>
</Catalogo>
per ora il links lo fa alla pagina ad esempio:
Personal Computer e visualizza il testo Personal Computer,
se io ad esempio voglio il links alla pagina 1 e il testo Personal Computer, come devo fare ?
p.s. sia l'1 che Personal Computer deve errere preso dell' xml in modo dinamico.