Today I launched the site of a jQuery plugin that I’ve been working on called jParse. The plugin allows you to easily parse XML that has been fetched with an Ajax request. The plugin works off of jQuery’s ajax method, so all of the same options are available. In terms of parsing, the plugin gives you a few options: Custom Output, Limit, Count of Items and the ability to run functions before and after jParse is finished.

jParse Demo:

The following is populated by jParse from the main RSS feed of this site.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

19 Responses to “jParse: Easily Parse XML with jQuery”

  1. Steven Black says:

    Hey Kyle, the demo's not working in Chrome 4.0.237.0 (the latest)

  2. stephen says:

    Your demo doesn’t seem to work with the latest Chrome beta

    • kylerush says:

      thanks steven and stephen. the version of jparse that i have out oddly only works with some xml feeds in chrome, so it slipped past my qa checks. i'm looking into the issue now.

  3. mupet says:

    What kind of license this plugin released?

  4. kylerush says:

    thanks for the suggestions jared. they're already on my to-do list =)

  5. dekztah says:

    for me, even the demo on your homepage wont display anything.
    FF3.6b1, IE7, Chrome 3.0.195

  6. @sedatkumcu says:

    thanks for this great article

  7. Shen says:

    Very nice work – very simple to get going. However, how can I distinguish between tags which are separated by their values? For example, I have xml which contains this:
    <image type="large">1.jpg</image>
    <image type="thumb">2.jpg</image>
    Thanks.

    • kylerush says:

      thank you @shen. an option to differentiate between nodes with the same name will be coming in the next feature release–hopefully this weekend. the plugin is still in beta, so there are a good amount of features that are still being worked on.

  8. Orson says:

    Nice work.

  9. Johnd says:

    You did a good work for sure! good article!

  10. Nic Johnson says:

    What an awesome way to interact with an xml feed!

  11. sergey says:

    Thanks for the plugin! but… 8(

    Tell me please how I can parse only certain elements from xml file?
    '
    Example i wish parse only 2 elements with their value, this is element with title 'elem1' and element with title 'elem2'

    please…. thanks! hello from Russia!

    • kylerush says:

      i don't see why not. jparse is built so that it can easily parse xml nodes with namespaces. so if you want to pull the username, the elementTag option for jParse would look like this:

      elementTag: ['ns3:userName']

      see the jparse usage page for more.

  12. Randy says:

    Do you have an example of using the attr option? i am trying to pull a value of a tag that contains my url to a podcast. i have set it as

    attr: [{elem: 'enclosure', attr: 'url'}]

    but i can't seem to get it to pull the value, actually i can't get it to pull any values. example of the XML

    <enclosure url='http://something.com/podcast233.mp3' length='13051569' type='audio/mpeg'/>

  13. Randy says:

    You can ignore my last post, i figured it out, and actually what was causing me some problems is around line 130 in the jparse script file, i was getting a console error, i just commented it out and i am all good now.

Leave a Reply