Topic: text/xml is deprecated
I noticed 'text/xml' is being used on the output_xml function in 'extern.php'.
Wikipedia says 'application/xml' is the way to go...
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 discussion → text/xml is deprecated
I noticed 'text/xml' is being used on the output_xml function in 'extern.php'.
Wikipedia says 'application/xml' is the way to go...
Well... Please, try to fix, test and commit to SVN
Ok, cool!
One point to note, however, is that if you change the type to application/xml, and no programme is set to handle that mimetype, it will just prompt the user to save the file or select a programme with which to view it. Text/xml will at least display the content within the browser if no feed reader or such like is registered for that protocol. It's horses for courses.
As far as I know, the proper solution to handle this is to check whether or not the browser supports application/xhtml, then set the page type consequently. The resulting page may still fail at some validators, but the fault will be on the validator's side, because it doesn't send out a proper list of its supported page types.
I have this on my site, I just can't access the FTP from work. Will check later if still needed.
Re-edit: I think sending out the page as application/xhtml should be toggleable by the board administrator. Because in some browsers (Firefox, anyone? ), when an application/xhtml page contains a single error, it won't be displayed at all. Great for debugging, not cool for publishing
As far as I know, the proper solution to handle this is to check whether or not the browser supports application/xhtml, then set the page type consequently. The resulting page may still fail at some validators, but the fault will be on the validator's side, because it doesn't send out a proper list of its supported page types.
That is the preferable way to do it.
Re-edit: I think sending out the page as application/xhtml should be toggleable by the board administrator. Because in some browsers (Firefox, anyone? ), when an application/xhtml page contains a single error, it won't be displayed at all. Great for debugging, not cool for publishing Last edited by patheticcockroach (Today 09:24:09)
The mimetype, application/xml, would only be applied for the RSS/Atom feeds. Besides, if 1.3 truly is XHTML compliant, then that shouldn't be a problem in any area of the forum.
Besides, if 1.3 truly is XHTML compliant, then that shouldn't be a problem in any area of the forum.
Actually, I was rather thinking about the possibility of broken extensions.
MattF wrote:Besides, if 1.3 truly is XHTML compliant, then that shouldn't be a problem in any area of the forum.
Actually, I was rather thinking about the possibility of broken extensions.
True. I was forgetting about that potential problem area.
So... RSS and Atom - application/xml and XML - text/xml? I'll commit the changes to SVN depending on your answers
Actually, for Atom I think it should be application/atom+xml
And for RSS probably application/rss+xml
I personally use the specific type for each one, i.e: application/atom+xml & application/rss+xml, as mentioned above. Unless the client doesn't list application/xml as one of its accepted types, in which case text/xml is used.
Do you approve this code?
if(empty($_SERVER['HTTP_ACCEPT']) || !in_array('application/xml', explode(',', $_SERVER['HTTP_ACCEPT']))
//No HTTP_ACCEPT header or no application/xml support, use text/xml
else
//We can use application/xml
About application/rss+xml: http://duncanmackenzie.net/blog/applica … fault.aspx
I know the article is really old, but Wikipedia still shows "(Registration Being Prepared)" for the MIME type.
I use something similar to the following code.
$accept_tag = isset($_SERVER['HTTP_ACCEPT']) ? strtolower($_SERVER['HTTP_ACCEPT']) : '';
if (isset($accept_tag) && strpos($accept_tag, 'application/xml') !== false)
{
[ code ]
}
The strtolower is used over stripos due to the latter only being available in PHP5 upwards. If you use your code above, (which appears fine too), I would add a strtolower on the tag before exploding it.
I know the article is really old, but Wikipedia still shows "(Registration Being Prepared)" for the MIME type.
It's in the RFC's. I always use those for basing a decision on.
How could the script know if the client accepts application/rss+xml (or atom, etc)?
If the client accepts application/xml, then it should be XML aware, meaning that it should be able to handle all derivatives. If not, you can easily set the client to palm the unknown mimetype off to an externall application. I.E, as always, is an absolute waste of space in this regard.
PunBB Forums → PunBB 1.3 discussion → text/xml is deprecated
Powered by PunBB, supported by Informer Technologies, Inc.