Solved

Naming Conventions for XML

Posted on 2006-11-18
3
802 Views
Last Modified: 2013-11-19
Hi everyone,

Are there naming conventions when writing XML and XSD files (i.e. camel case, Pascal case, etc.)?

Thank you very much,


Jazon
0
Comment
Question by:piratepatrol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 17974945
Hi piratepatrol,

It all depends on what you want to do, I give some restrictions near the end of this post

There are not really conventions for naming,
one advice: make them human readable, not too long, not too cryptic.
Abreviating names can be cryptic and is only interesting if you do a lot of authoring by hand
among popular DTDs and schema's various naming schemes are used
I have a feeling the tendency is now for camel case though, apparently it is very good for reading
Take into account that it is good that you can easily differentiate names by quickly looking at them

DOCBOOK uses all lowercase, eg. "foreignphrase", "guimenuitem"
XSLT uses a hyphen and all lowercase, eg. "xsl:apply-templates"
W3C schema uses camel case, eg. "xs:simpleType"

note that XML names are case sensitive
here are the options you have, it is important that you choose one and stick to it

1. foreignphrase
2. foreignPhrase
3. foreign.phrase
4. foreign-phrase
5. foreign_phrase
6. ForeignPhrase
7. FOREIGNPHRASE

Some comments on the list
1. can be confusing for very long names containing multiple words
2. is very easy to read
3. I used to use that a lot but it is annoying if you use CSS for styling, you then have to escape the "."
4. is also used a lot but some databinding tools go balistic on the "-" creating class names
7. Don't do this because it is very "screaming" and very hard to read quickly

Hope this helps a little

Cheers!

Geert
0
 
LVL 3

Author Comment

by:piratepatrol
ID: 17976324
Great comments!  Thanks.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17977574
welcome
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question