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...

Re: text/xml is deprecated

Well... Please, try to fix, test and commit to SVN smile

Re: text/xml is deprecated

big_smile Ok, cool!

4

Re: text/xml is deprecated

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.

5 (edited by patheticcockroach 2010-07-10 10:22)

Re: text/xml is deprecated

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? big_smile), when an application/xhtml page contains a single error, it won't be displayed at all. Great for debugging, not cool for publishing hmm

6

Re: text/xml is deprecated

patheticcockroach wrote:

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.


patheticcockroach wrote:

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. smile Besides, if 1.3 truly is XHTML compliant, then that shouldn't be a problem in any area of the forum.

Re: text/xml is deprecated

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. wink

8

Re: text/xml is deprecated

patheticcockroach wrote:
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. big_smile

9 (edited by User33 2008-12-31 14:18)

Re: text/xml is deprecated

So... RSS and Atom - application/xml and XML - text/xml? I'll commit the changes to SVN depending on your answers smile

10 (edited by patheticcockroach 2008-12-31 14:34)

Re: text/xml is deprecated

Actually, for Atom I think it should be application/atom+xml

And for RSS probably application/rss+xml

11 (edited by MattF 2008-12-31 14:40)

Re: text/xml is deprecated

I personally use the specific type for each one, i.e: application/atom+xml & application/rss+xml, as mentioned above. smile Unless the client doesn't list application/xml as one of its accepted types, in which case text/xml is used.

12

Re: text/xml is deprecated

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.

13 (edited by MattF 2008-12-31 17:30)

Re: text/xml is deprecated

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. smile

14

Re: text/xml is deprecated

Garciat wrote:

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. smile

15

Re: text/xml is deprecated

How could the script know if the client accepts application/rss+xml (or atom, etc)?

16

Re: text/xml is deprecated

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. smile I.E, as always, is an absolute waste of space in this regard. big_smile