masarin

Topic: Use Tripoli with XHTML 1.0 Strict

Can I use Tripoli with XHTML 1.0 Strict, or is it just for HTML 4

David

Re: Use Tripoli with XHTML 1.0 Strict

Hi masarin,

Tripoli can be used in any version of HTML / XHTML (even 3.2). But I always recommend HTML 4 strict when coding web sites for various reasons. The only thing that might be an issue is that tripoli requires a legend in each fieldset, just like the HTML 4 specifications tell you. But XHTML is moore loose and does not require a legend. So, by using XHTML you might skip the legend and still produce valid pages, though tripoli could render your form differently in IE vs. standard browsers.

neondragon

Re: Use Tripoli with XHTML 1.0 Strict

I've tried using Tripoli with XHTML 1.0 Strict, and the results were fine. I didn't get any problems with fieldset/legend (used them both big_smile), and, as far as I can tell, the only problem is if the designer guy is lazy enough to put both these tags on page.

David, how come you are using HTML 4? I don't want to defend XHTML, but this looks very strange (not many people use HTML 4 nowadays).

David

Re: Use Tripoli with XHTML 1.0 Strict

how come you are using HTML 4?

Mainly because serving XHTML requires the MIME type application/xhtml+xml. And serving that to IE will set the browser in quirks mode. On the other hand, serving XHTML as text/html will simply produce broken HTML. Quirks mode is no good, tables will not inherit body font sizes, paddings/margins are calculated differently etc.

HTML 4 strict is a good standard and I never understood the benefits of mixing XML with HTML. I believe w3 is discontinuing the XHTML path and instead focusing on HTML 5.

http://www.w3.org/International/article … ew.en.html

quantumgood

Re: Use Tripoli with XHTML 1.0 Strict

I have heard that the specification of any XML MIME type, including application/xhtml+xml, automatically triggers standards mode; any known XHTML DOCTYPE sets IE6/Win, IE5/Mac and NS6.x to standards/strict.
http://reference.sitepoint.com/css/doctypesniffing

Is this incorrect, or am I overlooking something?

The direction of w3 seems to be to adapt to tag soup by "Creat(ing) independent but related languages for different audiences."
http://www.w3.org/2007/03/vision

David

Re: Use Tripoli with XHTML 1.0 Strict

Hi quantumgood

application/xhtml+xml automatically triggers standards mode

That is true for standard browsers (FF/Opera/Safari). IE will simply ask you to save the file (including IE8). In addition, if a doctype that triggers strict mode is preceded by an xml prolog, IE6 will go into quirks mode anyway.

any known XHTML DOCTYPE sets IE6/Win, IE5/Mac and NS6.x to standards/strict.

Not quite, any valid DOCTYPE sets user agents into standards mode, including HTML and XHTML. A valid doctype includes a full URI (Start, Public identifier & System identifier)

neondragon

Re: Use Tripoli with XHTML 1.0 Strict

i have found a solution to this problem. okay, it is based in microsoft asp technology, but it represents a good example of how we can achieve valid rendering for all browsers.

Code:

' this is for browsers
if instr(1, request.servervariables("HTTP_ACCEPT").item, "application/xhtml+xml") > 0 then
    response.contenttype = "application/xhtml+xml"
else
    response.contenttype = "text/html"
end if

' this on for w3c validator too
if instr(1, request.servervariables("HTTP_USER_AGENT").item, "W3C_Validator") > 0 then
    response.contenttype = "application/xhtml+xml"
else
    response.contenttype = "text/html"
end if

comments?