Re: Tidy of Script contents desc += "</td></table>";

On Tue, 5 Sep 2000, Rzepa, Henry wrote:

> 
> >The solution for Javascript is easy.  Any time you would have had
> >e.g. "</td>", write "<" + "/td>" instead.   
> >
> >
> > Tidy's behaviour is therefore correct for HTML4.01 documents.
> > (Though I expect XHTML is stricter, and requires CDATA element
> > content to use &lt;/
> 
> Sounds like we need a "tidy" for JavaScripts, but the bigger
> problem seems insuperable.
> 
> Thus ensuring that dynamic HTML is written by JavaScript in
> an XHTML consistent manner is one thing, ensuring that the
> resulting HTML is itself XHTML compliant is a far worse
> problem..
> 
> The use of JavaScript seems to be increasing, but boy is it
> going to cause problems in the future!
> 
> Does anyone know of any  tools that can even begin to look
> at the above problems of handling  JavaScripts?  Likewise, are
> there any tools for validating  the stylesheet components?

For XHTML, I am looking into ways to hide a CDATA marked section
in the script element, e.g.

<script language="javascript" type="text/javascript">
//<![CDATA[
 ... some javascript ...
//]]>
</script>

A similar approach is applicable to CSS. 

This solves the pressing problem of making the documents wellformed,
but leaves open the Turing-complete issue of document.write and
direct use of the DOM to generate markup programmatically. The HTML
working group wisely ducked the issue, leaving it up to authors to
deal with!

Of course the Web is increasingly about scripting rather than
static documents. XML Schema doesn't even begin to tackle the
problem of documents with dynamic constraints. However, this
is something that work on XForms is having to address!

Regards,

-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
tel/fax: +44 122 578 3011 (or 2521) +44 778 532 0444 (mobile)
World Wide Web Consortium (on assignment from HP Labs)

Received on Saturday, 16 September 2000 14:26:33 UTC