Re: RSS feeder in PHP5?
| From: | Nathan Rixham | Date: | Mon, 12 Jan 2009 11:43:24 +0000 |
| Subject: | Re: RSS feeder in PHP5? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-286081@lists.php.net to get a copy of this message | ||
Richard Heyes wrote:
the new type was introduced as application/xml had some nuances with charector encoding definition and this is an integral part of an rss feed for it to be valid it's charset must match the content. http://www.rssboard.org/rss-mime-type-application.txt http://www.ietf.org/rfc/rfc3023.txt it's the same for xhtml pages: "This document summarizes the best current practice for using various Internet media types for serving various XHTML Family documents. In summary <http://www.w3.org/TR/xhtml-media-types/#summary>, 'application/xhtml+xml' *SHOULD* be used for XHTML Family documents, and the use of 'text/html' *SHOULD* be limited to HTML-compatible XHTML 1.0 documents. 'application/xml' and 'text/xml' *MAY* also be used, but whenever appropriate, 'application/xhtml+xml' *SHOULD* be used rather than those generic XML media types." http://www.w3.org/TR/xhtml-media-types/Well, no. I use text/xml and have done for nearly 5 years, and it works fine. it does, but in 2006 it was upgraded to application/rss+xml for all rss versions; all the major readers and browsers recognise this and it's the first choice for rss autodiscovery; second up is application/xml, and finally for backwards compatibility text/xml.header('Content-Type: text/xml');You actually mean application/xml not text/xml
DOMDocument would be overkill. yupAnd its alot better to use DOMDocument in PHP5 for XML Creation rather than hardcode everything.