Hi everyone!
So I have a XML code
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="pizza.xsl"?>
<pizza_list>
<food>
<name>Margarita</name>
<description>tomato sauce</description>
<price>3.60 </price>
<diameter>30 cm</diameter>
</food>
<food>
<name>Green</name>
<description>tomato, oregano</description>
<price>5.40 </price>
<diameter>30 cm</diameter>
</food>
<food>
<name>Primaverra</name>
<description>tomato, mozzarella, cucumber</description>
<price>5.30 </price>
<diameter>30 cm</diameter>
</food>
<food>
<name>Sandokan</name>
<description>tomato, crab meat</description>
<price>6.40 </price>
<diameter>30 cm</diameter>
</food>
<food>
<name>Caribia</name>
<description>tomato, garlic, lemon, shrimp</description>
<price>6.60 </price>
<diameter>30 cm</diameter>
</food>
</pizza_list>
So how to put this into HTML table?
I've tried this:
<HTML>
<HEAD>
<Title>Pizza Menu:</Title>
</HEAD>
<BODY>
<xml id="pizza" src="pizza.xml"></xml>
<table DATASRC="pizza.xml" Border=4>
<thead>
<th>Pizza:</th>
<th>Description:</th>
<th>Price:</th>
<th>Diameter:</th>
</thead>
<tbody>
<xsl:for-each select="pizza/food">
<tr>
<td><span DATAFLD="name"></span></td>
<td><span DATAFLD="description"></span></td>
<td><span DATAFLD="price"></span></td>
<td><span DATAFLD="diameter"></span></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</BODY>
</HTML>
I've tried but the pizzas aren't showing in the table!
Help!