Solved

Naming Conventions for XML

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now