I’ve heard that using single quotes to surround XML attribute values is a “bad style”. Is this correct?
Should I always write:
<element attr="value">
Or is it acceptable to write:
<element attr='value'>
Or does it not matter which style I use?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both are legal. Choose one and stick with it. It doesn’t matter.
From the spec:
Showing that both are valid, as is mixing the two styles within an element, per attribute (though I suggest being consistent within any single document/set of documents).