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

Re: [ydn-javascript] Datasource, XML, ConnectionManager

Expand Messages
  • Satyam
    You would create the DataSource instance, set the responseSchema as shown in the docs: http://developer.yahoo.com/yui/datasource/#schemas in the section for
    Message 1 of 2 , Jun 25, 2009
    • 0 Attachment
      You would create the DataSource instance, set the responseSchema as
      shown in the docs:

      http://developer.yahoo.com/yui/datasource/#schemas

      in the section for XML. Then call method sendRequest with a callback
      object as shown in the Parameters section of the API docs:

      http://developer.yahoo.com/yui/docs/YAHOO.util.DataSourceBase.html#method_sendRequest

      The succcess callback will receive a reply as shown in oParsedResponse.
      If there is no error property in the oParsedResponse object, then you
      will find the parsed XML file in the results property. You can then use
      the JSON utility to stringify it.

      Satyam


      slant_e escribió:
      > Hi,
      >
      > I've been struggling trying to get the Datasource to work.
      >
      > I'm not sure if it's possible, but I wanted to read in a separate .xml file, and convert it to a JSON object using Datasource.
      >
      > I also wanted to do it locally, as in with no server call. Essentially if on my local computer (drive C), read in a .xml file in the same directory as the .html and then convert it to JSON. Can the YUI do this?
      >
      > Thanks,
      > Jaime
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.339 / Virus Database: 270.12.90/2200 - Release Date: 06/24/09 12:49:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.