Solved

Naming Conventions for XML

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

630 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