Nested XML Data Set problems

  • maguskrool
  • Born
  • Born
  • maguskrool
  • Posts: 3

Post 3+ Months Ago

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 dsProjects4 doesn't work?

Thank you in advance.

Code: [ Select ]
 
languages.xml:
<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;
 
  1.  
  2. languages.xml:
  3. <language_list>
  4.  
  5.    <language>english</language>
  6.    <language>portuguese</language>
  7. </language_list>
  8.  
  9. projects.xml:
  10. <project_list>
  11.    <project name="proj1">
  12.       <english>
  13.          <title>project one</title>
  14.          <date>2008</date>
  15.       </english>
  16.       <portuguese>
  17.          <title>projecto um</title>
  18.          <date>2008</date>
  19.       </portuguese>
  20.    </project>
  21.    <project name="proj2">
  22.       <english>
  23.          <title>project two</title>
  24.          <date>2008</date>
  25.       </english>
  26.       <portuguese>
  27.          <title>projecto dois</title>
  28.          <date>2008</date>
  29.       </portuguese>
  30.    </project>
  31. </project list>
  32.  
  33. I then build the datasets on my index.html:
  34. var dsLanguages = new Spry.Data.XMLDataSet("xml/languages.xml", "language_list/language");
  35. var dsProjects1 = new Spry.Data.XMLDataSet("xml/projects.xml", "project_list/project");
  36. var dsProjects2 = new Spry.Data.XMLDataSet("xml/projects.xml", "project_list/project/{dsLanguages::language}");
  37. var dsProjects3 = new Spry.Data.NestedXMLDataSet(dsProjects1, "english");
  38. var dsProjects4 = new Spry.Data.NestedXMLDataSet(dsProjects1, "{dsLanguages::language}");
  39.  
  40. And then I create the regions that will receive the data:
  41. <p class="text_01" spry:region="dsProjects2">{title}</p> //displays "project one";
  42. <p class="text_01" spry:region="dsProjects3">{title}</p> //displays "project one";
  43. <p class="text_01" spry:region="dsProjects4">{title}</p> //displays nothing;
  44.  
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.