Use CDATA in XML Feeds (was: Malformed XML Feeds)

CodeMonkeyX - October 2, 2003 - 19:36
Project:Drupal
Version:7.x-dev
Component:base system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

http://drupal.org/node/feed

Description:
The feed has html elements in the description field for each node. This is not allowed, all blocks of html codes should be contained within a CDATA tag.

You can read more at this site, http://webservices.xml.com/pub/a/ws/2002/11/19/rssfeedquality.html.

#1

Anonymous - December 28, 2003 - 15:29

In Drupal 4.1.0 the workaround for this issue is editing /usr/share/drupal/include/common.inc and remove all html_entities() in format_rss_item() and format_rss_channel. You can't remove algo strip_tags() because the XML generated won't be valid. I don't know if this issue has been already fixed in Drupal 4.3.0 as I'm waiting for the Debian maintainer to upload the new package. I'll try then.

#2

Steven - December 30, 2003 - 15:20

The problem is not malformed XML as far as I can see: all entitities relevant to XML are escaped (as < > ...). HTML entities are doubley escaped (< into <). Drupal outputs correct XML.

It's a question of RSS quality and the general recommendation for using CDATA though: it offers advantages in terms of filesize.

#3

killes@www.drop.org - March 9, 2004 - 18:10
Title:Malformed XML Feeds» Use CDATA in XML Feeds (was: Malformed XML Feeds)
Category:bug report» feature request

Steven says this isn't a bug. Changing title.

#4

drumm - March 11, 2004 - 00:31

If this problem is what I think it is then you might want to look at the fixentities filter module I made. It replaces un-entity-coded less than signs and ampersands with the proper codes if they are not part of tags or entity codes. This fixes some validity issues with invalid user input in both the feed and xhtml view.

#5

el777 - December 3, 2005 - 09:04

CDATA helps us to save a space and get document more readable. But I see here one pitfall. What if our feed contains substring ]]> in it? So feeb become broken?

#6

LAsan - April 1, 2008 - 08:26
Version:» 7.x-dev

Is this a feature request?

Still applies to current version?

 
 

Drupal is a registered trademark of Dries Buytaert.