[Javascript] OT: W3C

Shawn Milo milo at linuxmail.org
Wed May 26 10:12:18 CDT 2004


According to the W3C (http://www.w3.org/TR/xhtml1/),
SGML is a "language for describing markup languages".

On the same page, it says that 
"HTML is an example of a language defined in SGML."

So "SGML" is something very general, and HTML and XHTML
are SGML-based standards which go into their own
specifics.  XML is also based on SGML.

>From the same page:

4.4. Attribute values must always be quoted

All attribute values must be quoted, even those which appear to be numeric.

CORRECT: quoted attribute values

<td rowspan="3">


This does not specify double quotes here, but this example, as well
as every other example I've seen on the W3 site regarding XHTML,
uses double-quotes to enclose attributes.


Now, maybe I'm mis-interpreting this, or I read something in a
newsgroup or some article which specifically stated double-quotes
but was wrong.  But double-quotes are used in all of the W3C 
examples, and considering using single quotes in Javascript makes
it a lot easier to embed the Javascript into (X)HTML, it just
seems like the better choice.


I'm not trying to start a flame-war or anything, and I know that
arguing what is admittedly my personal preference costs me 
some credibility in this debate, but I think that double-quotes
for (X)HTML and single quotes for Javascript is a "best practice",
which makes a lot of things easier.

Shawn





----- Original Message -----
From: "Shawn Milo" <milo at linuxmail.org>
Date: Wed, 26 May 2004 09:04:36 -0500
To: javascript at LaTech.edu
Subject: [Javascript] OT:  W3C

> Mike Dougherty wrote:
> 
> Why?
> 
> Because Hakan wrote:
> 
> On Wed, 26 May 2004 10:47:55 +0000
>   Hakan Magnusson <hakan at backbase.com> wrote:
> >You should use double quotes around HTML attributes, but apart from that it looks fine.
> >
> >Regards,
> >H
> >
> 
> The reason for using double quotes around HTML attributes is that the
> W3C (http://www.w3.org/), the standards body which defines HTML, CSS, XHTML, etc., 
> has made that the standard.
> 
> Sloppy HTML, such as using single quotes or no quotes around attributes may work, 
> but they are not "correct", like poor grammar.  At the moment, most major browsers
> accomodate these errors, but the way of web content is increasingly going toward
> different platforms, such as handheld computers and phones, braille displays for the
> blind, and other non-PC browsers.  These browsers, sometimes included in a device
> with an embedded OS and software, will not be able to handle all of the variations
> of bad HTML out there.  That is part of the impetus for XHTML, which is really just
> HTML, but with stricter syntax enforcement.
> 
> Check out the W3C's site for more info, or you can e-mail me privately.  I find 
> coding to XHTML standards to be much more of a benefit than a hinderance.
> 
> Shawn
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list