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
not work
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,
my
main www.rentamonkey.com site does it) to serve XHTML 1.1 to browsers
that
will accept it properly, but change it to XHTML 1.0 as text/html for
those
that won’t. I’m not sure it’s an ideal solution, or even worth it, but
I
wanted to try it out somewhere so that was as good a place as any to do
it.
I haven’t figured out content negotiation in Rails yet (not that I’ve
tried),
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
stuff.
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
stuff,
rather than application/xhtml+xml, although then I guess you’d still
need
content negotiation, or you could send it all as text/xml (saw your
other
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
text/html,
and using regular XHTML embedded stylesheet stuff rather than
xml-stylesheet
directives.
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,
check
here: http://www.rafb.net/paste/results/cyGrz844.html
That’s the code from www.rentamonkey.com. I reckon it would actually be
quite
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
not
sure there’s actually any point in doing that, other than for
I’m-bleeding-edge-nyah-nyah-ness.
Thanks for the suggestion, though, it’s gotten me one step further
along.
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
stylesheet
stuff in them. Kinda gets you the best of all worlds, currently, in a
way
that will work with all browsers.
~Dave
–
Dave S.
Rent-A-Monkey Website Development
Web: http://www.rentamonkey.com/