On Wednesday 28 Dec 2005 19:31, Kirk Bocek wrote:
Well, this does seem to cause both browsers to act differently. Both
seem to ignore <?xml-stylesheet …> They seem to read <LINK …> but do
strange things. Maybe only embedded styles will work?
Yes, I believe so - it’s IE that’s the problem.
The trouble is, what works for Firefox and other modern browsers will
for IE. So essentially, you need to use content negotiation to give the
browser what it prefers. I’ve done this in PHP a few times (actually,
main www.rentamonkey.com site does it) to serve XHTML 1.1 to browsers
will accept it properly, but change it to XHTML 1.0 as text/html for
that won’t. I’m not sure it’s an ideal solution, or even worth it, but
wanted to try it out somewhere so that was as good a place as any to do
I haven’t figured out content negotiation in Rails yet (not that I’ve
but for now am happy enough with XHTML 1.0 Strict served as text/html.
Whatever, you’re not going to be able to get this to work in IE using
xml-stylesheet directives, AFAIK, because IE sucks at this kind of
Sure, but if we’re writing an app for public consumption…
I know, it was a joke… didn’t you see the smiley?
In web developer utopia, there would be no Internet Expletive!
Yep, it was partially working before I made your Content-Type change. If
I can figure out how to set the page title and get paragraph breaks, it
would work fine.
No idea, but I guess you need to check out how IE handles pure XML
rather than application/xhtml+xml, although then I guess you’d still
content negotiation, or you could send it all as text/xml (saw your
email, my bad, I didn’t check it before, just assumed .rxml sent as
application/xml) but that might have weird results.
Ultimately, I think you can do what you want to do by sending it as
and using regular XHTML embedded stylesheet stuff rather than
Or figure out content negotiation in Rails, then set the page up as
appropriate. Incidentally, if you’d like to see how I did it in PHP,
That’s the code from www.rentamonkey.com. I reckon it would actually be
easy (and undoubtedly neater - PHP kinda grosses me out these days!) to
convert that to Rails, so feel free to if you like ALTHOUGH I’m still
sure there’s actually any point in doing that, other than for
Thanks for the suggestion, though, it’s gotten me one step further
No worries, will be interested to see if you get it working!
Easiest method, I reckon, is just to send it as text/html from your
controllers, using .rxml views, and putting standard HTML embedded
stuff in them. Kinda gets you the best of all worlds, currently, in a
that will work with all browsers.
Rent-A-Monkey Website Development