Click to See Complete Forum and Search --> : Idea for application/xhtml+xml in IE


Mr Initial Man
06-15-2007, 10:20 PM
I've been pondering putting an XHTML file up on the internet for me and a friend to read. Unfortunately, she only uses I.E, so the XHTML file ain't gonna work. What I've been pondering is this:

Use .htaccess to check for I.E. If it's not I.E., send an .sxhtml file as application/xhtml+xml (it's server-parsed, which explains the .sxhtml file extension). If it IS I.E., send the .sxhtml file as text/xml and use SSI to link it to an xsl style sheet. What do you all think?

Stephen Philbin
06-16-2007, 07:53 AM
There's already XSL stylesheets in the XHTML DTDs. That's how the UA's know how to render the markup (or at least that's how it's supposed to happen anyway). All I remember from my last attempt to serve XHTML to IE was that it seemed to ignore the XSL. Can't remember what it was I was trying at the time, but I just thought you might find that bit of info handy at some point.

Good luck!

Mr Initial Man
06-16-2007, 11:01 AM
Was that because IE was reading it as application/xhtml+xml? I was thinking of fiddling with the .htaccess file so it said "If it's read by IE, send it as text/xml instead of application xhtml+xml". I know, I have a really screwball mind.

Mr Initial Man
06-16-2007, 12:18 PM
Reason I came up with this idea is I know IE won't read xhtml, so I figured I'd try to get it to treat it as xml.

felgall
06-16-2007, 05:58 PM
Treat it as XML in ALL browsers and then you wont need to test if the browser is IE.

Mr Initial Man
06-16-2007, 10:29 PM
Oh,but what's the fun in that?

Stephen Philbin
06-17-2007, 03:17 PM
I found the oddity because I was building a thing for my site (http://www.stephenphilbin.com/) which is based on content negotiation and offering alternate media types (check the top of the screen in something other than IE). I don't have time to go into detail but I'll explain more tomorrow.

Mr Initial Man
06-19-2007, 12:57 AM
*Waits for explanation*

Stephen Philbin
06-19-2007, 11:09 AM
Ah. Sorry about the wait. I was in a massive rush when I made that last post and haven't had a chance to get back since.

Ok. The ignoring XSL thing came up because I was trying to figure out what to give to IE and what to do about the strange non-validating XHTML 1.1 DTD (incidentally, as far as I know, the 1.1 DTD is valid. It's just that it seems like nothing in the known universe will declare it as valid for one reason or another). So, whilst making the change to make the default vocab for my site XHTML 1.0, I decided to see how IE handled XHTML 1.0 when served as various content types. I forget the exact results, but I think it was

application/xhtml+xml = Death

application/xml = Treat as XML but XSL declarations in the DTD completely ignored.

text/xml = Treat as XML but XSL declarations in the DTD completely ignored.

text/html = (Output is actual HTML 4.01 so...) Treat as text/html without syntax errors.

and here's a forkin' weird one...

text/plain = Oddly enough, treat as XML but XSL declarations in the DTD completely ignored.


I never did find a way to get IE to apply the XSL in the XHTML DTD.