Martin Honnen wrote:
Quote:
Andy Fish wrote:
>
Quote:
>can someone point me at part of the w3c specification that states how
>script tags are parsed differently to other tags in HTML.
|
|
[...]
Quote:
Quote:
>interestingly i have also discovered that this:
>>
><script>if (3<5);</script>
>>
>IS valid html and seems even to be valid XHTML even though it is not
>valid XML
|
>
That snippet is not well-formed so it can't be valid XML or XHTML as it
is not even XML.
|
It is, however, valid HTML (SGML): the < sign is valid unescaped in
CDATA declared content (and would be valid elsewhere, as the digit
following it cannot be taken to be the beginning of an element type
name).
Quote:
wow - what a minefield this has turned out to be !!
|
Don't guess ("seems to be..."). Install a standalone validating parser
that handles both SGML and XML (eg onsgmls, part of SP), and copies of
the relevant DTDs; or a schema validator and copies of the schemas,
and test any files you create for validity. A good XML editor will do
this for you anyway.
///Peter
--
XML FAQ:
http://xml.silmaril.ie/