Tools, FAQ, Tutorials:
Protect XML Special Characters in RSS Feeds
How to protect XML Special Characters in RSS Feeds?
✍: FYIcenter.com
An RSS document is an XML document.
And there 3 primary XML special characters you need
to protect them, if you are using them in your RSS element contents:
If you are using XML special characters in the "channel/item/description" element, it may get interpreted as HTML tags by some RSS viewers. So you need to apply the HTML escape sequence on top of the XML escape sequence to protect them.
For example, look at how angle brackets are protected in the following RSS feed example, rss-angle-brackets.xml:
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>FYI Center <for> Software Developers</title> <link>http://dev.fyicenter.com/</link> <description>FYI (For Your Information) Center for Software Developers with large collection of FAQs, tutorials and tips.</description> <pubDate>Tue, 19 Sep 2017 04:05:38 +0200</pubDate> <image> <url>http://dev.fyicenter.com/_logo.png</url> <title>FYI Center for Software Developers</title> <link>http://dev.fyicenter.com/</link> </image> <atom:link href="http://dev.fyicenter.com/rss_xml.php" rel="self" type="application/rss+xml" /> <copyright>Copyright (c) FYIcenter.com</copyright> <item> <title>Visual Studio <2017> .NET Program Folders</title> <link>http://dev.fyicenter.com/1000510_Visual_Studio_2017_NET_Program_Folders.html</link> <description><img align='left' width='64' height='64' src='http://dev.fyicenter.com/Visual-Studio/_icon_Dot-NET.png' /> In which folders Visual Studio 2017 .NET programs are located on my Windows computer? Is 1 &lt; 2 or 2 < 1? - Rank: 110; Updated: 2017-09-19 02:44:09 -> <a href='http://dev.fyicenter.com/1000510_Visual_Studio_2017_NET_Program_ Folders.html'>Source</a></description> <pubDate>Tue, 19 Sep 2017 02:44:09 +0200</pubDate> <category>visualstudio</category> <guid>http://dev.fyicenter.com/1000510_Visual_Studio_2017_NET_Program_Folders.html</guid> <author>info@fyicenter.com (FYIcenter.com)</author> </item> </channel> </rss>
The picture below shows you how the above RSS feed is displayed in Internet Explorer:
If you want to view it in other RSS viewers, you can download it here.
Â
⇒⇒RSS FAQ and Tutorials
2017-11-05, 1605👍, 0💬
Popular Posts:
How to Build my "sleep" Docker image from the Alpine image? I want the container to sleep for 10 hou...
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...
How to write a policy to set and get custom variables? Here is a policy that sets and gets custom va...
How to Create a New Instance of a Class? There are two ways to create a new instance (object) of a c...
How to login to the Developer Portal internally by you as the publisher? Normally, the Developer Por...