**NDRs for UnitsML (version 0.4.3) -- Rules only**

## 2.1 Relations to standards

\[STA1\] The UnitsML schema design rules MUST be based on the W3C XML
Schema Recommendations: XML Schema Part 1: Structures and XML Schema
Part 2: Datatypes.

\[STA2\] The UnitsML schema MUST be based on the W3C suite of technical
specifications holding recommendation status.

**2.2 Overall schema structure**

\[GXS1\] The UnitsML Schema MUST conform to the following physical
layout as applicable:

\<!\-- ======= XML Declaration======== \--\>\
\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>\
\<!\-- ===== xsd:schema Element With Namespaces Declarations =====
\--\>\
xsd:schema element to include version attribute and namespace
declarations in the following order:\
xmlns:xsd\
Target namespace\
Default namespace\
Unqualified Datatypes\
Qualified Datatypes\
Identifier Schemes\
Code Lists\
Attribute Declarations -- elementFormDefault=\"qualified\"\
attributeFormDefault=\"unqualified\"\
Version Attribute\
\<!\-- ===== Imports ===== \--\>\
all incorporated schemas\
\<!\-- ===== Root Element ===== \--\>\
Root Element Declaration\
Root Element Type Definition\
\<!\-- ===== Element Declarations ===== \--\>\
alphabetized order\
\<!\-- ===== Element Type Definitions ===== \--\>\
alphabetized order\
\<!\-- ===== Attribute Type Definitions ===== \--\>\
alphabetized order\
\<!\-- ===== Copyright Notice ===== \--\>\
Required OASIS full copyright notice.

\[MDC2\] Mixed content MUST NOT be used except where contained in an
xsd:documentation element.

**2.3 Reusability**

\[ELD2\] All element declarations MUST be global

**2.4 Namespaces**

\[NMS1\] The UnitsML schema MUST have a namespace declared using the
xsd:targetNamespace attribute.

\[NMS2\] Every UnitsML schema version MUST have its own unique
namespace.

\[NMS3\] The UnitsML namespaces MUST only contain the UnitsML schema.

\[NMS4\] The namespace names for UnitsML Schemas holding committee draft
status MUST be of the form:\
urn:oasis:names:tc:unitsml:schema:\<subtype\>:\<document-id\>

\[F\] The namespace names for UnitsML Schemas holding OASIS Standard
status MUST be of the form:\
urn:oasis:names:specification:unitsml:schema:\<subtype\>:\<document-id\>

\[NMS6\] A published UnitsML namespace MUST never be changed.

\[SSM2\] A schema in a UnitsML namespace that is dependent upon type
definitions or element declarations defined in another namespace MUST
only import the document schema from that namespace.

**2.5 Versioning**

\[VER1\] Every UnitsML schema major version committee draft MUST have an
RFC 3121 conform document-id of the form:\
\<name\>-\<major\>.0\[.\<revision\>\]

\[VER2\] Every UnitsML schema major version OASIS Standard MUST have an
RFC3121 conform document-id of the form:\
\<name\>-\<major\>.0

\[VER3\] Every minor version release of a UnitsML schema draft MUST have
an RFC3121 conform document-id of the form:\
\<name\>-\<major \>.\<non-zero\>\[.\<revision\>\]

\[VER4\] Every minor version release of a UnitsML schema OASIS Standard
MUST have an RFC 3121 document-id of the form\
\<name\>-\<major \>.\<non-zero\>

\[VER5\] For UnitsML Minor version changes \<name\> MUST not change,

\[VER6\] Every UnitsML Schema major version number MUST be a
sequentially assigned, incremental number greater than zero.

\[VER7\] Every UnitsML Schema minor version number MUST be a
sequentially assigned, incremental non-negative integer.

**2.6 General Naming Rules**

\[GNR1\] UnitsML element, attribute, and type names MUST consist of at
least one word that MUST be in the English language, as found in the
Oxford English Dictionary (OED) (Latest Ed.). Where both American and
English spellings of the same word are provided, the American spelling
MUST be used.

\[GNR4\] UnitsML XML element, attribute, and simple and complex type
names MUST NOT use acronyms, abbreviations, or other word truncations,
except those in the list of exceptions published in Appendix A.

\[GNR5\] Acronyms and abbreviations MUST only be added to the UnitsML
approved acronym and abbreviation list after careful consideration for
maximum understanding and reuse.

\[GNR6\] The acronyms and abbreviations listed in Appendix A MUST always
be used.

\[GNR7\] UnitsML XML element and type names MUST be in singular form
unless the concept itself is plural.

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

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

\[GNR10\] Acronyms and abbreviations at the beginning of an attribute
declaration MUST appear in all lower case. All other acronym and
abbreviation usage in an attribute declaration MUST appear in upper
case.

\[GNR11\] Acronyms MUST appear in all upper case for all element
declarations and type definitions.

**2.7 Type Naming Rules**

\[GTD1\] All types MUST be named.

\[GTD2\] The xsd:anyType MUST NOT be used.

\[UnitsML-GTD1\] The UpperCamelCase (UCC) convention MUST be used for
naming types used in elements.

\[UnitsML-GTD2\] The lowerCamelCase (LCC) convention MUST be used for
naming types used in attributes.

**2.8 Element Declarations**

\[ELD6\] The code list xsd:import element MUST contain the namespace and
schema location attributes.

\[ELD7\] Empty elements MUST not be declared.

\[ELD9\] The xsd:any element MUST NOT be used.

**2.9 Attribute Declaration**

\[ATD6\] Each xsd:schemaLocation attribute declaration MUST contain a
resolvable URL.

\[ATD7\] The xsd built in nillable attribute MUST NOT be used for any
UnitsML declared element.

\[ATD8\] The xsd:anyAttribute MUST NOT be used.

**2.10 General Schema Rules**

\[GXS3\] Built-in XSD Simple Types SHOULD be used wherever possible.

\[GXS4\] All W3C XML Schema constructs in the UnitsML schema MUST
contain the following namespace declaration on the XSD schema element:\
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"

\[GXS5\] The xsd:substitutionGroup feature MUST NOT be used.

\[GXS7\] xsd:notation MUST NOT be used.

\[GXS8\] The xsd:all element MUST NOT be used.

\[GXS10\] The xsd:include feature MUST NOT be used.

**2.11 Instance Documents**

\[RED1\] Every UBL instance document must use the global element defined
as the root element in the schema as its root element.

\[ELD1\] Each UBL:DocumentSchema MUST identify one and only one global
element

declaration that defines the document
ccts:AggregateBusinessInformationEntity being conveyed in the

Schema expression. That global element MUST include an xsd:annotation
child

element which MUST further contain an xsd:documentation child element

that declares \"*This element MUST be conveyed as the root element*

*in any instance document based on this Schema expression.*\"

\[IND1\] All UnitsML instance documents MUST validate to the UnitsML
schema.

\[IND2\] All UnitsML instance documents MUST always identify their
character encoding with the XML declaration.

\[IND3\] In conformance with ISO/IETF/ITU/UNCEFACT Memorandum of
Understanding Management Group (MOUMG) Resolution 01/08 (MOU/MG01n83) as
agreed to by OASIS, UnitsML XML SHOULD be expressed using UTF-8.