Mike
Mike

Reputation:

DOCTYPE RSS & HTML entities

I have an "ldquo", "rdquo" and several other entities under my RSS feed. Seems like if I add

<!DOCTYPE rss [
  <!ENTITY % HTMLspec PUBLIC
  "-//W3C//ENTITIES Latin 1 for XHTML//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
  %HTMLspec; 

below the xml tag and above the rss tag then I'll be able to include those entities. I added but it doesn't seem to work. Does anyone knows what I missing? Thanks

Upvotes: 4

Views: 4605

Answers (3)

giacoder
giacoder

Reputation: 980

Strangely enough but in RSS instead of

&rsquo;

I used

&amp;rsquo;

and it worked in all browsers that I have (IE, Mozilla, Google Chrome)

Upvotes: 1

Kornel
Kornel

Reputation: 100080

Forget entities. Just use UTF-8 for all characters.

It will work reliably regardless whether RSS clients properly parse XML or not (sadly, the latter isn't uncommon).

Upvotes: 1

cowgod
cowgod

Reputation: 8656

it doesn't seem likely that many feed readers will know what to do with that. i would recommend sticking with numbered entity references. for example, change &ldquo; to &#8220;. you can get the full entity reference right here from w3c.

additionally, you can read this article and this one which gives some good tips on this topic.

Upvotes: 3

Related Questions