Page 1 of 1

Single quotes xhtml...

Posted: Wed Jun 09, 2004 8:44 pm
by andre_c
I was told that it's better to use double quotes around tag attributes because they're standard xhtml. When I validate my code (in which i only use single quotes) on the w3c validator, it tells me that it's valid xhtml.
Is it true that single quotes for attributes are not standard xhtml?
if so, can you post a url that confirms it?

Posted: Wed Jun 09, 2004 10:54 pm
by Weirdan
Both the 3rd edition of XML1.0 and XML1.1 recommendations allow single quotes to be used arond attribute values.

http://www.w3.org/TR/2004/REC-xml-20040204/#NT-AttValue
http://www.w3.org/TR/2004/REC-xml11-200 ... T-AttValue

Since the XHTML is just a dialect of XML it should allow it as well.

Posted: Wed Jun 09, 2004 11:19 pm
by andre_c
Thanks a lot for your reply,
I feel a lot better now about using single quotes.
( they're just a lot easier to deal with when echoing strings of html inside of double quotes, IMO)

Posted: Wed Jun 09, 2004 11:56 pm
by feyd
Hmm... when I first read the spec, it felt like it required double quotes. My mistake, I guess.