a way that helper functions not produce XHTML but HTML?

Absolutely -- validation is an essential web developer troubleshooting tool. So make it all valid XHTML and be happy, regardless of whether you're ultimately serving it as text/html or application/xhtml+xml :slight_smile:

That's exactly why I'm saying not to waste your time...Rails lays it down in XHTML syntax so if he changed the doctype from XHTML specific, then his validation won't work. Hence, don't waste your time changing it if you're not worried about validation.

Lee Smith wrote:

Trying to change the way Rails lays down a stylesheet include is really a waste of time.

Completely wrong.

This HTML vs XHTML syntax only matters if you're validating...

And you should always be validating, because you should always produce valid markup, because that's the *only* way to be sure that the browser will interpret it correctly.

otherwise, the browser renders it as HTML.

Don't waste your time and definitely update your browser.

Huh?

Best,

hm... you know what, my coworker had this one line:

<div style="clear:both" />

and the page would still validate perfectly as XHTML, but IE will render it differently from FF.

FF will take it as a closing div. IE will not take it as a closing div.

so I will have perfectly validated code that behaves differently on two popular browsers.

and i can communicate to all my coworkers. but it is hard if the code is already 2000 files and was written for the past 2 years and many coworkers were even gone at other companies. i still need to deal with all the existing code.

Hassan Schroeder wrote: [...]

So make it all valid XHTML and be happy, regardless of whether you're ultimately serving it as text/html or application/xhtml+xml :slight_smile:

Not quite. Validate to a DOCTYPE that matches the MIME type that the browser will use to parse the document -- that is, validate to XHTML if you will serve as application/xhtml+xml, or as HTML if you'll serve as text/html. Rails unfortunately generates XHTML and serves as text/html, which seems to be kind of the worst of both worlds, since it yields inconsistent results.

-- Hassan Schroeder

Best,