Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] Re: working with XML data in a DataTable

Expand Messages
  • Satyam
    Your second attempt would be the way to go according to the way your data seems to be available. If you have separate xml files for each of the courses, you
    Message 1 of 5 , Nov 4, 2008
      Your second attempt would be the way to go according to the way your
      data seems to be available. If you have separate xml files for each of
      the courses, you have to load them separately, as you are doing in that
      sample. If you had a single file where information for each course
      could be extracted, then you would load it once, possibly with the
      Connection Manager, and extract the records for each course from it.
      How you extract them, it all depends on the structure of such file and
      it is a matter of regular XML Dom manipulation. YUI's Select utility
      can help in that, but it is about all YUI can do for you in that case.
      Extra arguments (name=value pairs) would only be of any use if there was
      a server streaming the data in XML or any other format upon request. If
      the information is already available in XML files as seems to be the
      case, arguments are pointless, files don't understand arguments, server
      scripts do.

      Satyam


      dpj22 wrote:
      > I'm still struggling with this. I made some progress but I'm not
      > finding a similar example in the docs.
      >
      > I want to have one xml file, load it into a var, and then display the
      > data into one of many tables if it matches a particular key value, in
      > my case it would be course name. I don't know where to put the "if" or
      > "for" statements - I think it would depend on how I load the data.
      >
      > We have 10 or so different courses. I'd like to display some text
      > about a course, then the datatable that holds the schedule, then the
      > next course, and so on.
      >
      > If I load the data with:
      >
      > var myDataSource = new YAHOO.util.DataSource("paddling.xml");
      > myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
      > myDataSource.responseSchema = {
      > resultNode: "class",
      > fields: ["name","date_start","length",{key:"available_spots",
      > parser:YAHOO.util.DataSource.parseNumber}]
      > };
      >
      > Is there a way to conditionally insert only "name"="somevalue" into
      > the myDataSource?
      >
      > Or if I do this the way Satyam suggested and use an asynch request,
      > how would the conditional look (and where would it go)?
      >
      > The original attempt was based on a YUI example that used a connection
      > manager asynch request:
      > http://216.55.144.95/data/schedule.html
      >
      > My second attempt, which displays two datatables from two datasources
      > is at:http://216.55.144.95/data/test.html
      >
      > Thank you!
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - http://www.avg.com
      > Version: 8.0.175 / Virus Database: 270.8.5/1764 - Release Date: 03/11/2008 7:46
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.