The Cover PagesThe OASIS Cover Pages: The Online Resource for Markup Language Technologies
SEARCH | ABOUT | INDEX | NEWS | CORE STANDARDS | TECHNOLOGY REPORTS | EVENTS | LIBRARY
SEARCH
Advanced Search
ABOUT
Site Map
CP RSS Channel
Contact Us
Sponsoring CP
About Our Sponsors

NEWS
Cover Stories
Articles & Papers
Press Releases

CORE STANDARDS
XML
SGML
Schemas
XSL/XSLT/XPath
XLink
XML Query
CSS
SVG

TECHNOLOGY REPORTS
XML Applications
General Apps
Government Apps
Academic Apps

EVENTS
LIBRARY
Introductions
FAQs
Bibliography
Technology and Society
Semantics
Tech Topics
Software
Related Standards
Historic
Last modified: December 29, 2005
Use of Camel Case for Naming XML and XML-Related Components

Overview

[Initial draft, incomplete document.] This document provides references to resources: (a) that discuss the use of camel case and related practices pertaining to (closed compound) names for XML components; (b) that prescribe, recommend, or otherwise advocate particular kinds of lexical/syntactic conventions for naming XML components. By components, we mean especially elements, types, attributes, entities, and related constructs. In many environments, however, these components are further used in the construction of filenames, namespace names, URIs, XML schema module names, data elements, codelist enumerations, domain models, etc.

Industry and Government Specifications: Naming and Design Rules

List of specifications reviewed:

Danish XML Project: OIOXML Naming and Design Rules

Reference document: OIOXML NDR Navngivnings- og Design Regler [OIOXML Naming and Design Rules]. Version 3.0. Date: 2004-12-15. Publikation: OIO 6 [3:2004]. 66 pages. [source]

Extracted text:

page 30 (24) 4.4. Navngivning af elementer

4.4.1. Sammenhæng mellem element- og typenavn [ELN-1]

[ELN-1] Et OIOXML skema BØR navngive dets element identisk med elementets type (uden typens 'Type' suffix), hvis elementerklæring og typedefinition forekommer sammen i skemaet.

Grundlggende skal navnet på elementet direkte afspejle navnet på den brugte type. Dette gøres ved at fjerne 'Type' suffix fra typenavnet og bruge det resulterende navn som elementnavn. Denne regel er kun relevant for skemaer, som indeholder både elementerklæring og dets tilsvarende typedefinition (se også [TPN-1]).

4.4.2. Anvendelse af UpperCamelCase [ELN-2]

[ELN-2] Et OIOXML skema SKAL navngive dets element med UpperCamelCase. UpperCamelCase betyder, at navnet skal begynde med et stort bogstav, herefter begynder hvert nyt ord med et stort bogstav, et eksempel:

<element name="StreetBuildingIdentifier" type="dkcc:StreetBuildingIdentifierType">

Hvis en forkortelse består udelukkende af store bogstaver, som f.eks. DK, bør det efterfølgende ord starte med et lille bogstav. F.eks. DKaddress i modsætning til DKAddress.

4.5. Navngivning af attributter

4.5.1. Anvendelse af lowerCamelCase [ATN-1]

[ATN-1] Et OIOXML skema SKAL navngive dets attributter med lowerCamelCase. Når man skriver i lowerCamelCase skal navnet begynde med lille bogstav, herefter begynder hvert nyt ord med et stort bogstav.

<complexType name="CustomerType">
<sequence>
<element name="GivenName" type="prefix:GivenNameType"/>
...
</sequence>
<attribute name="customerIdentifier" type="prefix:CustomerIdentifierType"/>
</complexType>

See also: Danish XML Project: OIOXML Naming and Design Rules

ebXML Technical Architecture Specification

ebXML Technical Architecture Specification v1.0.4, UN/CEFACT and OASIS, 16 February 2001. 39 pages. Sources: Cover Pages; ebXML.org. See: Approved by the Vancouver plenary, 16 February 2001.

Note: Used by OASIS ebSOA TC: "The new OASIS Electronic Business Service Oriented Architecture (ebSOA) Technical Committee will use ebXML Technical Architecture v1.04 as a starting point for describing a service-oriented architecture and practical implementation techniques that take into account the ebXML OASIS Standards (recently approved as ISO 15000), as well as recent developments from other OASIS technical committees and standards bodies."

Relevant section: 4.3 Design Conventions for ebXML Specifications

In order to enforce a consistent capitalization and naming convention across all ebXML specifications "Upper Camel Case" (UCC) and "Lower Camel Case" (LCC) Capitalization styles SHALL be used. UCC style capitalizes the first character of each word and compounds the name. LCC style capitalizes the first character of each word except the first word.

1) ebXML DTD, XML Schema and XML instance documents SHALL have the effect of producing ebXML XML instance documents such that:

Element names SHALL be in UCC convention (example: <UpperCamelCaseElement/>).

Attribute names SHALL be in LCC convention (example: <UpperCamelCaseElement lowerCamelCaseAttribute="Whatever"/>)

2) When UML and Object Constrained Language (OCL) are used to specify ebXML artifacts Capitalization naming SHALL follow the following rules:

  • Class, Interface, Association, Package, State, Use Case, Actor names SHALL use UCC convention (examples: ClassificationNode, Versionable, Active, InsertOrder, Buyer).

  • Attribute, Operation, Role, Stereotype, Instance, Event, Action names SHALL use LCC convention (examples: name, notifySender, resident, orderArrived).

3) General rules for all names are:

  • Acronyms SHOULD be avoided, but in cases where they are used, the capitalization SHALL remain (example: XMLSignature).

  • Underscore ( _ ), periods ( . ) and dashes ( - ) MUST NOT be used (don't use: header.manifest, stock_quote_5, commercial-transaction, use HeaderManifest, stockQuote5, CommercialTransaction instead).

EPA Exchange Network XML Design Rules and Conventions

Reference document: XML Design Rules and Conventions for the Environmental Information Exchange Network: Section 1. XML Design Rules. Version 1.0. September 23, 2003. 26 pages. [source PDF]

Extracted text:

Section 1, page 22, Rules and Guidelines

[GD3-1] Element names MUST be in 'Upper Camel Case' (UCC) convention, where UCC style capitalizes the first character of each word and compounds the name.

Example: <UpperCamelCaseElement/>

[GD3-2] Schema type names MUST be in UCC convention.

Example: <DataType/>

[GD3-3] Attribute names MUST be in 'Lower Camel Case' (LCC) convention where LCC style capitalizes the first character of each word except the first word.

Example: <UpperCamelCaseElement lowerCamelCaseAttribute="Whatever"/>

See also: EPA Exchange Network XML Design Rules and Conventions

Federal XML Naming and Design Rules Project

Reference document: Federal XML Naming and Design Rules. Draft Version 2. June 09, 2005. 105 pages.

Extracted text:

lines 1038-1039

[GNR8] The UpperCamelCase (UCC) convention MUST be used for naming elements and types.

lines 1041-1041:

[GNR9] The lowerCamelCase (LCC) convention MUST be used for naming attributes.

lines 1045-1049

4.2.1 Complex Type Names for Complex Data Elements
[CTN1] An xsd:complexType name based on a complex data element MUST be the Dictionary Entry Name with the separators removed and with with the suffix "Type" appended following the upper camel case convention.

lines 989-995

[Note] The use of CamelCase for Dictionary Entry Names has been considered, but has been rejected for following reasons:

  • Use of CamelCase will not allow the use of spell checkers
  • Strict use of CamelCase makes it impossible to use separators (".") and therefore doesn't allow an unambiguous identification of the composing parts of the Dictionary Entry Name.

See also: Federal XML Naming and Design Rules Project

Global Justice XML Data Model (GJXDM) Naming and Design Rules

"Global Justice XML Data Model Naming and Design Rules." Draft Version 0.4. 23-August-2005. Edited by Webb Roberts (Georgia Institute of Technology). This document specifies the data model, XML artifacts, and XML data for use with the Global Justice XML Data Model. [source PDF]. See also "Global Justice XML Data Model Naming and Design Rules." By Paul Embley (Global XML Structure Task Force). Presented an update on the Global Justice XML Data Model (GJXDM) Naming and Design Rules at the August 17, 2005 meeting of the XML Community of Practice (xmlCoP).

Extracted text:

lines 696-708

5.1.1.5. Character Case

[Rule GNR8] The upper camel case convention SHALL be used for naming elements and types.

Rationale The use of upper camel case for names of types has become a defacto standard, to which GJXDM conforms.

Examples of upper camel case names:
PersonName
JewelryStone

[Rule GNR9] The names of attributes defined within GJXDM-conformant schemas SHALL be formatted in lower camel case.

Examples of lower camel case names:
amountCurrencyCodeListVersionID
characterSetCode

See also: Global Justice XML Data Model (GJXDM) Naming and Design Rules

Hong Kong OGCIO Interoperability Framework for E-Government

Reference document: Part II: XML Schema Design Guide. Reference Identifier: G55-2. Version 1.2. November 2004. 73 pages. [cache]

Extracted text:

Name an Element: The name of the xs:element that represents the aggregation of a BBIE or ASBIE in an ABIE shall be translated from the Property Term of the BBIE/ASBIE by applying the upper camel case convention. For example, the xs:element name for the 'Delivery Date' Property Term is DeliveryDate.

Name an Attribute: The name of the xs:attribute that represents a Supplementary Component shall be translated from the Supplementary Component name by applying the lower camel case convention: all words shall be concatenated with the first letter in every word in upper case, except the first word, and the other letters in lower case. For example, the xs:attribute name for the 'Currency Code' Supplementary Component is currencyCode.

Name a Complex Type: Ignoring the impact caused by different versions of a BIE, the name of the xs:complexType that represents a BBIE or ABIE shall be translated from the Dictionary Entry Name following this procedure: (1) Remove all dot and space characters from the Dictionary Entry Name; (2) Apply the upper camel case convention: all words shall be concatenated with the first letter in every word in upper case and the other letters in lower case; (3) Append .CT at the end to indicate it is an xs:complexType. For example, the xs:complexType name for the Dictionary Entry Name 'Postal Address. Street. Text' is PostalAddressStreetText.CT...

See also: Hong Kong OGCIO Interoperability Framework

IRS XML Naming and Design Rules

Reference document: "IRS XML Standards and Guidelines." Edited by Sol Safran (IRS, Enterprise Data Management). Draft document. From Volume 4, IRS Enterprise Data Standards and Guidelines (Special Tools and Techniques). Posted June 27, 2005 to the CORE.gov web site.

Extracted text:

page 18

GNR9 In both the start tag and end tag, each word of the XML element name MUST be capitalized (upper Camel case).

GNR10 Lower Camel case MUST be used for an attribute name.

See also: IRS XML Naming and Design Rules

National Information Exchange Model (NIEM)

Reference document: NIEM Version 0.1 Release; see the file listing for the ZIP archive.

The NIEM 0.1 release contains a collection of fifty-four (54) XML schemas and a Component Mapping Template for use by reviewers: 250 types, of which 54 are Universal, 107 are Common, and 89 are Domain Specific. It also defines 2213 Properties, of which 273 are classified as Universal, 943 are Common, and 997 are Domain Specific. Naming conventions for XML components in the Schemas follow the major published Naming and Design (NDR) specifications: use of UpperCamelCase for XML types and elements, but lowerCamelCase for attribute names. See examples from the Common namespace, part of the NIEM Core collection of namespace:

  • Elements: VisitationRestrictedAccessPersonReference, PersonMoodDescriptionText, JewelryStone, WeightMeasure
  • Types: VehicleTransmissionTypeCodeType, LengthMeasureType, OrganizationType, LessorType
  • Attributes: vehicleOdometerReadingUnitCode, enginePowerDisplacementUnitCode, drugUnitCode, elevationUnitCode

See also: "First Release of the U.S. National Information Exchange Model (NIEM)."

OAGIS Naming and Design Rules (NDR)

Reference document: provisionally from "OAGIS 9.0 Introduction." Presented by Michael Rowell (Chief Architect, Open Applications Group, Inc. August 9, 2005.

Extracted text:

Slide #19, Naming Updates in OAGIS 9.0: "OAGIS 9 incorporates today's best practices for XML and continues to takes full advantage of XML Schema: (1) Uses primarily global elements; (2) Incorporates [UN/CEFACT] ATG 2 Naming and Design Rules, including: ISO 11179, long tag names, use of UpperCamelCase for Elements and Types, use of lowerCamelCase for attributes..."

See also: OAGIS Naming and Design Rules (NDR)

OASIS LegalXML Exchange Document Methodology, Naming, and Design Rules (MNDR)

Reference document: GJXDM Information Exchange Package Methodology, Naming and Design Rules (MNDR). Section VI — Schema Set Naming and Design Rules, Section VII — Instance Naming and Design Rules.

Extracted text:

lines 343-365

XML is case sensitive. Consistency in the use of case for a specific XML component (element, attribute, type) is essential to ensure every occurrence of a component is treated the same. This is especially true in a business-based data-centric environment such as that addressed by GJXDM. Additionally, the use of visualization mechanisms such as capitalization techniques assist in ease of readability and ensure consistency in application and semantic clarity.

The ebXML architecture document specifies a standard use of upper and lower camel case for expressing XML elements and attributes respectively. GJXDM will adhere to the ebXML standard. Specifically, UBL element and type names will be in UpperCamelCase (UCC).

[GNR7] The UpperCamelCase (UCC) convention MUST be used for naming elements and types.

Example:
PersonName
JewelryStone

GJXDM information exchange attribute names will be in lowerCamelCase (LCC).

[GNR8] The lowerCamelCase (LCC) convention MUST be used for naming attributes.

Example:
amountCurrencyCodeListVersionID
characterSetCode

See also: OASIS LegalXML Exchange Document Methodology, Naming, and Design Rules (MNDR) Subcommittee

Universal Business Language (UBL) Naming and Design Rules

Reference document: Universal Business Language (UBL) Naming and Design Rules. Or here; an updated draft 2.0 is alao available.

Extracted text:

lines 228-234

Section 1.3 Terminology and Notation

Keywords: keywords reflect concepts or constructs expressed in the language of their source standard. Keywords have been given an identifying prefix to reflect their source.

The following prefixes are used:

xsd: represents W3C XML Schema Definition Language. If a concept, the words will be in upper camel case, and if a construct, they will be in lower camel case.
      xsd: complexType represents an XSD construct
      xsd: SchemaExpression represents a concept

4.1 General Naming Rules

lines 1339-1357

XML is case sensitive. Consistency in the use of case for a specific XML component (element, attribute, type) is essential to ensure every occurrence of a component is treated as the same. This is especially true in a business-based data-centric environment such as what is being addressed by UBL. Additionally, the use of visualization mechanisms such as capitalization techniques assist in ease of readability and ensure consistency in application and semantic clarity. The ebXML architecture document specifies a standard use of upper and lower camel case for expressing XML elements and attributes respectively [Note #12: ebXML, ebXML Technical Architecture Specification v1.0.4, 16 February 2001]. UBL will adhere to the ebXML standard. Specifically, UBL element and type names will be in UpperCamelCase (UCC).

[GNR8] The UpperCamelCase (UCC) convention MUST be used for naming elements and types.

Example:
CurrencyBaseRate
CityNameType

UBL attribute names will be in lowerCamelCase (LCC).

[GNR9] The lowerCamelCase (LCC) convention MUST be used for naming attributes.

Example:
amountCurrencyCodeListVersionID
characterSetCode

See also: Universal Business Language (UBL) Naming and Design Rules

UN/CEFACT XML Naming and Design Rules Technical Specification

Reference document: XML Naming and Design Rules. Draft 1.1a. 16-February-2005. 111 pages. Project Team Leader: Mark Crawford (LMI). Editors: Gunther Stuhec (SAP AG), Paula Heilig (Worldspan), Margaret Pemberton (Diskray), and Garret Minakawa (Oracle/OAGI).

Extracted text:

UN/CEFACT XML Naming and Design Rules, lines 390-402

"Following the ebXML Architecture Specification and commonly used best practice, Lower Camel Case (LCC) is used for naming attributes, and Upper Camel Case (UCC) is used for naming elements and types. Lower Camel Case capitalizes the first character of each word except the first word and compounds the name. Upper Camel Case capitalizes the first character of each word and compounds the name."

[R 7] Lower camel case (LCC) MUST be used for naming attributes.

Example 5-2: Attribute <xsd:attribute name="unitCode" .../>

[R 8] Upper camel case (UCC) MUST be used for naming elements and types.

Example 5-3: Element <xsd:element name="LanguageCode" ...> Example 5-4: Type 402 <xsd:complexType name="DespatchAdviceCodeType">

[... lines 713-734, 750]

schema modules:

[R 37] UN/CEFACT namespaces MUST be defined as Uniform Resource Names... following this pattern:

urn:un:unece:uncefact:<schematype>:<status>:<name>:<version> where
<name> = the name of the module (using upper camel case)

lines 784-800

Schema locations are required to be in the form of a URI scheme.

In recognition of the need for resolvability of schema location, until such time as URNs become fully resolvable, UN/CEFACT will store schema in locations identified using a URL based URI scheme aligned with the URN based URI scheme used for the namespace declaration as follows:

urn:un:unece:uncefact:<schematype>:<status>:<name>:<version>

[R 41] The general structure for schema location MUST be:

http://www.unece.org/uncefact/<schematype>/ <name>_<major>.<minor>.[<revision>]_[<status>].xsd

Where:
<name> = the name of the module (using upper camel case)

Note also lines 3857-3858:

[R 10] Element, attribute and type names MUST be drawn from the following character set: a-z and A-Z.

See also: UN/CEFACT XML Naming and Design Rules Technical Specification

US Department of the Navy XML Naming and Design Rules

Reference document: Department of the Navy XML Naming and Design Rules. Final Version 2.0. Office of the DON, Chief Information Officer. January 2005. 168 pages.

Extracted text:

Namespace Rule: [NMS2] URNs MUST be in lowercase, except multiple words, which MUST use lower camel case and the root element, which will use upper camel case.

General Naming Rules

[GNR7] The UpperCamelCase (UCC) convention MUST be used for naming elements and types.

[GNR8] The lowerCamelCase (LCC) convention MUST be used for naming attributes.

See also: US Department of the Navy XML Naming and Design Rules

SGML/XML Applications

  • DocBook. DocBook "is a general purpose XML and SGML document type particularly well suited to books and papers about computer hardware and software, though it is by no means limited to these applications." Version 4.5CR1 is available in XML and SGML; nofficial RELAX NG and W3C XML Schema versions are also available. Closed compound names for elements, attributes, parameter entities (etc) are typically spelled in lower case: indexdivcomponent.mix titleabbrev, revnumber, simplesect, biblioentry, mousebutton, targetdocent.

  • Federal Enterprise Architecture Data Reference Model (DRM). The [US] FEA Data Reference Model (DRM) "is intended to promote the common identification, use, and appropriate sharing of data/information across the federal government through its standardization of data in the following three areas: data description, data sharing, and data context. In order to facilitate implementation of the DRM by federal agencies, OMB will provide agencies with a DRM Schema, also known as a 'DRM XML Profile',. The DRM Schema will enable federal agencies to submit XML instances to OMB that contain information for the agency pertaining to the three DRM areas described above. The DRM Schema will also facilitate data modeling efforts within agencies by providing a capability by which (for example) physical data models may be derived from logical data models..." In the Version 0.2 draft, element names use UCC (upper camel case), while attributes [unless they begin with an acronym substring] use LCC (lower camel case). Element name examples: DataReferenceModel, SubmissionMetadata, DataDescription, ExternalEntitiesRefs, ExternalResourcesRefs, ConfidentialityLevel; attribute name examples: disseminationControls, classifiedBy, classificationReason, derivedFrom, declassDate, declassEvent, typeOfExemptedSource, dateOfExemptedSource, declassManualReview.

  • Text Encoding Initiative Guidelines (TEI). TEI P5 uses lower camel case for elements, attributes, and other names. Examples of element names: accMat, addName, addSpan, addrLine, adminInfo, altGrp, altIdent, altIdentifier, altName, attDef, attList, attRef, biblFull, biblItem, biblScope, biblStruct, binaryObject, bindingDesc, castGroup, castItem, catDesc, catRef, dateRange, dateStruct, elementSpec, genName, langUsage, macroSpec, moduleRef, moduleSpec, orgName, particDesc, recordingStmt, settingDesc, stringVal, teiHeader, timeStruct, variantEncoding, witDetail. Example attributes: adjFrom, adjTo, assertedValue, baseForm, baseType, copyOf, dateAttrib, dateCreated, dateUpdated, formulaNotations, inDegree, indexName, indexTerm, langKey, mainLang, mimeType, notAfter, notBefore. TEI apparently also uses lower camel case for classes and macros, implemented via parameter entities. As early as P4 (P3?), the SGML declaration for the TEI DTD was changed to "NAMECASE GENERAL NO" in order to support validation for mixed case (case-sensitive) names.

  • Metadata Object Description Schema (MODS). The Digital Library Federation Aquifer Initiative seeks to enable distributed content to be used effectively by libraries and scholars for teaching, learning, and research. The Metadata Working Group of the DLF Aquifer Initiative has developed a set of implementation guidelines of the Metadata Object Description Schema (MODS) specifically for use in describing digital cultural heritage and humanities-based scholarly resources that are to be shared within the Aquifer Initiative and wider. The guidelines are specifically meant for metadata that will be shared with others (whether through the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH) or some other means), and, as such, is focused on how to author metadata that will make sense and be useful outside of its local context." Types, elements, and attributes make use of the (MODS) camelCase naming conventions: e.g., Element names: titleInfo, typeOfResource, originInfo, physicalDescription, tableOfContents, targetAudience, relatedItem, accessCondition, recordInfo; attribute names: objectPart, displayLabel.

  • XML Catalogs. The OASIS specification "defines an entity catalog that maps both external identifiers and arbitrary URI references to URI references." Element names and attribute names are formed using lower camel case. Elements: delegatePublic, delegateSystem, delegateURI, nextCatalog, rewriteSystem, rewriteURI, systemSuffix); attributes: uriStartString, systemIdStartString, rewritePrefix).


Hosted By
OASIS - Organization for the Advancement of Structured Information Standards

Sponsored By

IBM Corporation
ISIS Papyrus
Microsoft Corporation
Oracle Corporation

Primeton

XML Daily Newslink
Receive daily news updates from Managing Editor, Robin Cover.

 Newsletter Subscription
 Newsletter Archives
Globe Image

Document URI: http://xml.coverpages.org/camelCase.html  —  Legal stuff
Robin Cover, Editor: robin@oasis-open.org