troubleshooting Question

XML Data in HTML using datasrc and datafld

Avatar of hhammash
hhammash asked on
HTMLXML
17 Comments1 Solution3497 ViewsLast Modified:
Hi,
I have the following code which works perfectly on IE7.  But it displays only table heading in IE8 and displays the code under the table in FireFox.

What to do to make the code work fine in IE8 and FireFox?

Here is the code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
<title>New Page 1</title>
</head>

<body>
<table datasrc="#products" border="1" width="400" cellspacing="1" style="border-collapse: collapse" id="table1">
<thead>
<tr>
<th>Product</th>
<th>Description</th>
<th>Type</th>
</tr>
</thead>
<tbody>
	<tr>
		<td><span datafld="name"></span></td>
		<td><span datafld="type"></span></td>
		<td><span datafld="price"></span></td>
	</tr>
</tbody>
</table>


<xml id="products">
<items>
	<item id="item1">
		<name>Mocha</name>
		<type>Coffee</type>
		<price>$3</price>
	</item>

	<item id="item2">
		<name>Black Coffee</name>
		<type>Coffee</type>
		<price>$31</price>
	</item>

	<item id="item3">
		<name>Capocino</name>
		<type>Coffee</type>
		<price>$12</price>
	</item>

	<item id="item4">
		<name>Late</name>
		<type>Coffee</type>
		<price>$9</price>
	</item>

	<item id="item5">
		<name>Mochchino</name>
		<type>Coffee</type>
		<price>$8</price>
	</item>
</items>
</xml>


</body>

</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 17 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros