logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-18-2008, 11:04 AM   #1
maguskrool
 
Join Date: Sep 2008
Posts: 3
Default Nested XML Data Set problems

Hi. I'm learning to use the Spry framework and I've ran into some problems while creating nested xml data sets.

I have all the necessary .js and spry files linked. My goal is to use a data set like dsProjects4, one that is nested and that is linked to the "language" of the dsLanguages data set. That way, when the language changes, the data displayed by regions linked to dsProjects4 will change accordingly. It works if it's not a nested data set (dsProjects2), but I don't understand why it doesn't if it's nested.

Can anyone tell me what I'm doing wrong and why the nested xml data set number 4 doesn't work?

Thank you in advance.

languages.xml:

Code:
<language_list>

   <language>english</language>
   <language>portuguese</language>
</language_list>

projects.xml:
<project_list>
   <project name="proj1">
      <english>
         <title>project one</title>
         <date>2008</date>
      </english>
      <portuguese>
         <title>projecto um</title>
         <date>2008</date>
      </portuguese>
   </project>
   <project name="proj2">
      <english>
         <title>project two</title>
         <date>2008</date>
      </english>
      <portuguese>
         <title>projecto dois</title>
         <date>2008</date>
      </portuguese>
   </project>
</project list>

I then build the datasets on my index.html:
var dsLanguages = new Spry.Data.XMLDataSet("xml/languages.xml", "language_list/language");
var dsProjects1 = new Spry.Data.XMLDataSet("xml/projects.xml", "project_list/project");
var dsProjects2 = new Spry.Data.XMLDataSet("xml/projects.xml", "project_list/project/{dsLanguages::language}");
var dsProjects3 = new Spry.Data.NestedXMLDataSet(dsProjects1, "english");
var dsProjects4 = new Spry.Data.NestedXMLDataSet(dsProjects1, "{dsLanguages::language}");

And then I create the regions that will receive the data:
<p class="text_01" spry:region="dsProjects2">{title}</p> //displays "project one";
<p class="text_01" spry:region="dsProjects3">{title}</p> //displays "project one";
<p class="text_01" spry:region="dsProjects4">{title}</p> //displays nothing;
maguskrool is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com