Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - encoding of script tags in html >Thread Next - Re: encoding of script tags in html Re: encoding of script tags in htmlTo: NULL Date: 6/2/2008 2:11:00 PM 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. See http://www.w3.org/TR/html4/types.html#type-script: "Please note that script data that is element content may not contain character references, but script data that is the value of an attribute may contain them." and http://www.w3.org/TR/html4/appendix/notes.html#notes-specifying-data: "The DTD defines script and style data to be CDATA for both element content and attribute values. SGML rules do not allow character references in CDATA element content but do allow them in CDATA attribute values." > 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. -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
