Click to See Complete Forum and Search --> : Spry Table


khujo56
07-08-2009, 07:41 PM
Hi Guys,

I am a newbie when it comes to spry for dreamweaver. I need some help on a spry table that loads a xml file. I followed the tutorial but when i test the page, the table with headers appear but the xml file does not load. Can someone help me figure this out.

www.iheartvacation.com/test1.html

i have attached the xml file.

<?xml version="1.0" encoding="utf-8"?>
<vacations>
<name>
Vancouver
</name>
<date>
July 22nd - 30th
</date>
<price>
$499
</price>

</vacations>

peteincali
07-09-2009, 12:24 AM
You are missing some code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var dsevent = new Spry.Data.XMLDataSet("test.xml", "vacations");
//-->
</script>
</head>

<body>
<div spry:region="dsevent">
<table cellpadding="10" cellspacing="10">
<tr>
<th spry:sort="name">Name</th>
<th spry:sort="date">Date</th>
<th spry:sort="price">Price</th>
</tr>
<tr spry:repeat="dsevent">
<td>{name}</td>
<td>{date}</td>
<td>{price}</td>
</tr>
</table>
</div>
</body>
</html>



Also, get rid of spaces and linebreaks in xml file:

<?xml version="1.0" encoding="utf-8"?>

<vacations>
<name>Vancouver</name>
<date>July 22nd - 30th</date>
<price>$499</price>
</vacations>