PDA

View Full Version : RSS Feed Problem


|Zach|
04-27-2005, 11:25 AM
Hey I am having problems with my RSS feed on my site. For some reason my reader sees that there is a feed but it can't load it. Any idea what the problem could be?

www.ZachIsHere.com

Simplex3
04-27-2005, 01:46 PM
http://zachishere.com/wp-rss2.php

Here's what I get when I try to run your feed directly to firefox:
XML Parsing Error: xml processing instruction not at start of external entity
Location: http://zachishere.com/wp-rss2.php
Line Number 2, Column 1:
<?xml version="1.0" encoding="utf-8"?>
^

Looks like a simple issue with the xml file.

|Zach|
04-27-2005, 06:27 PM
Ok, so we know where the problem is; what should I change it that files coding?

Simplex3
04-27-2005, 07:21 PM
Ok, here's your issue in a nutshell. Why your generator (WordPress 1.5) is doing this I can't tell you. However, with this specific info you should be able to get it worked out.

Your file starts with a HEX 0A character (line feed). Typically Windows uses 0A0D, which is linefeed/carriage return. Your file works just fine if you take the initial 0A character out. If you open it in something like Notepad you'll probably see a little square or something since it's a non-printable character and Windows won't recognize it as a proper return. If you delete even the first occurance of that character then load your file in a browser it should load up just fine. XML spec requires that the first character be the opening brace "<".

This type of thing typically occurs when you move a file in binary mode from a *nix or Mac over to a Windows box. If you sent this file in ftp ascii mode the returns would be properly exchanged. It could also be that their generator expects to run on *nix and you have a Windows host. It's tough to tell with what I can get without hacking.

Is that more specific? :D

Simplex3
04-27-2005, 07:23 PM
If you have the source code for the file that is generating the xml file I can take a look.

|Zach|
04-27-2005, 08:09 PM
Here is the code for wp-rss2

<?php

if (empty($feed)) {
$blog = 1;
$feed = 'rss2';
$doing_rss = 1;
require('wp-blog-header.php');
}

header('Content-type: text/xml; charset=' . get_settings('blog_charset'), true);
$more = 1;

?>
<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>

<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" -->
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title><?php bloginfo_rss('name'); ?></title>
<link><?php bloginfo_rss('url') ?></link>
<description><?php bloginfo_rss("description") ?></description>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?></pubDate>
<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
<language><?php echo get_option('rss_language'); ?></language>

<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
<item>
<title><?php the_title_rss() ?></title>
<link><?php permalink_single_rss() ?></link>
<comments><?php comments_link(); ?></comments>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_the_time('Y-m-d H:i:s')); ?></pubDate>
<dc:creator><?php the_author() ?></dc:creator>
<?php the_category_rss() ?>

<guid><?php the_permalink($id); ?></guid>
<?php if (get_settings('rss_use_excerpt')) : ?>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php else : ?>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php if ( strlen( $post->post_content ) > 0 ) : ?>
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
<?php else : ?>
<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
<?php endif; ?>
<?php endif; ?>
<wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS>
<?php rss_enclosure(); ?>
</item>
<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
</channel>
</rss>

Simplex3
04-27-2005, 10:23 PM
Have you made any changes in your files? I just did a fresh install on my workstation and it all woks fine (I'm running linux).

The first thing to do would be to make sure you didn't ftp the source up in binary mode. If you did it could have left those excess and/or missing characters intact in the files and be f**king it up. I'm assuming you don't have shell access to the host and that you ftp'd the wordpress files up. You should be able to send them again using ascii mode as long as you don't overwrite the wp-config.php file with something invalid.

|Zach|
04-27-2005, 10:58 PM
Have you made any changes in your files? I just did a fresh install on my workstation and it all woks fine (I'm running linux).

The first thing to do would be to make sure you didn't ftp the source up in binary mode. If you did it could have left those excess and/or missing characters intact in the files and be f**king it up. I'm assuming you don't have shell access to the host and that you ftp'd the wordpress files up. You should be able to send them again using ascii mode as long as you don't overwrite the wp-config.php file with something invalid.
The FTP has an auto feature that guages weather it should be upload in binary or ASCII I switched it to ASCII and overwrote. I tried to load them up again but nothing really went. I fear this is hopeless. :(

I really appreciate the help though.

Simplex3
04-27-2005, 11:01 PM
Are you desperate enough to PM me the login info? I'll take a shot at it.

|Zach|
04-27-2005, 11:07 PM
I lay my trust upon you...

PM coming...

Simplex3
04-27-2005, 11:54 PM
I lay my trust upon you...

PM coming...
Well man, I PM'd you but it looks like it wins unless you can get me shell access. Sorry.