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

Re: Naming conventions for a sampling of W3C and ISO XMLvocabu

  • From: Liam R E Quin <liam@w3.org>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Fri, 03 Feb 2012 20:18:04 -0500

Re:  Naming conventions for a sampling of W3C and ISO XMLvocabu
On Fri, 2012-02-03 at 14:48 +0000, Costello, Roger L. wrote:
> Hi Folks,
> I am sampling some standard XML vocabularies to see what naming
> convention they use. Below is what I've compiled thus far. What naming
> convention do you use?
> 1. XML Schema: all elements and attributes are camel case. Examples:
> maxOccurs, elementFormDefault, substitutionGroup.

This convention for XML names translate most easily into most non-XML
programming languages.
> 2. XSLT: all elements and attributes are lower-case, dash-separated.
> Examples: apply-templates, exclude-result-prefixes, analyze-string.

If you do this, you need to have a data binding convention such as
mapping aaa-bbb to aaaBbbb or aaa_bbb.  This happens much more
frequently with Schema than with XSLT, so that may explain the
difference.  Of course, if you want to exchange arbitrary names between
XML and some other language, you're likely to need some sort of escaping
method or translation convention at some point, so camelCase just lets
you do a crappier initial data binding design :-)

No opinion here on Schematron.

I don't believe we (W3C) have a policy about name syntax.  The Dutch
parliament has a policy forbidding men from wearing white socks, but I
doubt it affects the quality of their legislation.


PS: some people in this discussion have confused some terms. XML admits
of only three different tag names: open, close, and empty. But you can
define your own element names and attribute names... it's worth being
clear about the distinction, not because of pedantry (despite mention of
socks) but because _tags_ are about the text-based interchange format of
XML, and elements are about the logical structure.  Understanding the
difference is part of the Nine-fold Path of Enlightagment in using XML
and XSLT.

Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.