On Jan 8, 10:26*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
>>> Does it depent upon the type of xhtml?
>> Not really.
> Yes, it does.
Not in the sense that the OP appeared to be using the term "type",
although it does in other senses.
> > Postal's Law says to treat it as a requirement if you are authoring
> > XHTML.
>
> Whatever that is, it does not apply here.
Postel's Law (I misspelt the name the first time around) is the
Robustness Principle.
"Be conservative in what you do; be liberal in what you accept from
others."
In this case, "If you are writing a user agent, have it cope with the
more liberal interpretation of the specification, if you are writing
XHTML, have it conform to the more conservative interpretation".
When you hit specs which only bless Appendix C conformant markup to be
served as text/html while Appendix C is an *informative* section of
the spec, you are running into very wooly territory and Postel's Law
is the best stick we have if we're forced to deal with those specs.
> >> For instance is this (below) correct for all of xhtml 1.0 transitional,
> >> *xhtml 1.0 strict, xhtml 1.1 strict, or is it correct for only some of
> >> them? [...]
> >> <script type="text/javascript"> // <![CDATA[
>
> >> var x = (z>0 && z<10) ? "blah" : "blah blah"
>
> >> // ]]> </script>
>
> > The JavaScript comments there are pointless and a waste of bytes, but
> > that is otherwise fine for any type of XHTML that is not served as
> > text/html.
>
> Whereas the latter
What is the latter in this case? I can't see distinct entities there.
If the XHTML conforms to Appendix C, then there will be no characters
that require the presence of CDATA markers.
If the XHTML doesn't conform to Appendix C, then tag soup slurpers
shouldn't be presented with the code, so they won't pass the contents
of the script block (CDATA markers and all) to the JavaScript
interpreter. (So the CDATA markers don't need JS comments to hide them
from said interpreter).
The comments are pointless in both cases.
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/