Solved

Naming Conventions for XML

Posted on 2006-11-18
3
794 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to page 4 93
JSON  parse help 7 40
PHP alternative to file_get_contents('php://input') 4 76
parsing xml using powershell 6 19
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

820 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