Page 1 of 2

Strict vs Transitional

Posted: Sun Apr 22, 2007 12:53 am
by Nullig
Is there a reason why CMSMS is set up to produce XHTML 1.0 Transitional doctypes as opposed to XHTML 1.0 Strict doctypes?
Are there some elements of CMSMS that won't work properly within the Strict doctype?

Thanks,
Nullig

Re: Strict vs Transitional

Posted: Sun Apr 22, 2007 10:36 am
by Vin
Sure, there are some elements/attributes which W3C Validator doesn't like in Strict... e.g. attribute target - there is no such an attribute in Strict DTD. (Funny, it's included in XHTML 2.0 - http://www.w3.org/TR/xhtml2/mod-hyperAt ... tes_target)

Re: Strict vs Transitional

Posted: Mon Apr 23, 2007 2:32 pm
by Pierre M.
Thank you for this information.
But is there something else than the "target" attribute ? I'm asking because I feel it is not used and we could have strict rather than transitional, couldn't we ?
Pierre M.

Re: Strict vs Transitional

Posted: Mon Apr 23, 2007 4:17 pm
by stopsatgreen
Why can't we have the option to choose different Doctypes? As XHTML1.1 isn't parsed correctly by Internet Explorer, XHTML2 is incompatible with earlier versions, and the W3C have reformed the HTML Working Group to look into HTML5, there are a lot of people - myself included - who want to have the option to code to an HTML4 Doctype (Strict, of course) if we wish. Those who want to code in XHTML1.1 Strict (despite it having no advantage over HTML4 Strict) should have that option also.

See here for why XHTML isn't all it's cracked up to be: http://www.webdevout.net/articles/beware-of-xhtml

Re: Strict vs Transitional

Posted: Mon Apr 23, 2007 4:21 pm
by savagekabbage
Why not just define whatever doctype you want to use in your template?

Re: Strict vs Transitional

Posted: Mon Apr 23, 2007 4:56 pm
by Pierre M.
Yes, I use XHTML 1.1 strict in my templates.
And the power of CMSms is one can do HTML4 in another template.
Pierre M.

Re: Strict vs Transitional

Posted: Mon Apr 23, 2007 7:51 pm
by Vin
stopsatgreen wrote: See here for why XHTML isn't all it's cracked up to be: http://www.webdevout.net/articles/beware-of-xhtml
Ahh, WebDevout... must have omitted this article.
Yes, in fact XHTML doesn't give any benefit to me - except those nice slashes at the end of tags like
, which are more readable to me ;). But it can have a sense for internal purposes.
One thing in WebDevout -
Internet Explorer does not support XHTML. Like other web browsers, when a document is sent as text/html, it treats the document as if it was a poorly constructed HTML document. However, when the document is sent as application/xhtml+xml, Internet Explorer won't recognize it as a webpage; instead, it will simply present the user with a download dialog. This issue still exists in Internet Explorer 7.
This is not entirely true - see this link http://webylon.info/K.32
(sorry this is Czech, but I'm too lazy to find an English equivalent ;))
BTW - those HTML5 drafts look very interesting... :)

Re: Strict vs Transitional

Posted: Tue Apr 24, 2007 12:02 am
by kermit
Nullig wrote: Is there a reason why CMSMS is set up to produce XHTML 1.0 Transitional doctypes as opposed to XHTML 1.0 Strict doctypes?
Are there some elements of CMSMS that won't work properly within the Strict doctype?
it doesn't matter what doctype a web site uses so long as the markup is well-formed and valid. many people mistakenly associate html with ugly tables layouts filled with formatting tags and xhtml with table-free css-driven layouts. it doesn't matter -- you can just as easily create a clean, valid, table-free layout in html as you can with xhtml.

writing valid code is important; striving for a particular doctype just for the sake of saying you're using the so-called 'latest and greatest' is pointless.

cmsms code happens to target xhtml 1.0 transitional, so just use it vs anything else. there is NO actual benefit (with cmsms) to choosing xhtml 1.0 or 1.1 strict instead of xhtml 1.0 transitional. choosing an xhtml strict or an html doctype will just present more problems to fix in order to validate to the different standard.

if you choose an xhtml strict doctype (particularly 1.1), you also need to address the mimetype the documents are being served as, since they aren't supposed to be served as text/html. some browsers choke on application/xhtml+xml... xhtml 1.0 transitional served as text/html might be the most 'compatible' choice, without rewriting cmsms code to meet the (older but still valid and useable) html 4.01 standard instead, or using a solution like http://www.workingwith.me.uk/articles/s ... /mimetypes to change mimetype & doctype to match a browser's compatibility.

Re: Strict vs Transitional

Posted: Tue Apr 24, 2007 12:07 pm
by stopsatgreen
Why not just define whatever doctype you want to use in your template?
The tags are output by default with the trailing slash at the end, which isn't valid HTML4.01; I know it's not the end of the world, but it would be nice to have the output depending on your doctype.

Re: Strict vs Transitional

Posted: Tue Apr 24, 2007 3:36 pm
by Pierre M.
Thank you kermit for your explaination of the "most compatible choice".
Pierre M.

Re: Strict vs Transitional

Posted: Tue Apr 24, 2007 7:33 pm
by skypanther
kermit wrote: it doesn't matter what doctype a web site uses so long as the markup is well-formed and valid.
Which doctype you use controls how the page is rendered in often weird ways. Most browsers maintain old bugs and non-standard behavior with transitional doctypes (e.g. "quirks mode") and more closely implement the specs with strict types. Netscape did this, I'm not sure if Mozilla preserved it, and I don't care know about IE.

On rare occasions, I've had luck in getting CSS to work across browsers as I expected by changing the doctype to strict. But, in most every other case, kermit is right that as long as your code is clean, well-formed, and valid, the doctype you choose isn't critical.

Tim

Re: Strict vs Transitional

Posted: Tue Apr 24, 2007 7:49 pm
by Vin
Yeah, doctypes. Changing the box model via doctype is really "witty". Why on Earth has it to be done? Separation of layout from content is now harder. Why, why, why. Why an incompatible standard. I don't get it.

Re: Strict vs Transitional

Posted: Mon Apr 30, 2007 8:05 pm
by brady
stopsatgreen wrote: The tags are output by default with the trailing slash at the end, which isn't valid HTML4.01; I know it's not the end of the world, but it would be nice to have the output depending on your doctype.

Code: Select all

global $html;
$html =  str_replace(' />','>',$params['content']);
Drop that code in a user defined tag named something like html4. Then go into the Events menu, select the one called "ContentPostRender". And from the dropdown box, select html4 and click add. Very hackish, but it works.

Re: Strict vs Transitional

Posted: Tue May 01, 2007 1:55 pm
by stopsatgreen
Thanks for that, although my point was that it would be better to have the option within the CMS rather than having to hack it to change a DOCTYPE.

Re: Strict vs Transitional

Posted: Tue May 01, 2007 11:51 pm
by brady
I agree, it would be useful for some people(like me) to have a doctype option. But I personally think it is more important for the dev team to focus on general solutions to many different kinds of problems. Take the events system for example. Because they spent the time to implement that, I could fix my xHTML woes, and many other things very quickly. Or they could have spent the time to include hundreds of little options for every possible site configuration. I know which I prefer!