title: How can I use jquery (or other javascript) to parse data from iTunes-formatted podcast XML feed?
body: <p>I found the demo at think2loud.com that shows how to use jquery to parse an XML file.  I have downloaded the source files and uploaded them to my own server and it works fine.  A soon as I try to apply it to my own xml file (iTunes podcast feed) I don't get any output.  I'm kind of in over my head, I think.  </p>
  
  <p>What I'd like is to have <strong><em>ONLY THE FIRST</em></strong> podcast info displayed in the following format:</p>
  
  <p><em><strong></em>&lt; a href = path to file . mp3 > Title of message&lt; / a ></strong></p>
  
  <p><strong>Description of message</strong></p>
  
  <p>where:</p>
  
  <p>GUID is path to file</p>
  
  <p>TITLE is Title of Message</p>
  
  <p>ITUNES:SUBTITLE is Description of message</p>
  
  <p>Here's a sample of the demo code I'd like to tweak:</p>
  
  <pre><code>   &lt;script&gt;
      $(document).ready(function(){
          $.ajax({
              type: "GET",
              url: "sites.xml",
              dataType: "xml",
              success: function(xml) {
                  $(xml).find('site').each(function(){
                      var id = $(this).attr('id');
                      var title = $(this).find('title').text();
                      var url = $(this).find('url').text();
                      $('&lt;div class="items" id="link_'+id+'"&gt;&lt;/div&gt;').html('&lt;a href="'+url+'"&gt;'+title+'&lt;/a&gt;').appendTo('#page-wrap');
                      $(this).find('desc').each(function(){
                          var brief = $(this).find('brief').text();
                          var long = $(this).find('long').text();
                          $('&lt;div class="brief"&gt;&lt;/div&gt;').html(brief).appendTo('#link_'+id);
                          $('&lt;div class="long"&gt;&lt;/div&gt;').html(long).appendTo('#link_'+id);
                      });
                  });
              }
          });
      });
   &lt;/script&gt;
  </code></pre>
  
  <p>and here's an excerpt of the XML file I'd like to parse:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"&gt;
  &lt;channel&gt;
      &lt;atom:link rel="self" type="application/rss+xml" href="http://www.deepwaterchurch.com/podcast/podcast.xml" /&gt;
      &lt;lastBuildDate&gt;Mon, 15 Aug 2011 13:30:32 -0300&lt;/lastBuildDate&gt;
      &lt;title&gt;Deep Water Podcast&lt;/title&gt;
      &lt;itunes:author&gt;AJ Thomas&lt;/itunes:author&gt;
      &lt;link&gt;http://www.deepwaterchurch.com&lt;/link&gt;
  
      &lt;generator&gt;Podcast Maker v1.4.1 - http://www.lemonzdream.com/podcastmaker&lt;/generator&gt;
      &lt;description&gt;&lt;![CDATA[The weekly message from Deep Water Church in Halifax, Nova Scotia.]]&gt;&lt;/description&gt;
      &lt;itunes:subtitle /&gt;
      &lt;itunes:summary&gt;The weekly message from Deep Water Church in Halifax, Nova Scotia.&lt;/itunes:summary&gt;
      &lt;language&gt;en&lt;/language&gt;
      &lt;copyright&gt;2007 Deep Water Church&lt;/copyright&gt;
      &lt;image&gt;
  
          &lt;url&gt;http://www.deepwaterchurch.com/podcast/podcast_144.jpg&lt;/url&gt;
          &lt;title&gt;Deep Water Podcast&lt;/title&gt;
          &lt;link&gt;http://www.deepwaterchurch.com&lt;/link&gt;
          &lt;width&gt;144&lt;/width&gt;
          &lt;height&gt;144&lt;/height&gt;
      &lt;/image&gt;
  
      &lt;itunes:image href="http://www.deepwaterchurch.com/podcast/podcast.jpg" /&gt;
      &lt;category&gt;Christianity&lt;/category&gt;
      &lt;itunes:category text="Religion &amp;amp; Spirituality"&gt;
          &lt;itunes:category text="Christianity" /&gt;
      &lt;/itunes:category&gt;
      &lt;category&gt;Spirituality&lt;/category&gt;
      &lt;itunes:category text="Religion &amp;amp; Spirituality"&gt;
          &lt;itunes:category text="Spirituality" /&gt;
  
      &lt;/itunes:category&gt;
      &lt;category&gt;Non-Profit&lt;/category&gt;
      &lt;itunes:category text="Government &amp;amp; Organizations"&gt;
          &lt;itunes:category text="Non-Profit" /&gt;
      &lt;/itunes:category&gt;
      &lt;itunes:keywords&gt;deep water, deepwater, church, halifax, nova scotia, canada, jesus, aj thomas&lt;/itunes:keywords&gt;
      &lt;itunes:explicit&gt;no&lt;/itunes:explicit&gt;
  
      &lt;item&gt;
          &lt;title&gt;Hurry Up and Wait - Slow Down&lt;/title&gt;
          &lt;itunes:author&gt;Deep Water&lt;/itunes:author&gt;
          &lt;description&gt;&lt;![CDATA[Episode 2 of 2. Luke 10:38-42. A life that is ministry isn't just about being busy all the time-- we need to take time to sit at Jesus' feet and be quiet, too.]]&gt;&lt;/description&gt;
          &lt;itunes:subtitle&gt;Episode 2 of 2. Luke 10:38-42. A life that is ministry isn&amp;apos;t just about being busy all the time-- we need to take time to sit at Jesus&amp;apos; feet and be quiet, too.&lt;/itunes:subtitle&gt;
          &lt;itunes:summary /&gt;
  
          &lt;enclosure url="http://www.deepwaterchurch.com/podcast/Jen%20Ochej-August%2014%2C%202011.mp3" type="audio/mpeg" length="16625879" /&gt;
          &lt;guid&gt;http://www.deepwaterchurch.com/podcast/Jen%20Ochej-August%2014%2C%202011.mp3&lt;/guid&gt;
          &lt;pubDate&gt;Mon, 15 Aug 2011 13:29:03 -0300&lt;/pubDate&gt;
          &lt;category&gt;Christianity&lt;/category&gt;
          &lt;itunes:explicit&gt;no&lt;/itunes:explicit&gt;
          &lt;itunes:duration&gt;00:34:34&lt;/itunes:duration&gt;
  
          &lt;itunes:keywords&gt;deep water, deepwater, church, halifax, nova scotia, canada, jesus, aj thomas&lt;/itunes:keywords&gt;
      &lt;/item&gt;
  </code></pre>
  
  <p>The link to the demo I've been playing with is <a href="http://www.deepwaterchurch.com/testing" rel="nofollow">here</a></p>
  
  <p>Like I mentioned, I'd like this to pull only the most recently updated podcast (first "item") from the list.  I'm clearly in over my head!  I'd appreciate some guidance.  Thanks tons.</p>
  
  <hr>
  
  <p>Ok, I've got it working... kind of.  I have it appending to the "body", but I'd like to assign it to a specific DIV, like the original example.  When I try to set the <code>link.appendTo('body');</code> to <code>link.appendTo('podcast');</code> I get no output. <strong>EDIT: I figured that part out.  Still need help with the next question, though.</strong></p>
  
  <p>Secondarily, I'd like to be able to have a description of the episode ("itunes:subtitle" in the XML file) placed under the link.  Can we make this happen?</p>