PDA

View Full Version : How to serve XHTML as application/xhtml+xml


BroChris
11-19-2003, 09:39 PM
I can't seem to get it to work. Here are my files:

template.xml (http://www.designsbychris.com/temp/template.xml)
template.xhtml (http://www.designsbychris.com/temp/template.xhtml)
template.html (http://www.designsbychris.com/temp/template.html)

The following is what is in my .htaccess file:
AddType application/xhtml+xml xhtml html
What am I doing wrong?

liorean
11-19-2003, 10:13 PM
Please don't reply to stickies if you haven't got anything to say that might benefit the general public. This question should have been a thread on it's own. (And Alex probably will make it so...) [:edit:]Which he evidently did

As for your question:http://www.designsbychris.com/temp/template.xhtml

GET /temp/template.xhtml HTTP/1.1
Host: www.designsbychris.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-gb,en;q=0.7,en-us;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://codingforums.com/showthread.php?s=&threadid=19775

HTTP/1.1 200 OK
Date: Wed, 19 Nov 2003 21:01:58 GMT
Server: Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.2 PHP/4.3.3 FrontPage/5.0.2.2634 mod_ssl/2.8.16 OpenSSL/0.9.6b
Last-Modified: Wed, 19 Nov 2003 20:30:10 GMT
Etag: "2fc30d-22a-3fbbd2d2"
Accept-Ranges: bytes
Content-Length: 554
Keep-Alive: timeout=10, max=98
Connection: Keep-Alive
Content-Type: application/xhtml+xmlSo, to me it seems to work pretty fine.

However, first of all, your code is invalid. <http://validator.w3.org/check?verbose=1&uri=http%3A//www.designsbychris.com/temp/template.xhtml>

Secondly, XML data islands are iew proprietary, and iew doesn't support the 'application/xhtml+html' content type. (Nor does it have very good XML support as well, unless you have downloaded MSXML 4.) Moz has other ways to do the equivalent of XML data islands, and if you go that way, why don't you write the entire XML data island using scripting instead? That way it would be valid, too.