开发者

Building an XML [duplicate]

This question already has answers here: Is there a standard naming convention for XML elements? [closed] (1开发者_StackOverflow3 answers) Closed 9 years ago.

Which is the standarized way of writing an XML? is it

<MODEL_NUMBER></MODEL_NUMBER>

or

<MODELNUMBER></MODELNUMBER>

Thanks !


The answer to your question is:

(a) there is no standard

(b) there is not even any widespread agreement on conventions.


Most style guidelines I have read (e.g. http://www.w3schools.com/xml/xml_elements.asp) recommend using underscores between the two words in an element tag if it improves readability. So casing aside, the most readable would be:

 <model_number></model_number>


This similar question shows a few options. I personally prefer ProperCase and camelCase, mostly because I don't like typing underscores, due to my less than perfect typing skills. That's really more personal bias, and experience working with .NET, where ProperCase and camelCase are more prevalent.

Case conventions on element names?


Neither of these. By default, element names mustn't be in capital letters.

Maybe <model.number></model.number> would be a solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜