W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2004

RE: Element names guidelines

From: Barclay Alan K Contr AEDC/DYN <Alan.Barclay@arnold.af.mil>
Date: Thu, 18 Nov 2004 15:21:27 -0000
Message-ID: <200411181521.iAIFLZ7x009318@andes.arnold.af.mil>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

US Federal developers need to be aware of the Federal XML Developer's Guide,
which is still in draft form, which states the following:

Federal developers SHALL adopt the camel case convention, as defined by the
ebXML Technical Architecture, when creating XML component names. Excerpts
are provided in Appendix A.

-> XML Elements and XML Schema data types use upper camel case:
The first letter in the name is upper case, as is the letter beginning each
subsequent word.
-> XML Attributes use lower camel case: Like upper camel case, except
the first letter of the first word is lower case.

Voluntary Consensus Standards bodies and other XML organizations such as
OASIS, Universal Business Language (UBL), UN/CEFACT, RosettaNet, BizTalk
and ebXML (see Internet references in Appendix C) have all adopted the camel
case convention for XML component naming, with ebXML differentiating between
upper and lower camel case.

<?xml version="1.0" encoding="UTF-8" ?>
Example of an upper camel case element and lower camel case


-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of W. Eliot Kimber
Sent: Thursday, November 18, 2004 8:57 AM
To: Frans Englich
Cc: xmlschema-dev@w3.org
Subject: Re: Element names guidelines

Frans Englich wrote:

> Hello,
> At the risk of starting a flamefest, I wonder: What is the best naming
> conventions for elements and attributes? A crucial question in modeling
> formats.
> Assuming the phrase "car description" should be translated to an 
> element name,
> and the criteria for judgment are easy to type and readability, there
exist a 
> number of different alternatives:

I prefer underscore for word breaks: car_description

I also prefer to abbreviate long words with well-understood short forms, 
of which description is a prime example: car_desc

It also depends on whether the elements are serving primarily authors 
doing technical documents or similar or serving applications that are 
primarily data consumers or producers.

In the authoring case, brevity has more value simply because long 
element type names can take up a lot of space in the authoring display 
when you have some kind of "tags-on" view or a tree view.

In the application case, clarity is has more value. One can argue that 
brevity has value because of just the data cost of long start and end 
tags, but the counters to that argument is that data is cheap and XML 
data streams compress very efficiently for transmission.

I prefer all lowercase names to avoid silly case errors that are hard to 
debug, expecially in environments like XSLT where a mistyped tag name 
often results in a silent failure to match or select.


Received on Thursday, 18 November 2004 15:22:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:06 UTC