Internet technology hosted by Berkman Center

Encoding & item-level descriptions

Thursday, June 3, 2004

These are examples of item-level descriptions, illustrating how encoding works with and without the use of CDATA (a feature of XML 1.0).

Each example consists of two lines, the first is an example description element, the second line is what the reader will see when viewing the description in a RSS 2.0-compatible aggregator.

The examples were provided by Nick Bradbury of Bradbury Software.

Example 1: Encoding HTML Tags

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

this is bold

Example 2: Encoding HTML within a CDATA Section

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

this is bold

Example 3: Encoding angle brackets in text

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

5 < 8, ticker symbol <BIGCO>

Example 4: Encoding angle brackets in text within a CDATA section

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

5 < 8, ticker symbol <BIGCO>



Creative Commons LicenseUnless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution/Share Alike Creative Commons license, with the exception that no rights are granted -- since they are not ours to grant -- in any logo, graphic design, trademarks or trade names, including the Harvard name. Last update: 4/14/07; 2:41:19 PM.

RSS 2.0 Spec

Site Outline

About this Site

AltStyle によって変換されたページ (->オリジナル) /