Home > Default > Really Frustrating, please help

Really Frustrating, please help

November 30Hits:0
Advertisement
Hi all, I am currently in the procesing of looking at the
SPRY framework and I have hit a brick wall
with a bit of code that I am trying to make work. This
involves 4 select boxes.
I have created the following XML file
<Regions>
<Region>
<REGIONID>0</REGIONID>
<REGIONNAME>Region</REGIONNAME>
<Countries>
<COUNTRYID>0</COUNTRYID>
<COUNTRYNAME>Country</COUNTRYNAME>
<Divisions>
<DIVISIONID>0</DIVISIONID>
<DIVISIONNAME>Division</DIVISIONNAME>
<Clubs>
<CLUBID>0</CLUBID>
<CLUBNAME>Clubname</CLUBNAME>
</Clubs>
</Divisions>
</Countries>
</Regions>
</Regions>
I have the following code at the top of my page
<script src="js/SpryData.js"></script>
<script src="js/xpath.js"></script>
<script language="javascript">
var dsRegions = new Spry.Data.XMLDataSet("/xml/clubs.xml",
"Regions/Region");
var dsCountries = new
Spry.Data.XMLDataSet("/xml/{dsRegions::url}", "Region/Countries");
var dsDivisions = new
Spry.Data.XMLDataSet("/xml/{dsCountries::url}",
"Countries/Divisions");
var dsClubs = new
Spry.Data.XMLDataSet("/xml/{dsDivisions::url}", "Divisions/Clubs");
</script>
I am trying to use the data with the following 4 selects
<form name="selClub" id="selClub" method="post"
action="##">
<span spry:region="dsRegions">
<select spry:repeatchildren="dsRegions" id="RegionId"
style="width:100%;" onchange="dsRegions.
setCurrentRow(this.value)">
<option value="{REGIONID}">{REGIONNAME}</option>
</select>
</span><br /><br />
<span spry:region="dsCountries">
<select spry:repeatchildren="dsCountries" id="CountryId"
style="width:100%;">
<option
value="{COUNTRYID}">{COUNTRYNAME}</option>
</select>
</span><br /><br />
<span spry:region="dsDivisions">
<select spry:repeatchildren="dsDivisions" id="DivisionId"
style="width:100%;">
<option
value="{DIVISIONID}">{DIVISIONNAME}</option>
</select>
</span><br /><br />
<span spry:region="dsClubs">
<select spry:repeatchildren="dsClubs" id="ClubId"
style="width:100%;">
<option value="{CLUBID}">{CLUBNAME}</option>
</select>
</span><br /><br />
<div style="text-align:right;">
<input type="button" name="go" value="Go" />
</div>
</form>
All I ever get is the first select box appearing on my page,
I do not see any of the other three,

Answers

Hi Scout99,
In the constructor for dsCountries, you are using a data
reference {dsRegions::url}, but I don't see a url node anywhere in
your sample XML.
--== Kin ==--

Read other 2 answers

Tags:

Related Articles

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.839 s.