ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

RSS Document Empty

October 31, 2011 1:20pm

Subscribe [3]
  • #1 / Oct 31, 2011 1:20pm

    RedSixMedia

    7 posts

    This question may be related to a resolved thread.

    Hey everyone,
    I’m getting an error with my rss feed:
    “error on line 1 at column 1: Document is empty”

    My code is:

    preload_replace:master_channel_name=“news”}
    {exp:rss:feed channel="{master_channel_name}” status=“Homepage Featured|Homepage Secondary|open”}

    <?xml version=“1.0” encoding=”{encoding}”?>
    <rss version=“2.0”
      xmlns:dc=“http://purl.org/dc/elements/1.1/”
      xmlns:sy=“http://purl.org/rss/1.0/modules/syndication/”
      xmlns:admin=“http://webns.net/mvcb/”
      xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”
      xmlns:content=“http://purl.org/rss/1.0/modules/content/”>

      <channel>
     
      <title>{exp:xml_encode}{site_name}{/exp:xml_encode}</title>
      <link>{site_url}</link>
      <description>{channel_description}</description>
      <dc:language>{channel_language}</dc:language>
      <dc:creator>{email}</dc:creator>
      <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
      <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
      <admin:generatorAgent rdf:resource=“http://expressionengine.com/” >
     
    {exp:channel:entries channel="{master_channel_name}” limit=“10” dynamic=“no” disable=“member_data|pagination” status=“Homepage Featured|Homepage Secondary|open”}
      <item>
        <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
        <link>{title_permalink='news/view'}</link>
        <guid>{title_permalink='news/view'}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
        <description><![CDATA[{news_excerpt}]]></description>
        <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
        <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
      </item>
    {/exp:channel:entries}
     
      </channel>
    </rss>

    {/exp:rss:feed}

    As far as I’m aware, my channel is correct, I have 2 test articles for the news channel, and they show up on the news page http://www.pmartinlaw.com/news . I’m assuming there is something wrong with the first line of the rss code but I can’t seem to figure this out. Any help would be greatly appreciated.
    Feed link is http://www.pmartinlaw.com/feed

     

  • #2 / Nov 01, 2011 4:22am

    John Henry Donovan

    12339 posts

    Hi,


    can you try our default sample code and see if that works for you

    {preload_replace:master_channel_name="news"}
    {exp:rss:feed channel="{master_channel_name}" status="not closed"}
    
    <?xml version="1.0" encoding="{encoding}"?>
    <rss version="2.0"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:admin="http://webns.net/mvcb/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:content="http://purl.org/rss/1.0/modules/content/">
    
        <channel>
        
        <title><![CDATA[{channel_name}]]></title>
        <link>{channel_url}</link>
        <description>{channel_description}</description>
        <dc:language>{channel_language}</dc:language>
        <dc:creator>{email}</dc:creator>
        <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
        <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        <admin:generatorAgent rdf:resource="http://expressionengine.com/" >
        
    {exp:channel:entries channel="{master_channel_name}" limit="10" dynamic_start="on" disable="member_data|pagination" status="not closed"}
        <item>
          <title><![CDATA[{title}]]></title>
          <link>{title_permalink='news/index'}</link>
          <guid>{title_permalink='news/index'}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description><![CDATA[{news_excerpt}]]></description>
          <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/categories}]]></dc:subject>
          <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        </item>
    {/exp:channel:entries}
        
        </channel>
    </rss>
    
    {/exp:rss:feed}

    What version and build of EE are you using?

  • #3 / Nov 01, 2011 12:04pm

    RedSixMedia

    7 posts

    Hey that worked! Thanks a lot for the help. This particular one is running off of 2.2.1.
    Unless you think it is extremely important to update, I’m not getting paid for these updates and would rather not waste the time.

  • #4 / Nov 03, 2011 12:03pm

    Robin Sowell

    13255 posts

    LOL- I do sympathize.  I would suggest upgrading to 2.3.1 as there have been some security tweaks since 2.2.1.  But it’s really a judgment call if everything else is working.

    Glad JH got you squared away!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases