Richard Heyes wrote:
header('Content-Type: text/xml');
You actually mean application/xml not text/xml
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.
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/
And its alot better to use DOMDocument in PHP5 for XML Creation rather
than hardcode everything.
DOMDocument would be overkill.
yup
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php