Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: encoding of script tags in html [Thread Next] Re: encoding of script tags in htmlTo: NULL Date: 6/2/2008 9:33:00 PM
Martin Honnen wrote:
> Andy Fish wrote:
>
>> can someone point me at part of the w3c specification that states how
>> script tags are parsed differently to other tags in HTML.
[...]
>> 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).
> 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/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
