[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Hyphens vs underscores in element names

  • From: Peter Murray-Rust <peter@u...>
  • To: xml-dev@i...
  • Date: Wed, 26 Jan 2000 08:45:10 +0000

xml underscores
At 06:26 PM 1/26/00 +1300, Warren Hedley wrote:
>Hello XML-DEV


>One of the more popular arguments between the development team for
>FieldML regards a convention for the naming of elements and
>attributes in our ML collection. The debate focuses over whether
>we should use underscores (num_elements), hyphens (num-elements),
>capitalisation (numElements) or runtogether (numelements). We've
>eliminated capitalisation and runtogether because they don't
>look as nice, and are now reduced to hyphens vs. underscores. The
>older part of the development team is familiar with Fortran and C
>and are keen to use underscores. However I've noticed in a brief
>survey (results below) that most of the W3C-endorsed stuff seems
>to feature minus signs.
>Can anyone suggest any compelling reasons for going either way?
>Does anyone want to add more data to my survey?

In scientific/technical areas it is highly likely that you are going to
need to write code for at least some of your elements, especially if they
relate to numeric or other non-textual data. In this case it is natural to
name the classes/variables in a way that reflects the XML names. If you
include punctuation which is reserved in the implementation language you
may hit problems. '-' and '.' are particularly common. For example, we
discovered to our disappointment that our domain name (xml-cml.org) could
not be used as a package name in Java, i.e.:
package org.xml-cml;
cannot contain a '-'

In naming elements in CML (Chemical Markup Language)
[http://www.xml-cml.org] I tried to avoidconcatenatedwords, but did it for
some attribute values
  <string builtin="atomRef">a1</string>
  <string builtin="atomRef">a2</string>      
[We may move to an alternative representation later (e.g.

In writing DOM-based code I have things like:
public class BondImpl extends CMLBase implements Bond {...}
If anything in those names is reserved punctuation you have to modify the


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Unsubscribe by posting to majordom@i... the message
unsubscribe xml-dev  (or)
unsubscribe xml-dev your-subscribed-email@your-subscribed-address

Please note: New list subscriptions now closed in preparation for transfer to OASIS.


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.