Feed Your Feed!

 

encoding

Page history last edited by Jewel Makda 1 yr ago

Encoding is used to escape blocks of text containing characters which would otherwise be recognized as markup.  You can encode using the hexidecimal character representation or using CDATA (a feature of xml version 1.0).  Below are some examples:

 


Encoding HTML Tags:

<description>this is &lt;b&gt;bold&lt;/b&gt;</description>

Result: this is bold


Encoding HTML within a CDATA Section:

<description><![CDATA[this is <b>bold</b>]]></description>

Result: this is bold


Encoding angle brackets in text:

<description>5 &amp;lt; 8, ticker symbol&amp;lt;RSS&amp;gt;</description>

Result: 5 < 8, ticker symbol <RSS> 
 


Encoding angle brackets in text within a CDATA section:

<description><![CDATA[5 &lt; 8, ticker symbol &lt;RSS&gt;]]></description>

Result: 5 < 8, ticker symbol <RSS>

 

 

Encoding

Presentation

<title>AT&#x26;T</title>

AT&T

<title>Bill &#x26; Ted's Excellent Adventure</title>

Bill & Ted's Excellent Adventure

<title>The &#x26;amp; entity</title>

The &amp; entity

<title>I &#x3C;3 RSS</title>

I <3 RSS

<title>A &#x3C; B</title>

A < B

<title>A&#x3C;B</title>

A<B

<title>Nice &#x3C;gorilla&#x3E; what's he weigh?</title>

Nice <gorilla>, what's he weigh?

 

Comments (0)

You don't have permission to comment on this page.