[thelist] quoting attributes and tag case

.jeff jeff at members.evolt.org
Sat Aug 17 01:17:01 CDT 2002


tom,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Tom Dell'Aringa
>
> 1. I prefer double quoting attributes. Does XHTML care
>    if they are single quoted? I'm thinking not, but not
>    sure.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

it doesn't care, though i wish it'd require that double-quotes were used since most editors syntax highlighting behaves better with double-quoted attribute values.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Reason I ask: If you write a script that uses
> document.write to output html - you need to alternate
> your quotes of course:
>
> document.write("<td width='10'>foo</td>");
>
> So you end up with single quotes...I guess I could do
> this:
>
> document.write('<td width="10">foo</td>');
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

that's the reason i give a javascript tip to *always* use single-quotes as the string qualifier.  it makes creating a string of html *so* much easier.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> 2. Tag Case: What do you all use? I've used lower case
>    for some time, but it seems that in the XML world,
>    its Upper Case for everything. On the one hand, upper
>    case does make the tags stick out...just wondering
>    what you all thought.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

lowercase all the way.  i find myself compulsively converting any uppercase tags i find in a document.  of course i compulsively wrap attribute values in double-quotes and reorder tag attributes to the order i'm used to.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list