W3C home > Mailing lists > Public > www-validator@w3.org > November 2003

Re: Empty <script> bug (XHTML documents)

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Mon, 3 Nov 2003 19:14:49 +0200 (EET)
To: www-validator@w3.org
Message-ID: <Pine.GSO.4.58.0311031909590.19875@korppi.cs.tut.fi>

On Mon, 3 Nov 2003, Beton, Richard wrote:

> I have noticed that XHTML documents are passed as valid even when they
> contain empty <script> elements. For example,
>   <script src="js/whatever.js"/>

Why would that not be valid? By XML rules, it is equivalent to
<script src="js/whatever.js"></script>

"Empty-element tags may be used for any element which has no content,
whether or not it is declared using the keyword EMPTY. For
interoperability, the empty-element tag should be used, and should only be
used, for elements which are declared EMPTY."

(The empty-element tag adhockery is a constant source of confusion; for a
treatise, see http://www.cs.tut.fi/~jkorpela/html/empty.html )

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Monday, 3 November 2003 12:14:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:39 UTC