CDATA not working in RSS Title - rss

cdata is not working in title. it is working in description !
<item>
<title>Line and <![CDATA[<br />]]>breaked line</title>
<pubDate>09 Jun 2010</pubDate>
<description>Line and <![CDATA[<br />]]>breaked line</description>
<category>cat</category>
</item>

In what way is it not working? I imagine that most RSS clients won't render HTML in a <title> tag, anyway (especially not line breaks).

Related

Filtering a RSS feeds

Is it possible to filter an RSS feed? What I mean is this, this is a sample of my RSS feed. As you can see, I have a category tag. Now, is it possible to filter by <category>?
Right now, the filtering functionality is done in code. Is there a better way to do it organically in RSS feeds itself?
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<language>en</language>
<copyright></copyright>
<category><![CDATA[Outdoor_Decor]]></category>
<item>
<title><![CDATA[It’s Linner Time! ]]></title>
<link>http://marilyn.localhost/Entertaining/segments/Daily/August2013/08_01_2013/LinnerDecor</link>
<description><![CDATA[]]></description>
<pubDate>1/1/0001 12:00:00 AM</pubDate>
<media:thumbnail url="http://marilyn.localhost/getattachment/903cf7b4-3016-4b09-b992-b54a1819a13a/RSSFeeds/Feeds1?height=349&width=620&crop=True" />
</item>
</channel>
</rss>
No, you can't do it in the "feed" itself. The feed is just a "format". You have to use some kind of code (be it XSLT transformation, a parser or... ) to discard the content which is of no interest to you.

Importing post tags into Wordpress with the WXR format

I'm moving from a legacy system over to Wordpress. I've read that the WXR import format isn't officially documented, but that this sample can be used as documentation.
With that said, why isn't this post tagged with "awesome"? The awesome tag is created in the top of the WXR file with
<tag>
<term_idname>2781</term_idname>
<tag_slug>awesome</tag_slug>
<tag_name>
<![CDATA[awesome]]>
</tag_name>
</tag>
And I find it in the backend after importing. The post is however not tagged. No posts are tagged. But all tags are imported, just with 0 children. This is how I try to import the post:
<item>
<title>The title is awesome</title>
<link>http://example.com/awesome</link>
<creator>This Ramvi</creator>
<guid isPermaLink="false">http://example.com/awesome</guid>
<description></description>
<encoded>
<![CDATA[<p>Very short post
</p>]]>
</encoded>
<post_id>843156</post_id>
<post_date>2014-10-22 10:34</post_date>
<post_date_gmt>2014-10-22 08:34</post_date_gmt>
<comment_status>open</comment_status>
<ping_status>open</ping_status>
<post_name>Really awesome post</post_name>
<status>publish</status>
<category domain="tag">
<![CDATA[awesome]]>
</category>
<post_type>post</post_type>
</item>
Can you spot what I'm doing wrong?
The answer is pretty much in the sample linked to in the question. You need two lines to add tags to a post:
<category domain="tag"><![CDATA[NewTag]]></category>
<category domain="tag" nicename="newtag"><![CDATA[NewTag]]></category>

How can I keep XHTML markup in the RSS output from Yahoo Pipes

I am using yahoo pipes to aggregate a variety of rss feeds (and make some simple transformations, etc). However, the XHTML content of my feeds is stripped away by the aggregation process. The problem seems to have nothing to do with my pipes code, and simply be a result of how Yahoo Pipes transforms the input RSS I am feeding it into the output RSS it spits out -- though both are apparently RSS, they are quite different XML files.
So, for example, when the "input" rss looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<feed>...
<entry>
...
<title>...</title>
<content type="xhtml">
HTML CONTENT HERE
</content>
</entry>
...
</feed>
The output looks like this:
<rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title></title>
<description></description>
<link>
</link>
...
<item>
<title>...</title>
...
<description>
NON HTML CONTENT HERE
</description>
...
</item>
</channel>
</rss>
It seems that the problem is that the contents of the <content> tag in my input are being converted into a <description> tag in the yahoo rss output, and from what I looked up, the <description> tag does not support markup within it, so it makes sense that that content is plain text.
My problem is that I can't find any documentation of why Yahoo is making this transformation or how to avoid it. It is nothing that I can find in my pipe, but on the other hand, I can't find a way to access an un-transformed version of my pipe's output. It seems I must be missing something because obviously people use embedded HTML in RSS all the time and I can't imagine it's all being squashed in every pipe out there.
Here is the link to a minimal test case in which I pull in a single feed and output it again with Yahoo pipes: http://pipes.yahoo.com/pipes/pipe.info?_id=5302fba3cc2d02f7a87ffdded87ce627
Can anyone tell me how to modify the above test pipe so that it will spit out content with html in it? Alternatively, can anyone explain if/why this is impossible to do?
AFAIK you can't get raw feed output as XML - Yahoo! shoehorns your output into specific standard RSS fields, as you noticed. The best option that I can think of is to get your output as json (a javascript object), as the json preserves all the fields in the input:
http://pipes.yahoo.com/pipes/pipe.run?_id=5302fba3cc2d02f7a87ffdded87ce627&_render=json
Most modern processors will take json output in addition to RSS.

RSS atom:link - Self reference doesn't match document location

I'm trying to create some valid RSS 2.0 data and I can't get the "atom:link" to validate.
Is it because I havent done the page yet, or is it because I have some invalid format?
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<atom:link href="http://www.lasseedsvik.se/rss" rel="self" type="application/rss+xml" />
<title>Test Test</title>
<link>http://www.lasseedsvik.se/rss</link>
<description>test</description>
<language>sv-se</language>
<item>
<title>test</title>
<link>
http://www.lasseedsvik.se/123
</link>
<guid>
http://www.lasseedsvik.se/123
</guid>
<description>
<![CDATA[test]]>
</description>
</item>
</channel>
</rss>
A link to the validator error page would be useful to help you debug this.
But I think you may need to put the version before the nanemspace declaration, like so:
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
The validator may also want to see an XML prolog. Maybe you have one and just did not include it in your example.
Note that no validator is perfect. The one at feedvalidator.org, for example, carps about perfectly valid feeds that don't implement "best practices" defined by the validator's creators. So, the most important thing is to make sure your feed is valid XML, then make sure it complies with the RSS 2.0 spec.

I have question about RSS feed

I am stuck on this. My project is to do this..This week you will be creating a theme for a web development company.
* You can use http://www.1kbgrid.com/ for a base design.
* Come up with a color scheme that will match this logo.
* Decide what your top links should be. Create an RSS feed for these top pages.
* Create a report that states the scope of the project (why you are doing it), the top level pages, why you picked the color scheme,etc.
ok I have done and rss thing and this is what it looks like
<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
<title>Web design software</title>
<link></link>
<description>Has different soft ware and prices.</description>
<item>
<title>Adobe Dreamweaver</title>
<link>http://shopping.yahoo.com/search?p=web%20design</link>
<description>This tells you how much it cost and what it is
for.</description>
</item>
<item>
<title>Frontpage 2003 upgrade</title>
<link>
http://www.softwaremedia.com/microsoft/frontpage/frontpage-
2003-upgrade.html?ovchn=PGR&ovcrn=39202323&ovtac=CMP&ovcpn=frontpage-2003---upgrade</link>
<description>THis is to help build a better web
site.</description>
</item>
<item>
<title>WebPlus X4 Website Maker Mini Box</title>
<link>
http://accessories.us.dell.com/sna/productdetail.aspx?sku=A3310055&cs=04&c=us&l=en&dgc=SS&cid=52102&lid=1342490</link>
<description>It helps you to make websites</description>
</item>
</channel>
</rss>
what i am stuck on is how to decide what my top link should be.Create an RSS feed for those top pages. Ok the question is am I suppose to link the rss feed or if that is even possible. I am totally lost on this question. Thank you for ready this.
You generally link to RSS documents from your main site by using the <link> tag. It should look something like this
<link rel="alternate" type="application/rss+xml" title="Top Web design software Feed" href="http://LINKTOMYRSSFILE" />
If you site is a dynamic site, you'll need to replace LINKTOMYRSSFILE with the link to the file that generates your RSS. If it's a static file, just save this file in your server and point it to that.
Also, your main channel link should point to the link of the page that displays all this content.
EDIT
First off, you should use the W3C service to validate your feed. They point out what's wrong/best practices and tells you how you can fix them (use the help link next to the error)
Make sure the empty <link></link> tag contains a url to your site
To answer your questions in the comments
Missing atom:link with rel="self"
According to the RSS Advisory Board's
Best Practices Profile, identifying a
feed's URL within the feed makes it
more portable, self-contained, and
easier to cache. For these reasons, a
feed should contain an atom:link used
for this purpose.
via : http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
You can fix this by changing your <rss> tag to
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
And having the following above items
<atom:link href="http://LINKTOFEED" rel="self" type="application/rss+xml"/>
Line 12, column 2: item should contain a guid element
It's recommended that you provide the
guid, and if possible make it a
permalink. This enables aggregators to
not repeat items, even if there have
been editing changes.
A frequently asked question about
s is how do they compare to
s. Aren't they the same thing?
Yes, in some content systems, and no
in others. In some systems, is
a permalink to a weblog item. However,
in other systems, each is a
synopsis of a longer article,
points to the article, and is
the permalink to the weblog entry.
So in your case adding the following to each of your items will fix it
<guid isPermaLink="false">LINKTOSOFTWARE</guid>
Replace LINKTOSOFTWARE with the links in your <link></link> tags.
I corrected your mistakes and your feed validates fine. You just need to fix these errors.
You can follow this tutorial on how to add RSS feeds to your pages : https://developer.mozilla.org/en/RSS/Getting_Started/Syndicating
It's as simple as adding an HTML tag into your page.

Resources