title: Converting XML to RSS
body: <p>I've got an xml feed that will be published in one location of our website, and would like to repurpose that for an RSS feed. </p>
  
  <p>A few different pages on the website will also be referencing the same xml - all of those transformations are set up and working.</p>
  
  <p>The base xml file (XMLTEST.xml) is using this structure:</p>
  
  <pre><code>&lt;POST&gt;
    &lt;item&gt;
      &lt;POST_ID&gt;80000852&lt;/POST_ID&gt;
      &lt;POST_TITLE&gt;title&lt;/POST_TITLE&gt;
      &lt;POST_CHANNEL&gt;I&lt;/POST_CHANNEL&gt;
      &lt;POST_DESC&gt;description&lt;/POST_DESC&gt;
      &lt;LINK&gt;http://www...&lt;/LINK&gt;
      &lt;STOC&gt;N&lt;/STOC&gt;
    &lt;/item&gt;
  &lt;/POST&gt;
  </code></pre>
  
  <p>I'm trying to transform the xml into an RSS feed using the following setup (feed.xml + rss.xsl)</p>
  
  <p>feed.xml:</p>
  
  <pre><code>&lt;?xml-stylesheet href="rss.xsl" type="text/xsl"?&gt;
  &lt;RSSChannels&gt;
    &lt;RSSChannel src="XMLTEST.xml"/&gt;
  &lt;/RSSChannels&gt;
  </code></pre>
  
  <p>rss.xsl:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
    &lt;xsl:output method="xml" omit-xml-declaration="yes" /&gt;
  
    &lt;xsl:template match="RSSChannels"&gt;
      &lt;rss version="2.0"&gt;
        &lt;channel&gt;
          &lt;title&gt;site title&lt;/title&gt;
          &lt;link&gt;&lt;/link&gt;
          &lt;description&gt;Site description...&lt;/description&gt;
          &lt;xsl:apply-templates /&gt;
        &lt;/channel&gt;
      &lt;/rss&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="RSSChannel"&gt;
      &lt;xsl:apply-templates select="document(@src)" /&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="item"&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when test="STOC = 'Y'"&gt;&lt;/xsl:when&gt;
        &lt;xsl:when test="POST_CHANNEL = 'I'"&gt;&lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
          &lt;item&gt;
            &lt;title&gt;
              &lt;xsl:value-of select="*[local-name()='POST_TITLE']" /&gt;
            &lt;/title&gt;
            &lt;link&gt;
              &lt;xsl:value-of select="*[local-name()='LINK']" /&gt;
            &lt;/link&gt;
            &lt;description&gt;
              &lt;xsl:value-of select="*[local-name()='POST_DESC']" /&gt;
            &lt;/description&gt;
          &lt;/item&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>When I try to view the output of feed.xml in Firefox, all of the filtering is applied correctly (sorting out items that shouldn't be published in that channel), but the page outputs as plain text, rather than the usual feed-detection that takes place in Firefox. Any ideas on what I'm missing?</p>
  
  <p>Thanks for any suggestions you can provide.</p>