Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Naming Conventions for XML

Posted on 2006-11-18
3
Medium Priority
?
809 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 2000 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

Industry Leaders: 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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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…

688 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