RunnerDuck

Postby RunnerDuck » Wed Dec 31, 2003 3:50 am

I'm new to RSS so bear with me. I have written a small sample page. When I open it in Awasu it only shows a little of the first subject. When I open it in SharpReader it is complete with paragraph breaks.

I've rewritten it about six times trying different things but nothing seems to wrok.

Here is the link, http://www.runnerduck.com/test_rss.xml

Thanks for any help,

Ken

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Wed Dec 31, 2003 7:01 am

RunnerDuck wrote:When I open it in Awasu it only shows a little of the first subject. When I open it in SharpReader it is complete with paragraph breaks.


XML is not the same as HTML. While your descriptions are HTML (i.e. you are using the <P> tag to start a new paragraph), you still have to follow the rules for XML since that is what RSS is.

One of these rules is anything that looks like a tag is an XML tag. So, your feed contains descriptions like this:

Code: Select all

<description>Blah blah blah<p>More blah blah blah</description>


whereas it should be like this:

Code: Select all

<description>Blah blah blah&lt;p>More blah blah blah</description>


You need to encode the opening < (using &lt;) so that it doesn't get processed as the start of an XML tag.

BTW, this is also an issue for ampersands. This is a special XML character so you need to use &amp; (although Awasu does its best to be forgiving about this one).

RunnerDuck

Postby RunnerDuck » Wed Dec 31, 2003 6:37 pm

Thank you that really helped. I still have another question. One of the best ways for me to learn someting is by seeing examples. When I click on your XML button the script that comes up has HTML <P> </P> for paragraphs. Yet you tell me I need to use & instead of <. Does something happen to the script when it opens in a browser? I've gone out to www.xml.com and reading away but examples of the real world help a lot.

Is there any way to see what the code really looks like?

Thanks,

Ken

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Wed Dec 31, 2003 9:05 pm

RunnerDuck wrote:When I click on your XML button the script that comes up has HTML <P> </P> for paragraphs. Yet you tell me I need to use & instead of <.


Whoops. I forgot to mention the easiest way to work around this :oops: Obviously too much Christmas cheer :roll:

If you wrap your XML data with a <![CDATA[ at the beginning and ]]> at the end, you can put whatever you want in there and it won't get processed as XML tags or special characters. Like this:

Code: Select all

<description><![CDATA[<b><i>Lots of HTML stuff here!</i></b>]]></description>


If you open XMLdata in a browser, they usually do some processing and formatting and so you don't get to see what's exactly there. The best way to look at a raw feed is to use a tool called wget which just downloads a file and saves it to disk.

RunnerDuck

Postby RunnerDuck » Thu Jan 01, 2004 12:55 am

Thanks again for the quick response. I tried the <![CDATA[ and ]]> between <descripton> and it didn't work. I did use & in place of <P> and it worked great.

I was unable to get wget to work, way above my head but for what it's worth, to look at the raw XML of a RSS feed just open up the code in your browser (IE5), right click and select "view source". Works perfect!

Happy New Year!!! :D

Ken
www.runnerduck.com

User avatar
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby support » Thu Jan 01, 2004 1:56 am

RunnerDuck wrote:Thanks again for the quick response. I tried the <![CDATA[ and ]]> between <descripton> and it didn't work. I did use & in place of <P> and it worked great.


Escaping all your HTML tags is a major pain so using CDATA makes life much simpler. Email me your feed using CDATA and I'll take a look at it.

RunnerDuck wrote:I was unable to get wget to work


The way I use it is like this:

Code: Select all

wget -O save.xml http://www.runnerduck.com/test_rss.xml


That's a capital letter O after the dash, BTW, and it will save the feed in a file called save.xml.


Return to “Awasu - General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests