Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Xml con namespace e xsl che non funziona

1 view
Skip to first unread message

Durabo

unread,
Feb 15, 2010, 7:43:23 PM2/15/10
to
Aiutatemi vi prego.

Questo è il file xml:

===
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">

<libreria>
<scaffale>

<libro>
<titolo>La verità del Ghiaccio</titolo>
<scrittore>Dan Brown</scrittore>
<prezzo>15.90</prezzo>
</libro>

<libro>
<titolo>La cavia</titolo>
<scrittore>Robin Cook</scrittore>
<prezzo>7.90</prezzo>
</libro>

</scaffale>
</libreria>

</string>
=====

... e questo è l'xsl

====
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html" />

<xsl:template match="/">
<html>
<body>
<h2>I tuoi libri</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">titolo</th>
<th align="left">scrittore</th>
</tr>
<xsl:for-each select="string/libreria/scaffale/libro">
<tr>
<td><xsl:value-of select="titolo"/></td>
<td><xsl:value-of select="scrittore"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
====

Quando applico l'xsl non vedo niente, ma se elimino la parte del
namespace e lascio solo <string> funziona tutto.

Qualcuno mi aiuta please?!?

0 new messages