perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kulp, David" <david_k...@affymetrix.com>
Subject RE: [OT] using single quotes in HTML
Date Sun, 24 Feb 2002 17:22:25 GMT
The HTML 2.0 spec discusses quoting attribute values in section 3.2.4 (this
thanks to a google search of www.w3.org):

   The value of the attribute may be either:

        * A string literal, delimited by single quotes or double
        quotes and not containing any occurrences of the delimiting
        character.

        * A name token (a sequence of letters, digits, periods, or
        hyphens). Name tokens are not case sensitive.

I'm sure there's a similar prescription for later versions, but I'm too lazy
to track down the specific text.

In other words, if there are no special characters, then you don't have to
quote.  If you quote, it can be single or double.  Good recommendation is
just to always quote.

> -----Original Message-----
> From: Mark Seger [mailto:seger@cag.lkg.dec.com]
> Sent: Sunday, February 24, 2002 5:03 AM
> To: Philip Mak
> Cc: asp@perl.apache.org
> Subject: Re: [OT] using single quotes in HTML
> 
> 
> I suppose the real question is what does an html string look 
> like because
> after all, you don't need ANY quotes around the string is it 
> doesn't have
> any whitespace such as a font color.  As the string with whitespace, I
> believe either type of quote will do.
> 
> -mark
> 
> Philip Mak wrote:
> 
> > I've seen the following programming style used before, for perl code
> > that prints HTML:
> >
> >         print "<font color='red'>ERROR!</font>";
> >
> > instead of:
> >
> >         print "<font color=\"red\">ERROR!</font>";
> >
> > Using the single quotes for the quotes in HTML allows for cleaner
> > syntax in perl, since then \" or qq{} is not required.
> >
> > Does anyone know if there is a disadvantage of using single 
> quotes in
> > HTML (e.g. compatibility issues somewhere? I'm not sure 
> because almost
> > everyone only uses double quotes in HTML).
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
> > For additional commands, e-mail: asp-help@perl.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
> For additional commands, e-mail: asp-help@perl.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message