Results 1 to 9 of 9
  1.    #1  
    I have a project in mind, and the data sources I will have available to parse can be presented to me in JSON or XML, depending on the URL I choose.

    Which one would be easier to parse out given the current Pre development tools?
  2. moserjj's Avatar
    Posts
    468 Posts
    Global Posts
    470 Global Posts
    #2  
    without a doubt, JSON
  3. #3  
    You can obviously do it with both and eventually make them the same from a development standpoint, but JSON has two advantages, we already have a nice library which is one simple call and its ready to be used in the code, and it is (potentially) much lighter than xml.
  4. #4  
    Both can work easily well with the Mojo SDK. We have APIs that do both.
    Developer Advocate, Palm Inc.
  5.    #5  
    Thanks all. I know XML much better, so maybe I'll use this as the chance to learn some JSON theory & practice.
  6. #6  
    JSON is just taking a javascript object and storing in in a string. From a developer standpoint it's easier to type up and from a bandwidth standpoint it can be much lighter as you aren't wrapping everything in rather cumbersome tags.
    The other nice thing with JSON is that you can just plug the data right into your javascript apps and more or less use it exactly as is.
  7. #7  
    Historically speaking, JSON is more efficient, speed and size.
    Wifi Media Sync 3.0 now available for PC and Mac OSX.
  8. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #8  
    Object.toJSON()

    HUGE TIME SAVER!

    Palm Pre Backup Utility...done!
    Locate Pre....done!
  9. #9  
    Object.toJSON()
    Yeah, there's something like that built into a lot of languages these days. For instance in php you can:
    Code:
    <?php
    ...
    echo json_encode($your_object);
    ...
    ?>
    XML, on the other hand, usually requires additional libraries which, depending on your server host, may not be available for use in your server-side AJAX handlers.

Posting Permissions