Loading...
 
Development

Development


XHTML and MIME type sent by server.

posts: 4 United States

I just learned that as we like to use XHTML or XML for our sites to adopt the predicesor of HTML in continuing advancement, that most sites are not sending XHTML in the way which Mozilla expects to see it.

The server should send application/xhtml+xml as a MIME type along with the document being a well formed XML/XHTML document. If this is not done then Mozilla will render the pages in quirk mode and not in true XML.

I would hate to reinvent the discussions so here is some material to be cited.

A document that describes XHTML being sent as MIME type text/html

http://xxx.xml.com/pub/a/2003/03/19/dive-into-xml.htmlAnother document describing using XML and how to use server functions to fix the issues being brough up

I hope Tiki can benifit from this posting to output a true standards conformed XML/XHTML document.

Love,
Chris

posts: 2881 United Kingdom

Ah,

Great information, maybe this will also help with the LeftColBug issue?

Damian


posts: 4 United States

Here is how I think implementing the correct MIME type for browsers that can handle it. The reference is at
A link to XML.com that descripted the rewrite rule that could be used for different programs

RewriteEngine on

RewriteBase /
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1

RewriteRule .* - T=application/xhtml+xml




I am not a rewirte expert but a comment in the referenced document stated to hammer this in somewhere.... I should know where to put it but I'm not there yet.

RewriteCond %{REQUEST_URI} \.xhtml$



biggrin
Also php could be the rewriter although I wonder if the overhead of apache server for a rewrite directive is less than that of global PHP include.
Probably so if it's limited to just the dirctory/virtualomain that holds tiki, BUT can that information be stored with a session cookie.

arrow
I haven't gottin this far into tiki but if the databse is to store information on a user as they vist it could also store the MIME type of the current session.
Can it work this way???

Page request>What type of MIMIE can you take?>Drop session cookie -->display page in acceptable MIME type

Susequent requests->Request session cookie->>Diplay page page using MIME type acceptable for browser


further interaction of MIME type then known via cookie database refernece . Could also state this "MIME sniffing funciton" to be run once at the top of the process tree, a part of getting intial information on clients program abilities and cooking dropping. I think the tiki session cookie comes before the page display. Why not put some login in before dropping a cookie?

Again I have not picked a part tiki yet nor have the expertise in php programming... yet. I dropped this thought for I know asking a user to add stuff to apache is more than what might be expected (permissions?) for a great product that is so flexible.

Chris


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting