W3C home > Mailing lists > Public > www-validator@w3.org > April 2002

Re: no-show in IE5.1

From: Thanasis Kinias <tkinias@optimalco.com>
Date: Thu, 25 Apr 2002 22:34:37 -0700
To: "Timothy J. Luoma" <luomat@peak.org>
Cc: css-discuss@westciv.com, jam.macdonald@sympatico.ca, www-validator@w3.org
Message-ID: <20020425223437.A30000@glaux.ph.cox.net>
scripsit Timothy J. Luoma:
> On Tue, 23 Apr 2002, Thanasis Kinias wrote:
> > The code on the page isn't valid.  Line 12:
> >
> >     <script type="text/javascript" src="styleswitcher.js" /></script>
> >
> > The <script> element is closed twice.
> >
> > How does this reveal a limitation in the Validator?
> When I validated the page, it showed no errors when it was just:
> 	<script type="text/javascript" src="styleswitcher.js" />
> which isn't valid.  You can't close a <script> with a ' />' and the
> validator didn't say anything about it.

Why can't you close a <script> with a ' />'?  

In XML, that is a perfectly acceptable way of closing an element.  It's
the normal way of writing, e.g., images: 
<img src="foo.gif" alt="foo" />.  
It's also not restricted to elements declared in the DTD as EMPTY (like
<img>), but can be used for any element which, in any particular
instance, has no children.  See the XML spec [1].

1. <http://www.w3.org/TR/1998/REC-xml-19980210#sec-starttags>

Thanasis Kinias
Web Developer, Information Technology
Graduate Student, Department of History
Arizona State University
Tempe, Arizona, U.S.A.

Ash nazg durbatulūk, ash nazg gimbatul,
Ash nazg thrakatulūk agh burzum-ishi krimpatul
Received on Friday, 26 April 2002 01:35:26 UTC

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