Fog Creek Software
Discussion Board




Style of XML tags and attributes

Hey guys,

When defining schemas with all the attributes and elements etc. What style do you prefer aesthetically?

tagName

TagName

tag-name

I have evolved into using the third and feel I am developing this as a habit.

Will I be flamed by my peers in years to come?

Conscientious XML developer
Sunday, September 21, 2003

Yes.

HTH,
Philo

Philo
Sunday, September 21, 2003

I was under the impression that the "third way" was the correct approach.

Walter Rumsby
Sunday, September 21, 2003

huh huh huh, you said "correct".

All three of them are legal. What else besides legal matters? Well, I guess if your team mandates a style, then that probably matters to you. It doesn't matter to me. :)

Brad Wilson (dotnetguy.techieswithcats.com)
Sunday, September 21, 2003

It makes no difference what you do. You will be flamed in years to come for being a short-sighted mental defective in any case.

(Note: in years to come they will not be your peers. They will be your successors! ;)

Tom
Sunday, September 21, 2003

I use the first style because most of my work is in C#, and it makes it easier to line up my program's variable names with the XML tags.

Chris

Chris
Sunday, September 21, 2003

The style that's currently in vogue seems to be:

BlahDeBlah for elements
blahDeBlah for attributes

Although it really doesn't matter either way, they're all legal, go with whichever one.

Sum Dum Gai
Sunday, September 21, 2003

I tend to use the tag-name style, mostly because it fits best with most of the XML vocabularies I use, like XHTML, XSL, SVG, Docbook, RELAX NG etc. The main exception is XML Schema, but I try to avoid that anyway for different reasons :-)

motta
Monday, September 22, 2003

No, in years to come they will be his employees. Then he can fire their butts!


Monday, September 22, 2003

I think I will randomly change so then 33% of the time my schemas won't cause offense.

Conscientious XML developer
Monday, September 22, 2003

"I think I will randomly change so then 33% of the time my schemas won't cause offense"

Nonsense.

It's just that 100% of the time, only ~33% of the people won't be flaming you for being a short-sighted mental defective.

You can not ever win this debate. There will always be people whining that your capitals are in the wrong place, and there is no known way to appease them. Even if you submit, you'll just get a whole new bunch with the same complaint.

Kill the whiny cry-babies. It's the only morally acceptable and effective solution available to you.  :)

andrew m
Tuesday, September 23, 2003

I SHALL DEFINE ALL MY TAGS IN UPPERCASE FROM HENCE FORTH.

Conscientious XML developer
Wednesday, September 24, 2003

*  Recent Topics

*  Fog Creek Home