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 2.0 XML Schema at codeplex.com
2017-11-05, ∼3278🔥, 0💬
Popular Posts:
Why am I getting this "Docker failed to initialize" error? After installing the latest version of Do...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...
How to convert JSON Objects to PHP Associative Arrays using the json_decode() function? Actually, JS...
What Is session_register() in PHP? session_register() is old function that registers global variable...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...