Re: Does <script src=foo> require an end tag </script>
Nick Kew wrote:[color=blue]
> Michael Winter wrote:[color=green]
>> On 13/04/2006 13:04, Nick Kew wrote:[color=darkred]
>>> Michael Winter wrote:
>>>> I meant what I wrote. An XHTML document is also an XML
>>>> document, so using an XML processor is appropriate.
>>>
>>> Not when a document is served as text/html.[/color]
>>
>> Why would I serve a document as text/html and then expect
>> it to be parsed by an XML processor?[/color]
>
> /me suspects he's being trolled, but bites anyway[/color]
Don't suspect that, if you can't have a worthwhile reasoned debate with
Michael Winter you can't have one with anyone.
[color=blue]
> Because that's the situation that gives rise to this thread:
> the fact that <script ... /> served as text/html is parsed
> by browsers as <script ...>, not <script ...></script>.[/color]
The question that seems pivotal here is whether a document served as
text/html should be regarded as XHTML (or, under what circumstances a
document served as text/html may be regard as not being an HTML
document).
When Toby Inkster said "assuming XHTML" the determination of what
actually is XHTML became critical to determining the veracity of that
statement.
The nature of some documents can be unambiguously determined:-
A document wittier as XHTML, validated as XHTML (of some version),
served as content type application/xhtml+xml, interpreted by the
receiving browser as XHTML, and (if supported) having an XHTML DOM
created by the browser to be scripted for that document, is
unambiguously an XHTML document.
(Michael and I share a particular interest in DOM scripting, but as the
thread itself is centred around script elements that final (optional)
aspect of document interpretation seems to be particularly pertinent
here.)
Similarly, a document written as HTML, validated as HTML (again of some
version), served as text/html, interpreted by the receiving browser as
HTML, and having an HTML DOM created for it, is unambiguously an HTML
document.
There is an awful lot (realistically, almost the entire Internet) that
doesn't satisfy either case. Pertinent among which is Appendix C XHTML
1.0 served as text/html:-
A document written as XHTML with additional regard to the constraints of
Appendix C, validated as XHTML (theoretically version 1.0, strict or
transitional), served as text/html, interpreted by the receiving browser
as HTML (albeit error-filled HTML, so "tag-soup") and for which an HTML
DOM is created to be scripted.
The implication of pointing out that because this document is served as
text/html <script ... /> will not be interpreted as <script ...[color=blue]
></script> is that this document should be considered to be an XHTML[/color]
document. Otherwise Toby's "assuming XHTML" is not applicable to this
case. And this is the point where a divergence of interpretation comes
into play.
An individual, like myself or Michael, with an interest in the scripting
of the DOM, may regard the type of DOM created for a document as the
critical determinatior of the type of the document; that is, if the DOM
is an XHTML DOM the document must be an XHTML document. While if a DOM
is an HTML DOM the document should be considered an HTML document. This
position would regard Appendix C XTML 1.0 served as text/html as an HTML
document, albeit a formally malformed HTML document.
Another individual, primarily concerned with mark-up rather than
scripting, may regard passing validation as a particular document type
as critical in determining the type of a document. A position that would
accept Appendix C XHTML 1.0 served as text/html as an XHTML document.
My opinion (and it is an opinion, influenced by my particular interest
in the scripting of the resulting DOM) is that the author of Appendix C
XHTML 1.0 served as text/html is better off perceiving their creations
as formally malformed HTML, as that explains why <script .. /> will not
be interpreted as <script ... ></script>, rather than thinking of it as
XHTML that doesn't follow the rues of XML (as may otherwise be expected
(assuming that the document qualifies as well-formed XML)).
Ultimately, as it is the factor that decides which type of DOM is
created, as a result of how the browser will interpret the document, it
is the type of document advertised by the HTTP content-type header that
determines whether the document is XHTML or HTML. If you advertise a
document as text/html you are writing HTML and if you advertise it as
application/xhtml+xml it is XHTML that is being written. Appendix C
served as text/html is only XHTML in the mind of the author, it is HTML
to the receiving browser.
By now you have guesses that I am not a supporter of Appendix C XHTML. I
don't mind if the future of the Internet is XHTML, I just prefer that
people understand when they are writing XHTML and when they are not.
Richard.
Nick Kew wrote:[color=blue]
> Michael Winter wrote:[color=green]
>> On 13/04/2006 13:04, Nick Kew wrote:[color=darkred]
>>> Michael Winter wrote:
>>>> I meant what I wrote. An XHTML document is also an XML
>>>> document, so using an XML processor is appropriate.
>>>
>>> Not when a document is served as text/html.[/color]
>>
>> Why would I serve a document as text/html and then expect
>> it to be parsed by an XML processor?[/color]
>
> /me suspects he's being trolled, but bites anyway[/color]
Don't suspect that, if you can't have a worthwhile reasoned debate with
Michael Winter you can't have one with anyone.
[color=blue]
> Because that's the situation that gives rise to this thread:
> the fact that <script ... /> served as text/html is parsed
> by browsers as <script ...>, not <script ...></script>.[/color]
The question that seems pivotal here is whether a document served as
text/html should be regarded as XHTML (or, under what circumstances a
document served as text/html may be regard as not being an HTML
document).
When Toby Inkster said "assuming XHTML" the determination of what
actually is XHTML became critical to determining the veracity of that
statement.
The nature of some documents can be unambiguously determined:-
A document wittier as XHTML, validated as XHTML (of some version),
served as content type application/xhtml+xml, interpreted by the
receiving browser as XHTML, and (if supported) having an XHTML DOM
created by the browser to be scripted for that document, is
unambiguously an XHTML document.
(Michael and I share a particular interest in DOM scripting, but as the
thread itself is centred around script elements that final (optional)
aspect of document interpretation seems to be particularly pertinent
here.)
Similarly, a document written as HTML, validated as HTML (again of some
version), served as text/html, interpreted by the receiving browser as
HTML, and having an HTML DOM created for it, is unambiguously an HTML
document.
There is an awful lot (realistically, almost the entire Internet) that
doesn't satisfy either case. Pertinent among which is Appendix C XHTML
1.0 served as text/html:-
A document written as XHTML with additional regard to the constraints of
Appendix C, validated as XHTML (theoretically version 1.0, strict or
transitional), served as text/html, interpreted by the receiving browser
as HTML (albeit error-filled HTML, so "tag-soup") and for which an HTML
DOM is created to be scripted.
The implication of pointing out that because this document is served as
text/html <script ... /> will not be interpreted as <script ...[color=blue]
></script> is that this document should be considered to be an XHTML[/color]
document. Otherwise Toby's "assuming XHTML" is not applicable to this
case. And this is the point where a divergence of interpretation comes
into play.
An individual, like myself or Michael, with an interest in the scripting
of the DOM, may regard the type of DOM created for a document as the
critical determinatior of the type of the document; that is, if the DOM
is an XHTML DOM the document must be an XHTML document. While if a DOM
is an HTML DOM the document should be considered an HTML document. This
position would regard Appendix C XTML 1.0 served as text/html as an HTML
document, albeit a formally malformed HTML document.
Another individual, primarily concerned with mark-up rather than
scripting, may regard passing validation as a particular document type
as critical in determining the type of a document. A position that would
accept Appendix C XHTML 1.0 served as text/html as an XHTML document.
My opinion (and it is an opinion, influenced by my particular interest
in the scripting of the resulting DOM) is that the author of Appendix C
XHTML 1.0 served as text/html is better off perceiving their creations
as formally malformed HTML, as that explains why <script .. /> will not
be interpreted as <script ... ></script>, rather than thinking of it as
XHTML that doesn't follow the rues of XML (as may otherwise be expected
(assuming that the document qualifies as well-formed XML)).
Ultimately, as it is the factor that decides which type of DOM is
created, as a result of how the browser will interpret the document, it
is the type of document advertised by the HTTP content-type header that
determines whether the document is XHTML or HTML. If you advertise a
document as text/html you are writing HTML and if you advertise it as
application/xhtml+xml it is XHTML that is being written. Appendix C
served as text/html is only XHTML in the mind of the author, it is HTML
to the receiving browser.
By now you have guesses that I am not a supporter of Appendix C XHTML. I
don't mind if the future of the Internet is XHTML, I just prefer that
people understand when they are writing XHTML and when they are not.
Richard.
Comment