构建 XML
哪种是编写 XML 的标准化方法? 是它
<MODEL_NUMBER></MODEL_NUMBER>
还是
<MODELNUMBER></MODELNUMBER>
谢谢!
Which is the standarized way of writing an XML?
is it
<MODEL_NUMBER></MODEL_NUMBER>
or
<MODELNUMBER></MODELNUMBER>
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你的问题的答案是:
(a)没有标准
(b)甚至没有任何关于约定的广泛共识。
The answer to your question is:
(a) there is no standard
(b) there is not even any widespread agreement on conventions.
我读过的大多数样式指南(例如 http://www.w3schools.com/xml/xml_elements.asp )如果可以提高可读性,建议在元素标记中的两个单词之间使用下划线。因此,除了大小写之外,最可读的是:
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:
这个类似的问题显示了一些选项。我个人更喜欢 ProperCase 和 CamelCase,主要是因为我不喜欢输入下划线,因为我的打字技巧不太完美。这实际上是更多的个人偏见和使用 .NET 的经验,其中 ProperCase 和 CamelCase 更为普遍。
元素名称的大小写约定?
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.