[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [syndication] Re: Proper use of DOCTYPE?



In article <a7gpka+cq2d@eGroups.com>, wkearney99 <wkearney99@hotmail.com>
writes
>What's the "right" way to do this?

Whatever displays in IE5 or IE6 without throwing an error?

I've been doing this.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE rss [
<!ENTITY % HTMLlat1 PUBLIC
    "-//W3C//ENTITIES Latin 1 for XHTML//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent";  %HTMLlat1; ]>

Mainly because the w3.org file seems less likely to disappear than the
netscape dtd. But we did have a day or two when the w3.org file disappeared
as well and validating parsers threw up at our feed. Maybe we should take a
copy and host it in the same place as the feed.

If you're working in PHP, one thing to look out for is that the
htmlentities() function[1] uses the HTML 4.0 list not the xml entities list.
So &apos; doesn't get converted correctly.

[1]Or converting back with 
strtr($description, array_flip(get_html_translation_table(HTML_ENTITIES)))

-- 
Julian Bond    email: julian_bond@voidstar.com
CV/Resume:         http://www.voidstar.com/cv/
WebLog:               http://www.voidstar.com/
M: +44 (0)77 5907 2173  T: +44 (0)192 0412 433
ICQ:33679568 tag:So many words, so little time