On May 27, 12:29 pm, Thomas 'PointedEars' Lahn wrote:
Quote:
Henry wrote:
Quote:
>On May 27, 11:10 am, Janwillem Borleffs wrote:
Quote:
>>rfr schreef:
>>>I would like to be able to use a doctype so that my pages
>>>validate. This helps me feel sure that they are cross-browser
>>>as much as I can do.
>
Quote:
Quote:
>>>Has anyone else run up against this conflict with JS scripts
>>>and use of doctype and have a solution or workaround?
>>Simply enclose your inline scripts with the following:
>
Quote:
Quote:
>>// <![CDATA[
>> ... your script ...
>>// ]]>
>
Quote:
>Isn't that particular incantation only relevant for HTML pages that
>wish to fool a mark-up validator into thinking that they are XHTML,
>
Not at all. It is relevant for all HTML 4.01 documents that don't
follow the recommendation in the HTML 4.01 Specification,
Appendix B, section 3.5 and following:
>
http://www.w3.org/TR/REC-html40/appe...s.html#h-B.3.3 What specific point are you trying to make here?
Quote:
Quote:
>or for Appendix C XHTML pages that are served as both HTML
>and XHTML
>
It is relevant for all XHTML documents that follow the
recommendations in the XHTML 1.0 Specification, section 4.8, but
don't follow the last mentioned alternative there:
>
http://www.w3.org/TR/2000/REC-xhtml1-20000126/#diffs No, that is the CDATA section mark-up without the javascript end-of-
line comments. It is the end of line comments that make it clear that
this 'mark-up' is intended for use with HTML, where the CDATA section
mark-up would otherwise be interpreted as javascript syntax errors.
Quote:
Quote:
>following content negotiation
>
Content negotiation is not necessarily involved here.
What is the alternative? Randomly serving pages as HTML sometimes, and
as XHTML at other times?
Quote:
Quote:
>(something that almost never happens in reality
>
Yet it does happen.
It does happen, but not that often, and vary rarely when the pages are
scripted (which is quite an important detail where this group is
concerned).
Quote:
Quote:
>and complicates scripting to such a degree that even the
>W3C abandon content negotiation and serve pages only as
>HTML when they script those pages)?
>
Could you please provide some proof to back up these statements?
<snip>
When IE (which does not understand XHTML at all) requests <URL:
http://www.w3.org/ the content type of the response is:-
Content-Type: text/html; charset=utf-8
- so the page is served as HTML (and so will be interpreted by IE as
HTML)
When Firefox request the same page the content type of the response
is:-
Content-Type: application/xhtml+xml; charset=utf-8
- the page is served as XHTML. The mark-up received is identical
(approximately Appendix C XHTML). This is the case for the vast
majority of W3C pages.
Yet when it comes to <URL:
http://validator.w3.org/ the mark-up is
still Appendix C XHTML but both IE and Firefox receive the content
type:-
Content-Type: text/html; charset=utf-8
- in the response, and so they both interpret that page as error
filled tag soup HTML. The only reasonable justification for that
difference is that the validator page is scripted in a way that will
break in the event that the mark-up ever be interpreted as XHTML by a
browser (because the script cannot cope with the differences between
an HTML DOM and an XHTML DOM).
In the end it seems that the effort necessary to write cross-DOM
scripts exceeds the value of the principle that XHTML should be served
to user agents that recognise it even for the organisation best
motivated to promote the use of XHTML.