XML Filtering

wxdqz

New Member
Right now I have a spry XML dataset in dreamweaver CS3 that I want to filter.

Basically, my XML file looks like this:

<Players>
<Player_ID>Unique#</Player_ID>
<Pname>Text</Pname>
<JersNum>Number</JersNum>
<Position>Text</Position>
<Height>Text</Height>
<Weight>Text</Weight>
</players>


I'm displaying in in a PHP page. In the head of the document, I have this:

<script src=http://www.webdeveloper.com/forum/archive/index.php/"SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var PlayersDataset = new Spry.Data.XMLDataSet("Players.xml", "dataroot/Players",{sortOnLoad:"Pname",sortOrderOnLoad:"ascending"});
PlayersDataset.setColumnType("Player_ID", "number");
PlayersDataset.setColumnType("JersNum", "number");
//-->
</script>

In the body of the page, this code displays the table:

<div spry:region="PlayersDataset">
<table border="3" align="center" cellpadding="4" cellspacing="0" bordercolor="#001E4C" bgcolor="#FFFFFF">
<tr>
<th spry:sort="Player_ID">Player_ID</th>
<th spry:sort="Pname">Pname</th>
<th spry:sort="JersNum">JersNum</th>
<th spry:sort="Position">Position</th>
<th spry:sort="Height">Height</th>
<th spry:sort="Weight}">Weight}</th>
</tr>
<tr spry:repeat="PlayersDataset">
<td>{Player_ID}</td>
<td>{Pname}</td>
<td>{JersNum}</td>
<td>{Position}</td>
<td>{Height}</td>
<td>{Weight}</td>
</tr>
</table>
</div>


What I need to do is filter this data so that it displays the 1 row where "Player_ID" is equal to the URL variable "P_ID". Obviously I don't need the spry sorting features, just need to display a specific row of this XML dataset where "Player_ID" = a certain number. So, theoretically, I don't think I even need to use spry, just display one row of an XML table.

Any Suggestions or Help? I'm a real beginner so I using basic instructiosn would really help.

Thanks, Jason
 
Back
Top