OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Naming conventions for a sampling of W3C and ISO XMLvocabularies

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]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS