title: Trying to do some XSLT magic on YouTube XML, running into some namespace issues
body: <p>So I'm trying to write an XSLT script that will transform the default RSS feed for a YouTube playlist into a more visually pleasing format.  I think I have the code more or less down, but I'm running into what I think is an issue with namespaces.</p>
  
  <p>Basically, there's a <code>&lt;yt:videoid&gt;</code> and a <code>&lt;media:description&gt;</code> tag that my XSLT parser seems to choke on, and I'm not really sure how to fix it (neither namespace is ever defined in the original document).  My code looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:template match="/"&gt;
  &lt;xsl:for-each select="feed/entry"&gt;
      &lt;item&gt;
          &lt;title&gt;&lt;xsl:value-of select="title" /&gt;&lt;/title&gt;
          &lt;description&gt;
          &lt;![CDATA[&lt;img src="http://i.ytimg.com/vi/{yt:videoid}/hqdefault.jpg"&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &lt;xsl:value-of select="media:description"&gt;
          &lt;br /&gt;
          &lt;br /&gt;          
          &lt;iframe width="560" height="315" src="http://www.youtube.com/embed/{yt:videoid}" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;]]&gt;
          &lt;/description&gt;
          &lt;link&gt;http://www.youtube.com/watch?v={yt:videoid}&lt;/link&gt;
          &lt;guid isPermaLink="false"&gt;http://www.youtube.com/watch?v={yt:videoid}&lt;/guid&gt;
          &lt;pubDate&gt;&lt;xsl:value-of select="updated" /&gt;&lt;/pubDate&gt;
      &lt;/item&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p></p>
  
  <p>When I run it, it compiles with a bunch of "Namespace prefix X on Y is not defined" errors, and anywhere that I included <code>{yt:videoid}</code> or <code>media:description</code> appears as plaintext rather than the appropriate value.</p>
  
  <p>Another more minor issue is that the XML document is opened with </p>
  
  <pre><code>&lt;feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007' gd:etag='W/&amp;quot;Ak8EQX47eCp7I2A9WhdSEkQ.&amp;quot;'&gt;
  </code></pre>
  
  <p>and it won't even parse unless I manually cut it down to <code>&lt;feed&gt;</code>.  Again, that's a much smaller issue, and I'd much prefer to solve the first one.  If anyone has any advice, I'd really appreciate it!</p>
  
  <p>Adam</p>