From 5079123a94fa79c98038b0a396f3a7a62d1a2f4d Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Fri, 25 Jul 2025 21:47:46 +0500 Subject: [PATCH 01/15] Added liquid templates utilizing 'lutaml_xsd' command Added complex_type and attribute_groups templates and added simple_type as partial --- Gemfile | 14 +- sources/unitsml_xsd_docs/document.adoc | 17 + sources/unitsml_xsd_docs/document.html | 3597 +++++++++++++++++ .../sources/_attribute_groups.adoc | 44 + .../sources/_complex_type.adoc | 75 + .../unitsml_xsd_docs/sources/_elements.adoc | 40 + .../sources/_simple_type.liquid | 19 + 7 files changed, 3805 insertions(+), 1 deletion(-) create mode 100644 sources/unitsml_xsd_docs/document.adoc create mode 100644 sources/unitsml_xsd_docs/document.html create mode 100644 sources/unitsml_xsd_docs/sources/_attribute_groups.adoc create mode 100644 sources/unitsml_xsd_docs/sources/_complex_type.adoc create mode 100644 sources/unitsml_xsd_docs/sources/_elements.adoc create mode 100644 sources/unitsml_xsd_docs/sources/_simple_type.liquid diff --git a/Gemfile b/Gemfile index d47c6f5..c59a8c9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,16 @@ source "https://rubygems.org" +gem "lutaml", + github: "lutaml/lutaml", + branch: "update/xsd_support_metanorma_plugin" +gem "lutaml-model", + github: "lutaml/lutaml-model", + branch: "update/liquid_element_order" +gem "metanorma" gem "metanorma-cli" -# gem "metanorma-nist", source: "https://rubygems.pkg.github.com/metanorma" +gem "metanorma-plugin-lutaml", + github: "metanorma/metanorma-plugin-lutaml", + branch: "feature/unitsml_liquid_filters" +gem "metanorma-standoc", + github: "metanorma/metanorma-standoc", + branch: "update/lutaml_xsd_preprocessor_support" diff --git a/sources/unitsml_xsd_docs/document.adoc b/sources/unitsml_xsd_docs/document.adoc new file mode 100644 index 0000000..145d9af --- /dev/null +++ b/sources/unitsml_xsd_docs/document.adoc @@ -0,0 +1,17 @@ +[#top] += XSD Templates + +[lutaml_xsd, ../../unitsdb/unitsml-v1.0-csd04.xsd, schema] +---- +== Elements + +include::sources/_elements.adoc[] + +== Complex Types + +include::sources/_complex_type.adoc[] + +== Attribute Groups + +include::sources/_attribute_groups.adoc[] +---- diff --git a/sources/unitsml_xsd_docs/document.html b/sources/unitsml_xsd_docs/document.html new file mode 100644 index 0000000..ec7c555 --- /dev/null +++ b/sources/unitsml_xsd_docs/document.html @@ -0,0 +1,3597 @@ + + +XSD Templates + + + + + + + + + + + + + + +
+

Published

+
+ +
+

CalConnect Standard

+
+ +
+ +
+ + +
+
+ +
+
+ CC :2025 + +
+ +
+ XSD Templates + +
+
+ + + +
+ TC XXXX +
+ + + + + +
+ + +
+
+ +
+
+ CalConnect Standard +
+ +
+ +
+ + + + + + + +
+
+
+
+

+ + +
+

+ + + + +

XSD Templates

1.  Elements

1.1.  Element: UnitsML

+ + + +

1.1.2.  Description Container for UnitsML units, quantities, and prefixes.

+ +
<UnitsML>
  <UnitSet> ... </UnitSet> [0..1]
  <CountedItemSet> ... </CountedItemSet> [0..1]
  <QuantitySet> ... </QuantitySet> [0..1]
  <DimensionSet> ... </DimensionSet> [0..1]
  <PrefixSet> ... </PrefixSet> [0..1]
</UnitsML>

Figure 1 — XML Instance Representation

+ + +
<xsd:element name="UnitsML" type="UnitsMLType" />

Figure 2 — Schema Component Representation

+ + +
+

1.2.  Element: UnitSet

+ + + + + +

1.2.3.  Description Container for units. Use in UnitsML container or directly incorporate into a host schema.

+ +
<UnitSet>
  <Unit> ... </Unit> [1..*]
</UnitSet>

Figure 3 — XML Instance Representation

+ + +
<xsd:element name="UnitSet" type="UnitSetType" />

Figure 4 — Schema Component Representation

+ + +
+

1.3.  Element: Unit

+ + + + + +

1.3.3.  Description Element for describing units. Use in containers UnitSet or directly incorporate into a host schema.

+ +
<Unit
 xml:id="" [1]
 timeStamp="xsd:dateTime" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <UnitSystem> ... </UnitSystem> [0..*]
  <UnitName> ... </UnitName> [1..*]
  <UnitSymbol> ... </UnitSymbol> [0..*]
  <CodeListValue> ... </CodeListValue> [0..*]
  <RootUnits> ... </RootUnits> [0..1]
  <Conversions> ... </Conversions> [0..1]
  <QuantityReference> ... </QuantityReference> [0..*]
  <UnitVersionHistory> ... </UnitVersionHistory> [0..*]
  <UnitDefinition> ... </UnitDefinition> [0..*]
  <UnitHistory> ... </UnitHistory> [0..*]
  <UnitRemark> ... </UnitRemark> [0..*]
</Unit>

Figure 5 — XML Instance Representation

+ + +
<xsd:element name="Unit" type="UnitType" />

Figure 6 — Schema Component Representation

+ + +
+

1.4.  Element: UnitSystem

+ + + + + +

1.4.3.  Description Container for describing the system of units.

+ +
<UnitSystem
 name="xsd:token" [1]
 type="xsd:string" [0..1]
 xml:lang="" [0..1]
/>

Figure 7 — XML Instance Representation

+ + +
<xsd:element name="UnitSystem" type="SystemType" />

Figure 8 — Schema Component Representation

+ + +
+

1.5.  Element: UnitName

+ + + + + +

1.5.3.  Description Element containing the unit name.

+ +
<UnitName
 xml:lang="" [0..1]
>
  xsd:token
</UnitName>

Figure 9 — XML Instance Representation

+ + +
<xsd:element name="UnitName" type="NameType" />

Figure 10 — Schema Component Representation

+ + +
+

1.6.  Element: UnitSymbol

+ + + + + +

1.6.3.  Description Element containing various unit symbols. Examples include Aring (ASCII), Å (HTML).

+ +
<UnitSymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 11 — XML Instance Representation

+ + +
<xsd:element name="UnitSymbol" type="SymbolType" />

Figure 12 — Schema Component Representation

+ + +
+

1.7.  Element: UnitVersionHistory

+ + + + + +

1.7.3.  Description Element for descriptive information, including version changes to the unit.

+ +
<UnitVersionHistory
 xml:lang="" [0..1]
>
  xsd:string
</UnitVersionHistory>

Figure 13 — XML Instance Representation

+ + +
<xsd:element name="UnitVersionHistory" type="NoteType" />

Figure 14 — Schema Component Representation

+ + +
+

1.8.  Element: CodeListValue

+ + + + + +

1.8.3.  Description Element for listing the unit code value from a specific code list.

+ +
<CodeListValue
 unitCodeValue="xsd:string" [1]
 codeListName="xsd:normalizedString" [0..1]
 codeListVersion="xsd:token" [0..1]
 locationURL="xsd:anyURI" [0..1]
 organizationName="xsd:normalizedString" [0..1]
 organizationURI="xsd:anyURI" [0..1]
 xml:lang="" [0..1]
/>

Figure 15 — XML Instance Representation

+ + +
<xsd:element name="CodeListValue" type="CodeListValueType" />

Figure 16 — Schema Component Representation

+ + +
+

1.9.  Element: RootUnits

+ + + + + +

1.9.3.  Description Container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered root units.

+ +
<RootUnits>
  <EnumeratedRootUnit> ... </EnumeratedRootUnit> [0..*]
  <ExternalRootUnit> ... </ExternalRootUnit> [0..*]
</RootUnits>

Figure 17 — XML Instance Representation

+ + +
<xsd:element name="RootUnits" type="RootUnitsType" />

Figure 18 — Schema Component Representation

+ + +
+

1.10.  Element: EnumeratedRootUnit

+ + + + + +

1.10.3.  Description Element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2

+ +
<EnumeratedRootUnit
 unit="xsd:token (value comes from list: {'meter'|'gram'|'second'|'ampere'|'kelvin'|'mole'|'candela'|'radian'|'steradian'|'hertz'|'newton'|'pascal'|'joule'|'watt'|'coulomb'|'volt'|'farad'|'ohm'|'siemens'|'weber'|'tesla'|'henry'|'degree_Celsius'|'lumen'|'lux'|'katal'|'becquerel'|'gray'|'sievert'|'minute'|'hour'|'day'|'arc_degree'|'arc_minute'|'arc_second'|'liter'|'metric_ton'|'electronvolt'|'unified_atomic_mass_unit'|'astronomical_unit'|'atomic_unit_of_1st_hyperpolarizability'|'atomic_unit_of_2nd_hyperpolarizability'|'atomic_unit_of_action'|'atomic_unit_of_charge'|'atomic_unit_of_charge_density'|'atomic_unit_of_current'|'atomic_unit_of_electric_dipole_moment'|'atomic_unit_of_electric_field'|'atomic_unit_of_electric_field_gradient'|'atomic_unit_of_electric_polarizability'|'atomic_unit_of_electric_potential'|'atomic_unit_of_electric_quadrupole_moment'|'atomic_unit_of_energy'|'atomic_unit_of_force'|'atomic_unit_of_length'|'atomic_unit_of_magnetic_dipole_moment'|'atomic_unit_of_magnetic_flux_density'|'atomic_unit_of_magnetizability'|'atomic_unit_of_mass'|'atomic_unit_of_momentum'|'atomic_unit_of_permittivity'|'atomic_unit_of_time'|'atomic_unit_of_velocity'|'natural_unit_of_action'|'natural_unit_of_action_in_eV_s'|'natural_unit_of_energy'|'natural_unit_of_energy_in_MeV'|'natural_unit_of_length'|'natural_unit_of_mass'|'natural_unit_of_momentum'|'natural_unit_of_momentum_in_MeV_per_c'|'natural_unit_of_time'|'natural_unit_of_velocity'|'nautical_mile'|'knot'|'angstrom'|'are'|'hectare'|'barn'|'bar'|'gal'|'curie'|'roentgen'|'rad'|'rem'|'erg'|'dyne'|'barye'|'poise'|'rhe'|'stokes'|'darcy'|'kayser'|'lambert'|'phot'|'thermo_calorie'|'table_calorie'|'debye'|'abampere'|'abcoulomb'|'abfarad'|'abhenry'|'abohm'|'abmho'|'abvolt'|'abwatt'|'maxwell'|'gauss'|'gilbert'|'oersted'|'stilb'|'statampere'|'statcoulomb'|'statfarad'|'stathenry'|'statohm'|'statmho'|'statvolt'|'statwatt'|'statweber'|'stattesla'|'long_ton'|'short_ton'|'gross_hundredweight'|'hundredweight'|'av_pound'|'av_ounce'|'av_dram'|'troy_pound'|'troy_ounce'|'pennyweight'|'apothecaries_dram'|'scruple'|'grain'|'slug'|'pound_force'|'poundal'|'kip'|'ton_force'|'gram_force'|'inch'|'foot'|'yard'|'mile'|'us_survey_inch'|'us_survey_foot'|'us_survey_yard'|'us_survey_fathom'|'us_survey_rod'|'us_survey_chain'|'us_survey_link'|'us_survey_furlong'|'us_survey_mile'|'us_acre'|'imperial_gallon'|'imperial_quart'|'imperial_pint'|'imperial_gill'|'imperial_ounce'|'us_gallon'|'us_quart'|'us_pint'|'us_cup'|'us_gill'|'us_fluid_ounce'|'us_fluid_dram'|'us_minim'|'us_tablespoon'|'us_teaspoon'|'us_bushel'|'us_peck'|'us_dry_quart'|'us_dry_pint'|'thermo_kg_calorie'|'table_kg_calorie'|'us_label_teaspoon'|'us_label_tablespoon'|'us_label_cup'|'us_label_fluid_ounce'|'us_label_ounce'|'horsepower'|'electric_horsepower'|'boiler_horsepower'|'metric_horsepower'|'water_horsepower'|'uk_horsepower'|'degree_Fahrenheit'|'degree_Rankine'|'torr'|'standard_atmosphere'|'technical_atmosphere'|'mm_Hg'|'cm_Hg'|'0C_cm_Hg'|'in_Hg'|'32F_in_Hg'|'60F_in_Hg'|'ft_Hg'|'mm_water'|'cm_water'|'4C_cm_water'|'in_water'|'39F_in_water'|'60F_in_water'|'ft_water'|'39F_ft_water'|'light_year'|'light_week'|'light_hour'|'light_minute'|'light_second'|'parsec'|'printers_pica'|'computer_pica'|'printers_point'|'computer_point'|'thermo_btu'|'table_btu'|'mean_btu'|'39F_btu'|'59F_btu'|'60F_btu'|'tons_of_tnt'|'ec_therm'|'us_therm'|'year_365'|'tropical_year'|'sidereal_year'|'sidereal_day'|'sidereal_hour'|'sidereal_minute'|'sidereal_second'|'shake'|'denier'|'tex'|'gon'|'nato_mil'|'pound_mole'|'ton_refrigeration'|'circular_mil'|'bel'|'neper'|'pH'|'petro_barrel'|'footlambert'|'footcandle'|'carat'|'bit'|'byte'})" [1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 19 — XML Instance Representation

+ + +
<xsd:element name="EnumeratedRootUnit" type="EnumeratedRootUnitType" />

Figure 20 — Schema Component Representation

+ + +
+

1.11.  Element: ExternalRootUnit

+ + + + + +

1.11.3.  Description Element for those special cases where the root unit needed is not included in the enumerated list in the above element.

+ +
<ExternalRootUnit
 unit="xsd:anyURI" [1]
 annotation="xsd:string" [0..1]
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 21 — XML Instance Representation

+ + +
<xsd:element name="ExternalRootUnit" type="ExternalRootUnitType" />

Figure 22 — Schema Component Representation

+ + +
+

1.12.  Element: Conversions

+ + + + + +

1.12.3.  Description Container for providing conversion information to other units.

+ +
<Conversions>
  <Float64ConversionFrom> ... </Float64ConversionFrom> [0..*]
  <SpecialConversionFrom> ... </SpecialConversionFrom> [0..*]
  <WSDLConversionFrom> ... </WSDLConversionFrom> [0..*]
</Conversions>

Figure 23 — XML Instance Representation

+ + +
<xsd:element name="Conversions" type="ConversionsType" />

Figure 24 — Schema Component Representation

+ + +
+

1.13.  Element: Float64ConversionFrom

+ + + + + +

1.13.3.  Description Element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a))

+ +
<Float64ConversionFrom
 xml:id="" [1]
 initialAddend="xsd:double" [0..1]
 initialAddendDecimalPlace="xsd:byte" [0..1]
 multiplicand="xsd:double" [0..1]
 multiplicandDigits="xsd:unsignedByte" [0..1]
 divisor="xsd:double" [0..1]
 divisorDigits="xsd:unsignedByte" [0..1]
 finalAddend="xsd:double" [0..1]
 finalAddendDecimalPlace="xsd:byte" [0..1]
 exact="xsd:boolean" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionNote> ... </ConversionNote> [0..*]
</Float64ConversionFrom>

Figure 25 — XML Instance Representation

+ + +
<xsd:element name="Float64ConversionFrom" type="Float64ConversionFromType" />

Figure 26 — Schema Component Representation

+ + +
+

1.14.  Element: ConversionNote

+ + + + + +

1.14.3.  Description Element for descriptive information.

+ +
<ConversionNote
 xml:lang="" [0..1]
>
  xsd:string
</ConversionNote>

Figure 27 — XML Instance Representation

+ + +
<xsd:element name="ConversionNote" type="NoteType" />

Figure 28 — Schema Component Representation

+ + +
+

1.15.  Element: SpecialConversionFrom

+ + + + + +

1.15.3.  Description Element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation.

+ +
<SpecialConversionFrom
 xml:id="" [1]
 conversionURL="xsd:anyURI" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionDescription> ... </ConversionDescription> [0..*]
</SpecialConversionFrom>

Figure 29 — XML Instance Representation

+ + +
<xsd:element name="SpecialConversionFrom" type="SpecialConversionFromType" />

Figure 30 — Schema Component Representation

+ + +
+

1.16.  Element: WSDLConversionFrom

+ + + + + +

1.16.3.  Description Element for providing conversion based on SOAP/WSDL calls to a remote server.

+ +
<WSDLConversionFrom
 xml:id="" [1]
 wsdlURL="xsd:anyURI" [1]
 initialUnit="xsd:anyURI" [1]
>
  <WSDLDescription> ... </WSDLDescription> [0..*]
</WSDLConversionFrom>

Figure 31 — XML Instance Representation

+ + +
<xsd:element name="WSDLConversionFrom" type="WSDLConversionFromType" />

Figure 32 — Schema Component Representation

+ + +
+

1.17.  Element: WSDLDescription

+ + + + + +

1.17.3.  Description Element to describe the WSDL service.

+ +
<WSDLDescription
 xml:lang="" [0..1]
>
  xsd:string
</WSDLDescription>

Figure 33 — XML Instance Representation

+ + +
<xsd:element name="WSDLDescription" type="NoteType" />

Figure 34 — Schema Component Representation

+ + +
+

1.18.  Element: ConversionDescription

+ + + + + +

1.18.3.  Description Element for a description of the SpecialConversionFrom.

+ +
<ConversionDescription
 xml:lang="" [0..1]
>
  xsd:string
</ConversionDescription>

Figure 35 — XML Instance Representation

+ + +
<xsd:element name="ConversionDescription" type="NoteType" />

Figure 36 — Schema Component Representation

+ + +
+

1.19.  Element: QuantityReference

+ + + + + +

1.19.3.  Description Element for all quantities that can be expressed using this unit.

+ +
<QuantityReference
 url="xsd:anyURI" [1]
 name="xsd:token" [0..1]
 xml:lang="" [0..1]
/>

Figure 37 — XML Instance Representation

+ + +
<xsd:element name="QuantityReference" type="ReferenceType" />

Figure 38 — Schema Component Representation

+ + +
+

1.20.  Element: UnitDefinition

+ + + + + +

1.20.3.  Description Element to describe the definition of the unit.

+ +
<UnitDefinition
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</UnitDefinition>

Figure 39 — XML Instance Representation

+ + +
<xsd:element name="UnitDefinition" type="DefinitionType" />

Figure 40 — Schema Component Representation

+ + +
+

1.21.  Element: UnitHistory

+ + + + + +

1.21.3.  Description Element to describe the historical development of the unit.

+ +
<UnitHistory
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</UnitHistory>

Figure 41 — XML Instance Representation

+ + +
<xsd:element name="UnitHistory" type="HistoryType" />

Figure 42 — Schema Component Representation

+ + +
+

1.22.  Element: UnitRemark

+ + + + + +

1.22.3.  Description Element as a placeholder for additional information.

+ +
<UnitRemark
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</UnitRemark>

Figure 43 — XML Instance Representation

+ + +
<xsd:element name="UnitRemark" type="RemarkType" />

Figure 44 — Schema Component Representation

+ + +
+

1.23.  Element: CountedItemSet

+ + + + + +

1.23.3.  Description Container for items that are counted and are (in practice) combined with scientific units of measure.

+ +
<CountedItemSet>
  <CountedItem> ... </CountedItem> [1..*]
</CountedItemSet>

Figure 45 — XML Instance Representation

+ + +
<xsd:element name="CountedItemSet" type="CountedItemSetType" />

Figure 46 — Schema Component Representation

+ + +
+

1.24.  Element: CountedItem

+ + + + + +

1.24.3.  Description Container for a single counted item.

+ +
<CountedItem
 xml:id="" [1]
>
  <ItemName> ... </ItemName> [1..*]
  <ItemSymbol> ... </ItemSymbol> [0..*]
  <ItemVersionHistory> ... </ItemVersionHistory> [0..*]
  <ItemDefinition> ... </ItemDefinition> [0..*]
  <ItemHistory> ... </ItemHistory> [0..*]
  <ItemRemark> ... </ItemRemark> [0..*]
</CountedItem>

Figure 47 — XML Instance Representation

+ + +
<xsd:element name="CountedItem" type="CountedItemType" />

Figure 48 — Schema Component Representation

+ + +
+

1.25.  Element: ItemName

+ + + + + +

1.25.3.  Description Element containing the item name(s).

+ +
<ItemName
 xml:lang="" [0..1]
>
  xsd:token
</ItemName>

Figure 49 — XML Instance Representation

+ + +
<xsd:element name="ItemName" type="NameType" />

Figure 50 — Schema Component Representation

+ + +
+

1.26.  Element: ItemSymbol

+ + + + + +

1.26.3.  Description Element containing symbols for the item.

+ +
<ItemSymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 51 — XML Instance Representation

+ + +
<xsd:element name="ItemSymbol" type="SymbolType" />

Figure 52 — Schema Component Representation

+ + +
+

1.27.  Element: ItemVersionHistory

+ + + + + +

1.27.3.  Description Element for descriptive information, including version changes to the item.

+ +
<ItemVersionHistory
 xml:lang="" [0..1]
>
  xsd:string
</ItemVersionHistory>

Figure 53 — XML Instance Representation

+ + +
<xsd:element name="ItemVersionHistory" type="NoteType" />

Figure 54 — Schema Component Representation

+ + +
+

1.28.  Element: ItemDefinition

+ + + + + +

1.28.3.  Description Element to describe the definition of the item.

+ +
<ItemDefinition
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</ItemDefinition>

Figure 55 — XML Instance Representation

+ + +
<xsd:element name="ItemDefinition" type="DefinitionType" />

Figure 56 — Schema Component Representation

+ + +
+

1.29.  Element: ItemHistory

+ + + + + +

1.29.3.  Description Element to describe the historical development of the item.

+ +
<ItemHistory
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</ItemHistory>

Figure 57 — XML Instance Representation

+ + +
<xsd:element name="ItemHistory" type="HistoryType" />

Figure 58 — Schema Component Representation

+ + +
+

1.30.  Element: ItemRemark

+ + + + + +

1.30.3.  Description Element as a placeholder for additional information.

+ +
<ItemRemark
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</ItemRemark>

Figure 59 — XML Instance Representation

+ + +
<xsd:element name="ItemRemark" type="RemarkType" />

Figure 60 — Schema Component Representation

+ + +
+

1.31.  Element: QuantitySet

+ + + + + +

1.31.3.  Description Container for quantities.

+ +
<QuantitySet>
  <Quantity> ... </Quantity> [1..*]
</QuantitySet>

Figure 61 — XML Instance Representation

+ + +
<xsd:element name="QuantitySet" type="QuantitySetType" />

Figure 62 — Schema Component Representation

+ + +
+

1.32.  Element: Quantity

+ + + + + +

1.32.3.  Description Element for describing quantities and referencing corresponding units. Use in container or directly incorporate into a host schema.

+ +
<Quantity
 xml:id="" [1]
 quantityType="xsd:token (value comes from list: {'base'|'derived'})" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <QuantityName> ... </QuantityName> [1..*]
  <QuantitySymbol> ... </QuantitySymbol> [0..*]
  <UnitReference> ... </UnitReference> [0..*]
  <QuantityVersionHistory> ... </QuantityVersionHistory> [0..*]
  <QuantityDefinition> ... </QuantityDefinition> [0..*]
  <QuantityHistory> ... </QuantityHistory> [0..*]
  <QuantityRemark> ... </QuantityRemark> [0..*]
</Quantity>

Figure 63 — XML Instance Representation

+ + +
<xsd:element name="Quantity" type="QuantityType" />

Figure 64 — Schema Component Representation

+ + +
+

1.33.  Element: QuantityName

+ + + + + +

1.33.3.  Description Element containing the quantity name.

+ +
<QuantityName
 xml:lang="" [0..1]
>
  xsd:token
</QuantityName>

Figure 65 — XML Instance Representation

+ + +
<xsd:element name="QuantityName" type="NameType" />

Figure 66 — Schema Component Representation

+ + +
+

1.34.  Element: QuantitySymbol

+ + + + + +

1.34.3.  Description Element containing various quantity symbols.

+ +
<QuantitySymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 67 — XML Instance Representation

+ + +
<xsd:element name="QuantitySymbol" type="SymbolType" />

Figure 68 — Schema Component Representation

+ + +
+

1.35.  Element: UnitReference

+ + + + + +

1.35.3.  Description Element for referencing a unit of measure from within the Quantity element.

+ +
<UnitReference
 url="xsd:anyURI" [1]
 name="xsd:token" [0..1]
 xml:lang="" [0..1]
/>

Figure 69 — XML Instance Representation

+ + +
<xsd:element name="UnitReference" type="ReferenceType" />

Figure 70 — Schema Component Representation

+ + +
+

1.36.  Element: QuantityVersionHistory

+ + + + + +

1.36.3.  Description Element for descriptive information, including version changes to the unit.

+ +
<QuantityVersionHistory
 xml:lang="" [0..1]
>
  xsd:string
</QuantityVersionHistory>

Figure 71 — XML Instance Representation

+ + +
<xsd:element name="QuantityVersionHistory" type="NoteType" />

Figure 72 — Schema Component Representation

+ + +
+

1.37.  Element: QuantityDefinition

+ + + + + +

1.37.3.  Description Element to describe the definition of the quantity.

+ +
<QuantityDefinition
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</QuantityDefinition>

Figure 73 — XML Instance Representation

+ + +
<xsd:element name="QuantityDefinition" type="DefinitionType" />

Figure 74 — Schema Component Representation

+ + +
+

1.38.  Element: QuantityHistory

+ + + + + +

1.38.3.  Description Element to describe the historical development of the quantity.

+ +
<QuantityHistory
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</QuantityHistory>

Figure 75 — XML Instance Representation

+ + +
<xsd:element name="QuantityHistory" type="HistoryType" />

Figure 76 — Schema Component Representation

+ + +
+

1.39.  Element: QuantityRemark

+ + + + + +

1.39.3.  Description Element as a placeholder for additional information.

+ +
<QuantityRemark
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</QuantityRemark>

Figure 77 — XML Instance Representation

+ + +
<xsd:element name="QuantityRemark" type="RemarkType" />

Figure 78 — Schema Component Representation

+ + +
+

1.40.  Element: DimensionSet

+ + + + + +

1.40.3.  Description Container for dimensions.

+ +
<DimensionSet>
  <Dimension> ... </Dimension> [1..*]
</DimensionSet>

Figure 79 — XML Instance Representation

+ + +
<xsd:element name="DimensionSet" type="DimensionSetType" />

Figure 80 — Schema Component Representation

+ + +
+

1.41.  Element: Dimension

+ + + + + +

1.41.3.  Description Element to express the dimension of a unit or quantity in terms of the SI base quantities length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity.

+ +
<Dimension
 xml:id="" [1]
 dimensionless="xsd:boolean" [0..1]
>
  <Length> ... </Length> [0..1]
  <Mass> ... </Mass> [0..1]
  <Time> ... </Time> [0..1]
  <ElectricCurrent> ... </ElectricCurrent> [0..1]
  <ThermodynamicTemperature> ... </ThermodynamicTemperature> [0..1]
  <AmountOfSubstance> ... </AmountOfSubstance> [0..1]
  <LuminousIntensity> ... </LuminousIntensity> [0..1]
  <PlaneAngle> ... </PlaneAngle> [0..1]
  <Item> ... </Item> [0..*]
</Dimension>

Figure 81 — XML Instance Representation

+ + +
<xsd:element name="Dimension" type="DimensionType" />

Figure 82 — Schema Component Representation

+ + +
+

1.42.  Element: Length

+ + + + + +

1.42.3.  Description Element containing the dimension of the quantity length.

+ +
<Length
 symbol="L" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 83 — XML Instance Representation

+ + +
<xsd:element name="Length" type="LengthType" />

Figure 84 — Schema Component Representation

+ + +
+

1.43.  Element: Mass

+ + + + + +

1.43.3.  Description Element containing the dimension of the quantity mass.

+ +
<Mass
 symbol="M" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 85 — XML Instance Representation

+ + +
<xsd:element name="Mass" type="MassType" />

Figure 86 — Schema Component Representation

+ + +
+

1.44.  Element: Time

+ + + + + +

1.44.3.  Description Element containing the dimension of the quantity time.

+ +
<Time
 symbol="T" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 87 — XML Instance Representation

+ + +
<xsd:element name="Time" type="TimeType" />

Figure 88 — Schema Component Representation

+ + +
+

1.45.  Element: ElectricCurrent

+ + + + + +

1.45.3.  Description Element containing the dimension of the quantity electric current.

+ +
<ElectricCurrent
 symbol="I" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 89 — XML Instance Representation

+ + +
<xsd:element name="ElectricCurrent" type="ElectricCurrentType" />

Figure 90 — Schema Component Representation

+ + +
+

1.46.  Element: ThermodynamicTemperature

+ + + + + +

1.46.3.  Description Element containing the dimension of the quantity thermodynamic temerature.

+ +
<ThermodynamicTemperature
 symbol="Θ" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 91 — XML Instance Representation

+ + +
<xsd:element name="ThermodynamicTemperature" type="ThermodynamicTemperatureType" />

Figure 92 — Schema Component Representation

+ + +
+

1.47.  Element: AmountOfSubstance

+ + + + + +

1.47.3.  Description Element containing the dimension of the quantity amount of substance.

+ +
<AmountOfSubstance
 symbol="N" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 93 — XML Instance Representation

+ + +
<xsd:element name="AmountOfSubstance" type="AmountOfSubstanceType" />

Figure 94 — Schema Component Representation

+ + +
+

1.48.  Element: LuminousIntensity

+ + + + + +

1.48.3.  Description Element containing the dimension of the quantity luminous intensity.

+ +
<LuminousIntensity
 symbol="J" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 95 — XML Instance Representation

+ + +
<xsd:element name="LuminousIntensity" type="LuminousIntensityType" />

Figure 96 — Schema Component Representation

+ + +
+

1.49.  Element: PlaneAngle

+ + + + + +

1.49.3.  Description Element containing the dimension of the quantity plane angle.

+ +
<PlaneAngle
 symbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 97 — XML Instance Representation

+ + +
<xsd:element name="PlaneAngle" type="PlaneAngleType" />

Figure 98 — Schema Component Representation

+ + +
+

1.50.  Element: Item

+ + + + + +

1.50.3.  Description Element containing the dimension of any item. Note: this element is meant to be used to allow counted items to be included in the dimensioning of a derived quantity, e.g., electrons per time; usage of this element does not conform to the SI description of the dimension of a quantity in terms of seven base quantities.

+ +
<Item
 itemURL="xsd:anyURI" [1]
 itemSymbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 99 — XML Instance Representation

+ + +
<xsd:element name="Item" type="ItemType" />

Figure 100 — Schema Component Representation

+ + +
+

1.51.  Element: PrefixSet

+ + + + + +

1.51.3.  Description Container for prefixes.

+ +
<PrefixSet>
  <Prefix> ... </Prefix> [1..*]
</PrefixSet>

Figure 101 — XML Instance Representation

+ + +
<xsd:element name="PrefixSet" type="PrefixSetType" />

Figure 102 — Schema Component Representation

+ + +
+

1.52.  Element: Prefix

+ + + + + +

1.52.3.  Description Element containing information about a prefix.

+ +
<Prefix
 xml:id="" [1]
 prefixBase="xsd:byte (value comes from list: {'10'|'2'})" [0..1]
 prefixPower="xsd:byte" [0..1]
>
  <PrefixName> ... </PrefixName> [1..*]
  <PrefixSymbol> ... </PrefixSymbol> [0..*]
</Prefix>

Figure 103 — XML Instance Representation

+ + +
<xsd:element name="Prefix" type="PrefixType" />

Figure 104 — Schema Component Representation

+ + +
+

1.53.  Element: PrefixName

+ + + + + +

1.53.3.  Description Element containing the prefix name.

+ +
<PrefixName
 xml:lang="" [0..1]
>
  xsd:token
</PrefixName>

Figure 105 — XML Instance Representation

+ + +
<xsd:element name="PrefixName" type="NameType" />

Figure 106 — Schema Component Representation

+ + +
+

1.54.  Element: PrefixSymbol

+ + + + + +

1.54.3.  Description Element containing prefix symbols.

+ +
<PrefixSymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 107 — XML Instance Representation

+ + +
<xsd:element name="PrefixSymbol" type="SymbolType" />

Figure 108 — Schema Component Representation

+ + +
+

2.  Complex Types

2.1.  Complex Type: UnitsMLType

+ +

2.1.1.  Used By UnitsML

+ +

Description ComplexType for the root element of an UnitsML document.

+ +
<...>
  <UnitSet> ... </UnitSet> [0..1]
  <CountedItemSet> ... </CountedItemSet> [0..1]
  <QuantitySet> ... </QuantitySet> [0..1]
  <DimensionSet> ... </DimensionSet> [0..1]
  <PrefixSet> ... </PrefixSet> [0..1]
</...>

Figure 109 — XML Instance Representation

+ + +
<xsd:complexType name="UnitsMLType">
  <xsd:sequence>
    <xsd:element ref="UnitSet" minOccurs="0"/>
    <xsd:element ref="CountedItemSet" minOccurs="0"/>
    <xsd:element ref="QuantitySet" minOccurs="0"/>
    <xsd:element ref="DimensionSet" minOccurs="0"/>
    <xsd:element ref="PrefixSet" minOccurs="0"/>
  </xsd:sequence>
</xsd:complexType>

Figure 110 — Schema Component Representation

+ + +
+

2.2.  Complex Type: UnitSetType

+ +

2.2.1.  Used By UnitSet

+ +

Description Type for the unit container.

+ +
<...>
  <Unit> ... </Unit> [1..*]
</...>

Figure 111 — XML Instance Representation

+ + +
<xsd:complexType name="UnitSetType">
  <xsd:sequence>
    <xsd:element ref="Unit" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 112 — Schema Component Representation

+ + +
+

2.3.  Complex Type: UnitType

+ +

2.3.1.  Used By Unit

+ +

Description Type for the unit.

+ +
<...
 xml:id="" [1]
 timeStamp="xsd:dateTime" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <UnitSystem> ... </UnitSystem> [0..*]
  <UnitName> ... </UnitName> [1..*]
  <UnitSymbol> ... </UnitSymbol> [0..*]
  <CodeListValue> ... </CodeListValue> [0..*]
  <RootUnits> ... </RootUnits> [0..1]
  <Conversions> ... </Conversions> [0..1]
  <QuantityReference> ... </QuantityReference> [0..*]
  <UnitVersionHistory> ... </UnitVersionHistory> [0..*]
  <UnitDefinition> ... </UnitDefinition> [0..*]
  <UnitHistory> ... </UnitHistory> [0..*]
  <UnitRemark> ... </UnitRemark> [0..*]
</...>

Figure 113 — XML Instance Representation

+ + +
<xsd:complexType name="UnitType">
  <xsd:sequence>
    <xsd:element ref="UnitSystem" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitName" maxOccurs="unbounded"/>
    <xsd:element ref="UnitSymbol" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="CodeListValue" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="RootUnits" minOccurs="0"/>
    <xsd:element ref="Conversions" minOccurs="0"/>
    <xsd:element ref="QuantityReference" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitVersionHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitDefinition" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitRemark" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="timeStamp" type="xsd:dateTime" use="optional"/>
  <xsd:attributeGroup ref="dimensionURL"/>
</xsd:complexType>

Figure 114 — Schema Component Representation

+ + +
+

2.4.  Complex Type: CodeListValueType

+ +

2.4.1.  Used By CodeListValue

+ +

Description Type for the element for listing the unit code value from a specific code list.

+ +
<...
 unitCodeValue="xsd:string" [1]
 codeListName="xsd:normalizedString" [0..1]
 codeListVersion="xsd:token" [0..1]
 locationURL="xsd:anyURI" [0..1]
 organizationName="xsd:normalizedString" [0..1]
 organizationURI="xsd:anyURI" [0..1]
 xml:lang="" [0..1]
/>

Figure 115 — XML Instance Representation

+ + +
<xsd:complexType name="CodeListValueType">
  <xsd:attribute name="unitCodeValue" type="xsd:string" use="required"/>
  <xsd:attribute name="codeListName" type="xsd:normalizedString" use="optional"/>
  <xsd:attribute name="codeListVersion" type="xsd:token" use="optional"/>
  <xsd:attribute name="locationURL" type="xsd:anyURI" use="optional"/>
  <xsd:attribute name="organizationName" type="xsd:normalizedString" use="optional"/>
  <xsd:attribute name="organizationURI" type="xsd:anyURI" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
</xsd:complexType>

Figure 116 — Schema Component Representation

+ + +
+

2.5.  Complex Type: RootUnitsType

+ +

2.5.1.  Used By RootUnits

+ +

Description Type for the container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered base units.

+ +
<...>
  <EnumeratedRootUnit> ... </EnumeratedRootUnit> [0..*]
  <ExternalRootUnit> ... </ExternalRootUnit> [0..*]
</...>

Figure 117 — XML Instance Representation

+ + +
<xsd:complexType name="RootUnitsType">
  <xsd:sequence>
    <xsd:element ref="EnumeratedRootUnit" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ExternalRootUnit" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 118 — Schema Component Representation

+ + +
+

2.6.  Complex Type: EnumeratedRootUnitType

+ +

2.6.1.  Used By EnumeratedRootUnit

+ +

Description Type for the element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2

+ +
<...
 unit="xsd:token (value comes from list: {'meter'|'gram'|'second'|'ampere'|'kelvin'|'mole'|'candela'|'radian'|'steradian'|'hertz'|'newton'|'pascal'|'joule'|'watt'|'coulomb'|'volt'|'farad'|'ohm'|'siemens'|'weber'|'tesla'|'henry'|'degree_Celsius'|'lumen'|'lux'|'katal'|'becquerel'|'gray'|'sievert'|'minute'|'hour'|'day'|'arc_degree'|'arc_minute'|'arc_second'|'liter'|'metric_ton'|'electronvolt'|'unified_atomic_mass_unit'|'astronomical_unit'|'atomic_unit_of_1st_hyperpolarizability'|'atomic_unit_of_2nd_hyperpolarizability'|'atomic_unit_of_action'|'atomic_unit_of_charge'|'atomic_unit_of_charge_density'|'atomic_unit_of_current'|'atomic_unit_of_electric_dipole_moment'|'atomic_unit_of_electric_field'|'atomic_unit_of_electric_field_gradient'|'atomic_unit_of_electric_polarizability'|'atomic_unit_of_electric_potential'|'atomic_unit_of_electric_quadrupole_moment'|'atomic_unit_of_energy'|'atomic_unit_of_force'|'atomic_unit_of_length'|'atomic_unit_of_magnetic_dipole_moment'|'atomic_unit_of_magnetic_flux_density'|'atomic_unit_of_magnetizability'|'atomic_unit_of_mass'|'atomic_unit_of_momentum'|'atomic_unit_of_permittivity'|'atomic_unit_of_time'|'atomic_unit_of_velocity'|'natural_unit_of_action'|'natural_unit_of_action_in_eV_s'|'natural_unit_of_energy'|'natural_unit_of_energy_in_MeV'|'natural_unit_of_length'|'natural_unit_of_mass'|'natural_unit_of_momentum'|'natural_unit_of_momentum_in_MeV_per_c'|'natural_unit_of_time'|'natural_unit_of_velocity'|'nautical_mile'|'knot'|'angstrom'|'are'|'hectare'|'barn'|'bar'|'gal'|'curie'|'roentgen'|'rad'|'rem'|'erg'|'dyne'|'barye'|'poise'|'rhe'|'stokes'|'darcy'|'kayser'|'lambert'|'phot'|'thermo_calorie'|'table_calorie'|'debye'|'abampere'|'abcoulomb'|'abfarad'|'abhenry'|'abohm'|'abmho'|'abvolt'|'abwatt'|'maxwell'|'gauss'|'gilbert'|'oersted'|'stilb'|'statampere'|'statcoulomb'|'statfarad'|'stathenry'|'statohm'|'statmho'|'statvolt'|'statwatt'|'statweber'|'stattesla'|'long_ton'|'short_ton'|'gross_hundredweight'|'hundredweight'|'av_pound'|'av_ounce'|'av_dram'|'troy_pound'|'troy_ounce'|'pennyweight'|'apothecaries_dram'|'scruple'|'grain'|'slug'|'pound_force'|'poundal'|'kip'|'ton_force'|'gram_force'|'inch'|'foot'|'yard'|'mile'|'us_survey_inch'|'us_survey_foot'|'us_survey_yard'|'us_survey_fathom'|'us_survey_rod'|'us_survey_chain'|'us_survey_link'|'us_survey_furlong'|'us_survey_mile'|'us_acre'|'imperial_gallon'|'imperial_quart'|'imperial_pint'|'imperial_gill'|'imperial_ounce'|'us_gallon'|'us_quart'|'us_pint'|'us_cup'|'us_gill'|'us_fluid_ounce'|'us_fluid_dram'|'us_minim'|'us_tablespoon'|'us_teaspoon'|'us_bushel'|'us_peck'|'us_dry_quart'|'us_dry_pint'|'thermo_kg_calorie'|'table_kg_calorie'|'us_label_teaspoon'|'us_label_tablespoon'|'us_label_cup'|'us_label_fluid_ounce'|'us_label_ounce'|'horsepower'|'electric_horsepower'|'boiler_horsepower'|'metric_horsepower'|'water_horsepower'|'uk_horsepower'|'degree_Fahrenheit'|'degree_Rankine'|'torr'|'standard_atmosphere'|'technical_atmosphere'|'mm_Hg'|'cm_Hg'|'0C_cm_Hg'|'in_Hg'|'32F_in_Hg'|'60F_in_Hg'|'ft_Hg'|'mm_water'|'cm_water'|'4C_cm_water'|'in_water'|'39F_in_water'|'60F_in_water'|'ft_water'|'39F_ft_water'|'light_year'|'light_week'|'light_hour'|'light_minute'|'light_second'|'parsec'|'printers_pica'|'computer_pica'|'printers_point'|'computer_point'|'thermo_btu'|'table_btu'|'mean_btu'|'39F_btu'|'59F_btu'|'60F_btu'|'tons_of_tnt'|'ec_therm'|'us_therm'|'year_365'|'tropical_year'|'sidereal_year'|'sidereal_day'|'sidereal_hour'|'sidereal_minute'|'sidereal_second'|'shake'|'denier'|'tex'|'gon'|'nato_mil'|'pound_mole'|'ton_refrigeration'|'circular_mil'|'bel'|'neper'|'pH'|'petro_barrel'|'footlambert'|'footcandle'|'carat'|'bit'|'byte'})" [1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 119 — XML Instance Representation

+ + +
<xsd:complexType name="EnumeratedRootUnitType">
  <xsd:attribute name="unit" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="meter"/>
        <xsd:enumeration value="gram"/>
        <xsd:enumeration value="second"/>
        <xsd:enumeration value="ampere"/>
        <xsd:enumeration value="kelvin"/>
        <xsd:enumeration value="mole"/>
        <xsd:enumeration value="candela"/>
        <xsd:enumeration value="radian"/>
        <xsd:enumeration value="steradian"/>
        <xsd:enumeration value="hertz"/>
        <xsd:enumeration value="newton"/>
        <xsd:enumeration value="pascal"/>
        <xsd:enumeration value="joule"/>
        <xsd:enumeration value="watt"/>
        <xsd:enumeration value="coulomb"/>
        <xsd:enumeration value="volt"/>
        <xsd:enumeration value="farad"/>
        <xsd:enumeration value="ohm"/>
        <xsd:enumeration value="siemens"/>
        <xsd:enumeration value="weber"/>
        <xsd:enumeration value="tesla"/>
        <xsd:enumeration value="henry"/>
        <xsd:enumeration value="degree_Celsius"/>
        <xsd:enumeration value="lumen"/>
        <xsd:enumeration value="lux"/>
        <xsd:enumeration value="katal"/>
        <xsd:enumeration value="becquerel"/>
        <xsd:enumeration value="gray"/>
        <xsd:enumeration value="sievert"/>
        <xsd:enumeration value="minute"/>
        <xsd:enumeration value="hour"/>
        <xsd:enumeration value="day"/>
        <xsd:enumeration value="arc_degree"/>
        <xsd:enumeration value="arc_minute"/>
        <xsd:enumeration value="arc_second"/>
        <xsd:enumeration value="liter"/>
        <xsd:enumeration value="metric_ton"/>
        <xsd:enumeration value="electronvolt"/>
        <xsd:enumeration value="unified_atomic_mass_unit"/>
        <xsd:enumeration value="astronomical_unit"/>
        <xsd:enumeration value="atomic_unit_of_1st_hyperpolarizability"/>
        <xsd:enumeration value="atomic_unit_of_2nd_hyperpolarizability"/>
        <xsd:enumeration value="atomic_unit_of_action"/>
        <xsd:enumeration value="atomic_unit_of_charge"/>
        <xsd:enumeration value="atomic_unit_of_charge_density"/>
        <xsd:enumeration value="atomic_unit_of_current"/>
        <xsd:enumeration value="atomic_unit_of_electric_dipole_moment"/>
        <xsd:enumeration value="atomic_unit_of_electric_field"/>
        <xsd:enumeration value="atomic_unit_of_electric_field_gradient"/>
        <xsd:enumeration value="atomic_unit_of_electric_polarizability"/>
        <xsd:enumeration value="atomic_unit_of_electric_potential"/>
        <xsd:enumeration value="atomic_unit_of_electric_quadrupole_moment"/>
        <xsd:enumeration value="atomic_unit_of_energy"/>
        <xsd:enumeration value="atomic_unit_of_force"/>
        <xsd:enumeration value="atomic_unit_of_length"/>
        <xsd:enumeration value="atomic_unit_of_magnetic_dipole_moment"/>
        <xsd:enumeration value="atomic_unit_of_magnetic_flux_density"/>
        <xsd:enumeration value="atomic_unit_of_magnetizability"/>
        <xsd:enumeration value="atomic_unit_of_mass"/>
        <xsd:enumeration value="atomic_unit_of_momentum"/>
        <xsd:enumeration value="atomic_unit_of_permittivity"/>
        <xsd:enumeration value="atomic_unit_of_time"/>
        <xsd:enumeration value="atomic_unit_of_velocity"/>
        <xsd:enumeration value="natural_unit_of_action"/>
        <xsd:enumeration value="natural_unit_of_action_in_eV_s"/>
        <xsd:enumeration value="natural_unit_of_energy"/>
        <xsd:enumeration value="natural_unit_of_energy_in_MeV"/>
        <xsd:enumeration value="natural_unit_of_length"/>
        <xsd:enumeration value="natural_unit_of_mass"/>
        <xsd:enumeration value="natural_unit_of_momentum"/>
        <xsd:enumeration value="natural_unit_of_momentum_in_MeV_per_c"/>
        <xsd:enumeration value="natural_unit_of_time"/>
        <xsd:enumeration value="natural_unit_of_velocity"/>
        <xsd:enumeration value="nautical_mile"/>
        <xsd:enumeration value="knot"/>
        <xsd:enumeration value="angstrom"/>
        <xsd:enumeration value="are"/>
        <xsd:enumeration value="hectare"/>
        <xsd:enumeration value="barn"/>
        <xsd:enumeration value="bar"/>
        <xsd:enumeration value="gal"/>
        <xsd:enumeration value="curie"/>
        <xsd:enumeration value="roentgen"/>
        <xsd:enumeration value="rad"/>
        <xsd:enumeration value="rem"/>
        <xsd:enumeration value="erg"/>
        <xsd:enumeration value="dyne"/>
        <xsd:enumeration value="barye"/>
        <xsd:enumeration value="poise"/>
        <xsd:enumeration value="rhe"/>
        <xsd:enumeration value="stokes"/>
        <xsd:enumeration value="darcy"/>
        <xsd:enumeration value="kayser"/>
        <xsd:enumeration value="lambert"/>
        <xsd:enumeration value="phot"/>
        <xsd:enumeration value="thermo_calorie"/>
        <xsd:enumeration value="table_calorie"/>
        <xsd:enumeration value="debye"/>
        <xsd:enumeration value="abampere"/>
        <xsd:enumeration value="abcoulomb"/>
        <xsd:enumeration value="abfarad"/>
        <xsd:enumeration value="abhenry"/>
        <xsd:enumeration value="abohm"/>
        <xsd:enumeration value="abmho"/>
        <xsd:enumeration value="abvolt"/>
        <xsd:enumeration value="abwatt"/>
        <xsd:enumeration value="maxwell"/>
        <xsd:enumeration value="gauss"/>
        <xsd:enumeration value="gilbert"/>
        <xsd:enumeration value="oersted"/>
        <xsd:enumeration value="stilb"/>
        <xsd:enumeration value="statampere"/>
        <xsd:enumeration value="statcoulomb"/>
        <xsd:enumeration value="statfarad"/>
        <xsd:enumeration value="stathenry"/>
        <xsd:enumeration value="statohm"/>
        <xsd:enumeration value="statmho"/>
        <xsd:enumeration value="statvolt"/>
        <xsd:enumeration value="statwatt"/>
        <xsd:enumeration value="statweber"/>
        <xsd:enumeration value="stattesla"/>
        <xsd:enumeration value="long_ton"/>
        <xsd:enumeration value="short_ton"/>
        <xsd:enumeration value="gross_hundredweight"/>
        <xsd:enumeration value="hundredweight"/>
        <xsd:enumeration value="av_pound"/>
        <xsd:enumeration value="av_ounce"/>
        <xsd:enumeration value="av_dram"/>
        <xsd:enumeration value="troy_pound"/>
        <xsd:enumeration value="troy_ounce"/>
        <xsd:enumeration value="pennyweight"/>
        <xsd:enumeration value="apothecaries_dram"/>
        <xsd:enumeration value="scruple"/>
        <xsd:enumeration value="grain"/>
        <xsd:enumeration value="slug"/>
        <xsd:enumeration value="pound_force"/>
        <xsd:enumeration value="poundal"/>
        <xsd:enumeration value="kip"/>
        <xsd:enumeration value="ton_force"/>
        <xsd:enumeration value="gram_force"/>
        <xsd:enumeration value="inch"/>
        <xsd:enumeration value="foot"/>
        <xsd:enumeration value="yard"/>
        <xsd:enumeration value="mile"/>
        <xsd:enumeration value="us_survey_inch"/>
        <xsd:enumeration value="us_survey_foot"/>
        <xsd:enumeration value="us_survey_yard"/>
        <xsd:enumeration value="us_survey_fathom"/>
        <xsd:enumeration value="us_survey_rod"/>
        <xsd:enumeration value="us_survey_chain"/>
        <xsd:enumeration value="us_survey_link"/>
        <xsd:enumeration value="us_survey_furlong"/>
        <xsd:enumeration value="us_survey_mile"/>
        <xsd:enumeration value="us_acre"/>
        <xsd:enumeration value="imperial_gallon"/>
        <xsd:enumeration value="imperial_quart"/>
        <xsd:enumeration value="imperial_pint"/>
        <xsd:enumeration value="imperial_gill"/>
        <xsd:enumeration value="imperial_ounce"/>
        <xsd:enumeration value="us_gallon"/>
        <xsd:enumeration value="us_quart"/>
        <xsd:enumeration value="us_pint"/>
        <xsd:enumeration value="us_cup"/>
        <xsd:enumeration value="us_gill"/>
        <xsd:enumeration value="us_fluid_ounce"/>
        <xsd:enumeration value="us_fluid_dram"/>
        <xsd:enumeration value="us_minim"/>
        <xsd:enumeration value="us_tablespoon"/>
        <xsd:enumeration value="us_teaspoon"/>
        <xsd:enumeration value="us_bushel"/>
        <xsd:enumeration value="us_peck"/>
        <xsd:enumeration value="us_dry_quart"/>
        <xsd:enumeration value="us_dry_pint"/>
        <xsd:enumeration value="thermo_kg_calorie"/>
        <xsd:enumeration value="table_kg_calorie"/>
        <xsd:enumeration value="us_label_teaspoon"/>
        <xsd:enumeration value="us_label_tablespoon"/>
        <xsd:enumeration value="us_label_cup"/>
        <xsd:enumeration value="us_label_fluid_ounce"/>
        <xsd:enumeration value="us_label_ounce"/>
        <xsd:enumeration value="horsepower"/>
        <xsd:enumeration value="electric_horsepower"/>
        <xsd:enumeration value="boiler_horsepower"/>
        <xsd:enumeration value="metric_horsepower"/>
        <xsd:enumeration value="water_horsepower"/>
        <xsd:enumeration value="uk_horsepower"/>
        <xsd:enumeration value="degree_Fahrenheit"/>
        <xsd:enumeration value="degree_Rankine"/>
        <xsd:enumeration value="torr"/>
        <xsd:enumeration value="standard_atmosphere"/>
        <xsd:enumeration value="technical_atmosphere"/>
        <xsd:enumeration value="mm_Hg"/>
        <xsd:enumeration value="cm_Hg"/>
        <xsd:enumeration value="0C_cm_Hg"/>
        <xsd:enumeration value="in_Hg"/>
        <xsd:enumeration value="32F_in_Hg"/>
        <xsd:enumeration value="60F_in_Hg"/>
        <xsd:enumeration value="ft_Hg"/>
        <xsd:enumeration value="mm_water"/>
        <xsd:enumeration value="cm_water"/>
        <xsd:enumeration value="4C_cm_water"/>
        <xsd:enumeration value="in_water"/>
        <xsd:enumeration value="39F_in_water"/>
        <xsd:enumeration value="60F_in_water"/>
        <xsd:enumeration value="ft_water"/>
        <xsd:enumeration value="39F_ft_water"/>
        <xsd:enumeration value="light_year"/>
        <xsd:enumeration value="light_week"/>
        <xsd:enumeration value="light_hour"/>
        <xsd:enumeration value="light_minute"/>
        <xsd:enumeration value="light_second"/>
        <xsd:enumeration value="parsec"/>
        <xsd:enumeration value="printers_pica"/>
        <xsd:enumeration value="computer_pica"/>
        <xsd:enumeration value="printers_point"/>
        <xsd:enumeration value="computer_point"/>
        <xsd:enumeration value="thermo_btu"/>
        <xsd:enumeration value="table_btu"/>
        <xsd:enumeration value="mean_btu"/>
        <xsd:enumeration value="39F_btu"/>
        <xsd:enumeration value="59F_btu"/>
        <xsd:enumeration value="60F_btu"/>
        <xsd:enumeration value="tons_of_tnt"/>
        <xsd:enumeration value="ec_therm"/>
        <xsd:enumeration value="us_therm"/>
        <xsd:enumeration value="year_365"/>
        <xsd:enumeration value="tropical_year"/>
        <xsd:enumeration value="sidereal_year"/>
        <xsd:enumeration value="sidereal_day"/>
        <xsd:enumeration value="sidereal_hour"/>
        <xsd:enumeration value="sidereal_minute"/>
        <xsd:enumeration value="sidereal_second"/>
        <xsd:enumeration value="shake"/>
        <xsd:enumeration value="denier"/>
        <xsd:enumeration value="tex"/>
        <xsd:enumeration value="gon"/>
        <xsd:enumeration value="nato_mil"/>
        <xsd:enumeration value="pound_mole"/>
        <xsd:enumeration value="ton_refrigeration"/>
        <xsd:enumeration value="circular_mil"/>
        <xsd:enumeration value="bel"/>
        <xsd:enumeration value="neper"/>
        <xsd:enumeration value="pH"/>
        <xsd:enumeration value="petro_barrel"/>
        <xsd:enumeration value="footlambert"/>
        <xsd:enumeration value="footcandle"/>
        <xsd:enumeration value="carat"/>
        <xsd:enumeration value="bit"/>
        <xsd:enumeration value="byte"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attributeGroup ref="sourceURL"/>
  <xsd:attributeGroup ref="prefix"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 120 — Schema Component Representation

+ + +
+

2.7.  Complex Type: ExternalRootUnitType

+ +

2.7.1.  Used By ExternalRootUnit

+ +

Description Type for the element for those special cases where the root unit needed is not included in the enumerated list in the above element.

+ +
<...
 unit="xsd:anyURI" [1]
 annotation="xsd:string" [0..1]
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 121 — XML Instance Representation

+ + +
<xsd:complexType name="ExternalRootUnitType">
  <xsd:attribute name="unit" type="xsd:anyURI" use="required"/>
  <xsd:attributeGroup ref="sourceURL"/>
  <xsd:attribute name="annotation" type="xsd:string" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
  <xsd:attributeGroup ref="prefix"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 122 — Schema Component Representation

+ + +
+

2.8.  Complex Type: ConversionsType

+ +

2.8.1.  Used By Conversions

+ +

Description Type for the container for providing conversion information to other units.

+ +
<...>
  <Float64ConversionFrom> ... </Float64ConversionFrom> [0..*]
  <SpecialConversionFrom> ... </SpecialConversionFrom> [0..*]
  <WSDLConversionFrom> ... </WSDLConversionFrom> [0..*]
</...>

Figure 123 — XML Instance Representation

+ + +
<xsd:complexType name="ConversionsType">
  <xsd:sequence>
    <xsd:element ref="Float64ConversionFrom" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="SpecialConversionFrom" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="WSDLConversionFrom" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 124 — Schema Component Representation

+ + +
+

2.9.  Complex Type: Float64ConversionFromType

+ +

2.9.1.  Used By Float64ConversionFrom

+ +

Description Type for the element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a))

+ +
<...
 xml:id="" [1]
 initialAddend="xsd:double" [0..1]
 initialAddendDecimalPlace="xsd:byte" [0..1]
 multiplicand="xsd:double" [0..1]
 multiplicandDigits="xsd:unsignedByte" [0..1]
 divisor="xsd:double" [0..1]
 divisorDigits="xsd:unsignedByte" [0..1]
 finalAddend="xsd:double" [0..1]
 finalAddendDecimalPlace="xsd:byte" [0..1]
 exact="xsd:boolean" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionNote> ... </ConversionNote> [0..*]
</...>

Figure 125 — XML Instance Representation

+ + +
<xsd:complexType name="Float64ConversionFromType">
  <xsd:sequence>
    <xsd:element ref="ConversionNote" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attributeGroup ref="initialUnit"/>
  <xsd:attribute name="initialAddend" type="xsd:double" use="optional" default="0"/>
  <xsd:attribute name="initialAddendDecimalPlace" type="xsd:byte" use="optional"/>
  <xsd:attribute name="multiplicand" type="xsd:double" use="optional" default="1"/>
  <xsd:attribute name="multiplicandDigits" type="xsd:unsignedByte" use="optional"/>
  <xsd:attribute name="divisor" type="xsd:double" use="optional" default="1"/>
  <xsd:attribute name="divisorDigits" type="xsd:unsignedByte" use="optional"/>
  <xsd:attribute name="finalAddend" type="xsd:double" use="optional" default="0"/>
  <xsd:attribute name="finalAddendDecimalPlace" type="xsd:byte" use="optional"/>
  <xsd:attribute name="exact" type="xsd:boolean" use="optional" default="false"/>
</xsd:complexType>

Figure 126 — Schema Component Representation

+ + +
+

2.10.  Complex Type: SpecialConversionFromType

+ +

2.10.1.  Used By SpecialConversionFrom

+ +

Description Type for the element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation.

+ +
<...
 xml:id="" [1]
 conversionURL="xsd:anyURI" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionDescription> ... </ConversionDescription> [0..*]
</...>

Figure 127 — XML Instance Representation

+ + +
<xsd:complexType name="SpecialConversionFromType">
  <xsd:sequence>
    <xsd:element ref="ConversionDescription" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="conversionURL" type="xsd:anyURI" use="optional"/>
  <xsd:attributeGroup ref="initialUnit"/>
</xsd:complexType>

Figure 128 — Schema Component Representation

+ + +
+

2.11.  Complex Type: WSDLConversionFromType

+ +

2.11.1.  Used By WSDLConversionFrom

+ +

Description Type for the element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation.

+ +
<...
 xml:id="" [1]
 wsdlURL="xsd:anyURI" [1]
 initialUnit="xsd:anyURI" [1]
>
  <WSDLDescription> ... </WSDLDescription> [0..*]
</...>

Figure 129 — XML Instance Representation

+ + +
<xsd:complexType name="WSDLConversionFromType">
  <xsd:sequence>
    <xsd:element ref="WSDLDescription" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attributeGroup ref="initialUnit"/>
  <xsd:attribute name="wsdlURL" type="xsd:anyURI" use="required"/>
</xsd:complexType>

Figure 130 — Schema Component Representation

+ + +
+

2.12.  Complex Type: CountedItemSetType

+ +

2.12.1.  Used By CountedItemSet

+ +

Description Type for a set of counted items.

+ +
<...>
  <CountedItem> ... </CountedItem> [1..*]
</...>

Figure 131 — XML Instance Representation

+ + +
<xsd:complexType name="CountedItemSetType">
  <xsd:sequence>
    <xsd:element ref="CountedItem" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 132 — Schema Component Representation

+ + +
+

2.13.  Complex Type: CountedItemType

+ +

2.13.1.  Used By CountedItem

+ +

Description Type for a single counted item.

+ +
<...
 xml:id="" [1]
>
  <ItemName> ... </ItemName> [1..*]
  <ItemSymbol> ... </ItemSymbol> [0..*]
  <ItemVersionHistory> ... </ItemVersionHistory> [0..*]
  <ItemDefinition> ... </ItemDefinition> [0..*]
  <ItemHistory> ... </ItemHistory> [0..*]
  <ItemRemark> ... </ItemRemark> [0..*]
</...>

Figure 133 — XML Instance Representation

+ + +
<xsd:complexType name="CountedItemType">
  <xsd:sequence>
    <xsd:element ref="ItemName" maxOccurs="unbounded"/>
    <xsd:element ref="ItemSymbol" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemVersionHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemRemark" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
</xsd:complexType>

Figure 134 — Schema Component Representation

+ + +
+

2.14.  Complex Type: QuantitySetType

+ +

2.14.1.  Used By QuantitySet

+ +

Description Type for quantity container.

+ +
<...>
  <Quantity> ... </Quantity> [1..*]
</...>

Figure 135 — XML Instance Representation

+ + +
<xsd:complexType name="QuantitySetType">
  <xsd:sequence>
    <xsd:element ref="Quantity" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 136 — Schema Component Representation

+ + +
+

2.15.  Complex Type: QuantityType

+ +

2.15.1.  Used By Quantity

+ +

Description Type for the quantity.

+ +
<...
 xml:id="" [1]
 quantityType="xsd:token (value comes from list: {'base'|'derived'})" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <QuantityName> ... </QuantityName> [1..*]
  <QuantitySymbol> ... </QuantitySymbol> [0..*]
  <UnitReference> ... </UnitReference> [0..*]
  <QuantityVersionHistory> ... </QuantityVersionHistory> [0..*]
  <QuantityDefinition> ... </QuantityDefinition> [0..*]
  <QuantityHistory> ... </QuantityHistory> [0..*]
  <QuantityRemark> ... </QuantityRemark> [0..*]
</...>

Figure 137 — XML Instance Representation

+ + +
<xsd:complexType name="QuantityType">
  <xsd:sequence>
    <xsd:element ref="QuantityName" maxOccurs="unbounded"/>
    <xsd:element ref="QuantitySymbol" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitReference" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityVersionHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityDefinition" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityRemark" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="quantityType" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="base"/>
        <xsd:enumeration value="derived"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attributeGroup ref="dimensionURL"/>
</xsd:complexType>

Figure 138 — Schema Component Representation

+ + +
+

2.16.  Complex Type: DimensionSetType

+ +

2.16.1.  Used By DimensionSet

+ +

Description Type for the dimension container.

+ +
<...>
  <Dimension> ... </Dimension> [1..*]
</...>

Figure 139 — XML Instance Representation

+ + +
<xsd:complexType name="DimensionSetType">
  <xsd:sequence>
    <xsd:element ref="Dimension" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 140 — Schema Component Representation

+ + +
+

2.17.  Complex Type: DimensionType

+ +

2.17.1.  Used By Dimension

+ +

Description Type for dimension.

+ +
<...
 xml:id="" [1]
 dimensionless="xsd:boolean" [0..1]
>
  <Length> ... </Length> [0..1]
  <Mass> ... </Mass> [0..1]
  <Time> ... </Time> [0..1]
  <ElectricCurrent> ... </ElectricCurrent> [0..1]
  <ThermodynamicTemperature> ... </ThermodynamicTemperature> [0..1]
  <AmountOfSubstance> ... </AmountOfSubstance> [0..1]
  <LuminousIntensity> ... </LuminousIntensity> [0..1]
  <PlaneAngle> ... </PlaneAngle> [0..1]
  <Item> ... </Item> [0..*]
</...>

Figure 141 — XML Instance Representation

+ + +
<xsd:complexType name="DimensionType">
  <xsd:sequence maxOccurs="unbounded">
    <xsd:element ref="Length" minOccurs="0"/>
    <xsd:element ref="Mass" minOccurs="0"/>
    <xsd:element ref="Time" minOccurs="0"/>
    <xsd:element ref="ElectricCurrent" minOccurs="0"/>
    <xsd:element ref="ThermodynamicTemperature" minOccurs="0"/>
    <xsd:element ref="AmountOfSubstance" minOccurs="0"/>
    <xsd:element ref="LuminousIntensity" minOccurs="0"/>
    <xsd:element ref="PlaneAngle" minOccurs="0"/>
    <xsd:element ref="Item" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="dimensionless" type="xsd:boolean" use="optional" default="0"/>
</xsd:complexType>

Figure 142 — Schema Component Representation

+ + +
+

2.18.  Complex Type: LengthType

+ +

2.18.1.  Used By Length

+ +

Description Type of the quantity length.

+ +
<...
 symbol="L" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 143 — XML Instance Representation

+ + +
<xsd:complexType name="LengthType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="L" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 144 — Schema Component Representation

+ + +
+

2.19.  Complex Type: MassType

+ +

2.19.1.  Used By Mass

+ +

Description Type of the quantity mass.

+ +
<...
 symbol="M" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 145 — XML Instance Representation

+ + +
<xsd:complexType name="MassType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="M" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 146 — Schema Component Representation

+ + +
+

2.20.  Complex Type: TimeType

+ +

2.20.1.  Used By Time

+ +

Description Type of the quantity time.

+ +
<...
 symbol="T" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 147 — XML Instance Representation

+ + +
<xsd:complexType name="TimeType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="T" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 148 — Schema Component Representation

+ + +
+

2.21.  Complex Type: ElectricCurrentType

+ +

2.21.1.  Used By ElectricCurrent

+ +

Description Type of the quantity electric current.

+ +
<...
 symbol="I" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 149 — XML Instance Representation

+ + +
<xsd:complexType name="ElectricCurrentType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="I" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 150 — Schema Component Representation

+ + +
+

2.22.  Complex Type: ThermodynamicTemperatureType

+ +

2.22.1.  Used By ThermodynamicTemperature

+ +

Description Type of the quantity thermodynamic temperature.

+ +
<...
 symbol="Θ" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 151 — XML Instance Representation

+ + +
<xsd:complexType name="ThermodynamicTemperatureType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="Θ" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 152 — Schema Component Representation

+ + +
+

2.23.  Complex Type: AmountOfSubstanceType

+ +

2.23.1.  Used By AmountOfSubstance

+ +

Description Type of the quantity amount of substance.

+ +
<...
 symbol="N" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 153 — XML Instance Representation

+ + +
<xsd:complexType name="AmountOfSubstanceType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="N" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 154 — Schema Component Representation

+ + +
+

2.24.  Complex Type: LuminousIntensityType

+ +

2.24.1.  Used By LuminousIntensity

+ +

Description Type of the quantity luminous intensity.

+ +
<...
 symbol="J" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 155 — XML Instance Representation

+ + +
<xsd:complexType name="LuminousIntensityType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="J" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 156 — Schema Component Representation

+ + +
+

2.25.  Complex Type: PlaneAngleType

+ +

2.25.1.  Used By PlaneAngle

+ +

Description Type of the quantity plane angle.

+ +
<...
 symbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 157 — XML Instance Representation

+ + +
<xsd:complexType name="PlaneAngleType">
  <xsd:attribute name="symbol" type="xsd:token" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 158 — Schema Component Representation

+ + +
+

2.26.  Complex Type: ItemType

+ +

2.26.1.  Used By Item

+ +

Description Type of the quantity represented by a counted item, e.g., electron

+ +
<...
 itemURL="xsd:anyURI" [1]
 itemSymbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 159 — XML Instance Representation

+ + +
<xsd:complexType name="ItemType">
  <xsd:attribute name="itemURL" type="xsd:anyURI" use="required"/>
  <xsd:attribute name="itemSymbol" type="xsd:token" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 160 — Schema Component Representation

+ + +
+

2.27.  Complex Type: PrefixSetType

+ +

2.27.1.  Used By PrefixSet

+ +

Description Type for container for prefixes.

+ +
<...>
  <Prefix> ... </Prefix> [1..*]
</...>

Figure 161 — XML Instance Representation

+ + +
<xsd:complexType name="PrefixSetType">
  <xsd:sequence>
    <xsd:element ref="Prefix" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 162 — Schema Component Representation

+ + +
+

2.28.  Complex Type: PrefixType

+ +

2.28.1.  Used By Prefix

+ +

Description Type for element for describing prefixes. Use in container PrefixSet.

+ +
<...
 xml:id="" [1]
 prefixBase="xsd:byte (value comes from list: {'10'|'2'})" [0..1]
 prefixPower="xsd:byte" [0..1]
>
  <PrefixName> ... </PrefixName> [1..*]
  <PrefixSymbol> ... </PrefixSymbol> [0..*]
</...>

Figure 163 — XML Instance Representation

+ + +
<xsd:complexType name="PrefixType">
  <xsd:sequence>
    <xsd:element ref="PrefixName" maxOccurs="unbounded"/>
    <xsd:element ref="PrefixSymbol" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="prefixBase" use="optional" default="10">
    <xsd:simpleType>
      <xsd:restriction base="xsd:byte">
        <xsd:enumeration value="10"/>
        <xsd:enumeration value="2"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="prefixPower" type="xsd:byte" use="optional"/>
</xsd:complexType>

Figure 164 — Schema Component Representation

+ + +
+

2.29.  Complex Type: NameType

+ +

2.29.1.  Used By UnitName, ItemName, QuantityName, PrefixName

+ +

Description Type for name. Used for names in units, quantities, and prefixes.

+ +
<...
 xml:lang="" [0..1]
>
  xsd:token
</...>

Figure 165 — XML Instance Representation

+ + +
<xsd:complexType name="NameType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 166 — Schema Component Representation

+ + +
+

2.30.  Complex Type: SystemType

+ +

2.30.1.  Used By UnitSystem

+ +

Description Type for unit system.

+ +
<...
 name="xsd:token" [1]
 type="xsd:string" [0..1]
 xml:lang="" [0..1]
/>

Figure 167 — XML Instance Representation

+ + +
<xsd:complexType name="SystemType">
  <xsd:attribute name="name" type="xsd:token" use="required"/>
  <xsd:attribute name="type" type="xsd:string" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
</xsd:complexType>

Figure 168 — Schema Component Representation

+ + +
+

2.31.  Complex Type: SymbolType

+ +

2.31.1.  Used By UnitSymbol, ItemSymbol, QuantitySymbol, PrefixSymbol

+ +

Description Type for symbols. Used in units, quantities, and prefixes.

+ +
<...
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 169 — XML Instance Representation

+ + +
<xsd:complexType name="SymbolType">
  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
    <xsd:any processContents="skip" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:lang" use="optional"/>
  <xsd:attribute name="type" use="required">
    <xsd:simpleType>
      <xsd:union memberTypes="xsd:token">
        <xsd:simpleType>
          <xsd:restriction base="xsd:token">
            <xsd:enumeration value="ASCII"/>
            <xsd:enumeration value="Unicode"/>
            <xsd:enumeration value="LaTeX"/>
            <xsd:enumeration value="HTML"/>
            <xsd:enumeration value="MathML"/>
            <xsd:enumeration value="SVG"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:union>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:complexType>

Figure 170 — Schema Component Representation

+ + +
+

2.32.  Complex Type: NoteType

+ +

2.32.1.  Used By UnitVersionHistory, ConversionNote, WSDLDescription, ConversionDescription, ItemVersionHistory, QuantityVersionHistory

+ +

Description Type for notes. Used in units and conversion factors.

+ +
<...
 xml:lang="" [0..1]
>
  xsd:string
</...>

Figure 171 — XML Instance Representation

+ + +
<xsd:complexType name="NoteType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 172 — Schema Component Representation

+ + +
+

2.33.  Complex Type: DefinitionType

+ +

2.33.1.  Used By UnitDefinition, ItemDefinition, QuantityDefinition

+ +

Description Type for definition.

+ +
<...
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</...>

Figure 173 — XML Instance Representation

+ + +
<xsd:complexType name="DefinitionType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 174 — Schema Component Representation

+ + +
+

2.34.  Complex Type: HistoryType

+ +

2.34.1.  Used By UnitHistory, ItemHistory, QuantityHistory

+ +

Description Type for history.

+ +
<...
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</...>

Figure 175 — XML Instance Representation

+ + +
<xsd:complexType name="HistoryType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 176 — Schema Component Representation

+ + +
+

2.35.  Complex Type: RemarkType

+ +

2.35.1.  Used By UnitRemark, ItemRemark, QuantityRemark

+ +

Description Type for remark.

+ +
<...
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</...>

Figure 177 — XML Instance Representation

+ + +
<xsd:complexType name="RemarkType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 178 — Schema Component Representation

+ + +
+

2.36.  Complex Type: ReferenceType

+ +

2.36.1.  Used By QuantityReference, UnitReference

+ +

Description Type for reference to a unit or quantity.

+ +
<...
 url="xsd:anyURI" [1]
 name="xsd:token" [0..1]
 xml:lang="" [0..1]
/>

Figure 179 — XML Instance Representation

+ + +
<xsd:complexType name="ReferenceType">
  <xsd:attribute name="url" type="xsd:anyURI" use="required"/>
  <xsd:attribute name="name" type="xsd:token" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
</xsd:complexType>

Figure 180 — Schema Component Representation

+ + +
+

3.  Attribute Groups

3.1.  Attribute Group: initialUnit

+ + + +

3.1.2.  Description URI indicating the unitID of the starting unit for the conversion. For units which are defined in the same document, the URI should consist of a pound sign (#) followed by the ID value.

+ +
initialUnit="xsd:anyURI" [1]

Figure 181 — XML Instance Representation

+ + +
<xsd:attributeGroup name="initialUnit">
  <xsd:attribute name="initialUnit" type="xsd:anyURI" use="required"/>
</xsd:attributeGroup>

Figure 182 — Schema Component Representation

+ + +
+

3.2.  Attribute Group: sourceName

+ + + +

3.2.2.  Description Name of relevant publication.

+ +
sourceName="xsd:string" [0..1]

Figure 183 — XML Instance Representation

+ + +
<xsd:attributeGroup name="sourceName">
  <xsd:attribute name="sourceName" type="xsd:string" use="optional"/>
</xsd:attributeGroup>

Figure 184 — Schema Component Representation

+ + +
+

3.3.  Attribute Group: sourceURL

+ + + +

3.3.2.  Description Relevant URL for available information.

+ +
sourceURL="xsd:anyURI" [0..1]

Figure 185 — XML Instance Representation

+ + +
<xsd:attributeGroup name="sourceURL">
  <xsd:attribute name="sourceURL" type="xsd:anyURI" use="optional"/>
</xsd:attributeGroup>

Figure 186 — Schema Component Representation

+ + +
+

3.4.  Attribute Group: powerRational

+ + + +

3.4.2.  Description An exponent of the unit, specified as powerNumerator and powerDenominator.

+ +
powerNumerator="xsd:byte" [0..1]
powerDenominator="xsd:byte" [0..1]

Figure 187 — XML Instance Representation

+ + +
<xsd:attributeGroup name="powerRational">
  <xsd:attribute name="powerNumerator" type="xsd:byte" use="optional" default="1"/>
  <xsd:attribute name="powerDenominator" type="xsd:byte" use="optional" default="1"/>
</xsd:attributeGroup>

Figure 188 — Schema Component Representation

+ + +
+

3.5.  Attribute Group: prefix

+ + + +

3.5.2.  Description Prefix identifier; e.g., m, k, M, G. [Enumeration order is by prefix magnitude (Y to y) followed by binary prefixes.]

+ +
prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]

Figure 189 — XML Instance Representation

+ + +
<xsd:attributeGroup name="prefix">
  <xsd:attribute name="prefix" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="Y"/>
        <xsd:enumeration value="Z"/>
        <xsd:enumeration value="E"/>
        <xsd:enumeration value="P"/>
        <xsd:enumeration value="T"/>
        <xsd:enumeration value="G"/>
        <xsd:enumeration value="M"/>
        <xsd:enumeration value="k"/>
        <xsd:enumeration value="h"/>
        <xsd:enumeration value="da"/>
        <xsd:enumeration value="d"/>
        <xsd:enumeration value="c"/>
        <xsd:enumeration value="m"/>
        <xsd:enumeration value="u"/>
        <xsd:enumeration value="n"/>
        <xsd:enumeration value="p"/>
        <xsd:enumeration value="f"/>
        <xsd:enumeration value="a"/>
        <xsd:enumeration value="z"/>
        <xsd:enumeration value="y"/>
        <xsd:enumeration value="Ki"/>
        <xsd:enumeration value="Mi"/>
        <xsd:enumeration value="Gi"/>
        <xsd:enumeration value="Ti"/>
        <xsd:enumeration value="Pi"/>
        <xsd:enumeration value="Ei"/>
        <xsd:enumeration value="Zi"/>
        <xsd:enumeration value="Yi"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:attributeGroup>

Figure 190 — Schema Component Representation

+ + +
+

3.6.  Attribute Group: dimensionURL

+ + + +

3.6.2.  Description URL to a representation of the unit or quantity in terms of the 7 SI base dimensions.

+ +
dimensionURL="xsd:anyURI" [0..1]

Figure 191 — XML Instance Representation

+ + +
<xsd:attributeGroup name="dimensionURL">
  <xsd:attribute name="dimensionURL" type="xsd:anyURI" use="optional"/>
</xsd:attributeGroup>

Figure 192 — Schema Component Representation

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + diff --git a/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc b/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc new file mode 100644 index 0000000..584cd64 --- /dev/null +++ b/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc @@ -0,0 +1,44 @@ +{% for attribute_group in schema.attribute_group %} + +[#attribute_group_{{attribute_group.name}}] + +=== Attribute Group: *{{ attribute_group.name }}* + +==== **Used By** {{ schema | used_by: attribute_group | join: ", " }} + +==== Description pass:[{{ attribute_group.annotation.documentation.first.content }}] + +.XML Instance Representation +[source, xml] +----- +{%- for attr in attribute_group.attribute %} +{{ attr.name }}="{{ attr | attr_type: }}" [{{ attr | min_max_arg: }}] +{%- endfor %} +----- + +.Schema Component Representation +[source, xml] +----- + +{%- assign element_order = attribute_group | resolved_element_order: %} +{%- for element in element_order %} +{%- assign attribute_drop = element | class_name_end_with: "::AttributeDrop" -%} +{%- assign attribute_group_drop = element | class_name_end_with: "::AttributeGroupDrop" -%} +{%- assign simple_type = element.simple_type %} +{%- if attribute_drop %} + + {%- if simple_type %} + {%- render "sources/simple_type", simple_type: simple_type, element: element, indent: " " %} + + {%- endif %} +{%- endif %} +{%- if attribute_group_drop %} + +{%- endif %} +{%- endfor %} + +----- + +--- + +{% endfor %} diff --git a/sources/unitsml_xsd_docs/sources/_complex_type.adoc b/sources/unitsml_xsd_docs/sources/_complex_type.adoc new file mode 100644 index 0000000..3a99534 --- /dev/null +++ b/sources/unitsml_xsd_docs/sources/_complex_type.adoc @@ -0,0 +1,75 @@ +{% for complex_type in schema.complex_type %} + +[#complex_type_{{complex_type.name}}] + +=== Complex Type: *{{ complex_type.name }}* + +==== Used By {{ schema | used_by: complex_type | join: ", " }} + +Description pass:[{{ complex_type.annotation.documentation.first.content }}] + +{% assign complex_type_element_order = complex_type | resolved_element_order: %} +{% assign complex_type_attributes = schema | attributes: complex_type -%} +{% assign elements = schema | child_elements: complex_type %} +.XML Instance Representation +[source, xml] +----- +<...{{ complex_type_attributes | xml_representations: schema }} +{%- if elements.size > 0 -%}> +{%- for child in elements -%} +{% assign element_name = child.ref || child.name %} +{%- if element_name %} + <{{ element_name }}> ... {{ child | cardinality_representation: }} +{%- else %} + {{ child }} +{%- endif %} +{%- endfor %} + +{%- else -%} +/> +{% endif %} +----- + +.Schema Component Representation +[source, xml] +----- + +{%- for object in complex_type_element_order %} +{%- assign sequence_drop = object | class_name_end_with: "::SequenceDrop" -%} +{%- assign attribute_drop = object | class_name_end_with: "::AttributeDrop" -%} +{%- assign simple_content_drop = object | class_name_end_with: "::SimpleContentDrop" -%} +{%- assign attribute_group_drop = object | class_name_end_with: "::AttributeGroupDrop" -%} +{%- if sequence_drop %} + + {%- for element in object.element %} + + {%- endfor %} + {%- for any in object.any %} + + {%- endfor %} + +{%- endif %} +{%- if attribute_drop %} + + {%- if object.simple_type %} + {%- render "sources/simple_type", simple_type: object.simple_type, indent: " " %} + + {%- endif %} +{%- endif %} +{%- if attribute_group_drop %} + +{%- endif %} +{%- if simple_content_drop %}{% assign simple_content_children = object | simple_content_children: %} + + {%- for child in simple_content_children %} + {{ child }} + {%- endfor %} + +{%- endif %} +{%- endfor %} + +----- + +--- + +{% endfor %} diff --git a/sources/unitsml_xsd_docs/sources/_elements.adoc b/sources/unitsml_xsd_docs/sources/_elements.adoc new file mode 100644 index 0000000..ed09d29 --- /dev/null +++ b/sources/unitsml_xsd_docs/sources/_elements.adoc @@ -0,0 +1,40 @@ +{% for element in schema.element %} + +[#element_{{element.name}}] +=== Element: *{{ element.name }}* + +==== Type <> +{% assign used_by_elements = schema | used_by: element %} +{% if used_by_elements.size > 0 %}==== *Used By* {{ used_by_elements | join: ", " }}{% endif %} + +==== Description *pass:[{{ element.annotation.documentation.first.content }}]* +{% assign element_attributes = schema | attributes: element %} +{% assign element_children = schema | child_elements: element %} + +.XML Instance Representation +[source, xml] +----- +<{{element.name}}{{ element_attributes | xml_representations: schema }} +{%- if element_children.size > 0 -%}> +{%- for child in element_children -%} +{% assign element_name = child.ref || child.name %} +{%- if element_name %} + <{{element_name}}> ... {{ child | cardinality_representation: }} +{%- else %} + {{ child }} +{%- endif %} +{%- endfor %} + +{%- else -%} +/> +{% endif %} +----- + +.Schema Component Representation +[source, xml] +----- + +----- +--- + +{% endfor %} diff --git a/sources/unitsml_xsd_docs/sources/_simple_type.liquid b/sources/unitsml_xsd_docs/sources/_simple_type.liquid new file mode 100644 index 0000000..7ffe86d --- /dev/null +++ b/sources/unitsml_xsd_docs/sources/_simple_type.liquid @@ -0,0 +1,19 @@ +{%- assign simple_type_indent = indent | append: " " %} +{%- assign extended_indent = simple_type_indent | append: " " %} +{{indent}} +{%- if simple_type.restriction %} + {%- assign restriction = simple_type.restriction %} +{{simple_type_indent}} + {%- for enumeration in restriction.enumeration %} +{{extended_indent}} + {%- endfor %} +{{simple_type_indent}} +{%- elsif simple_type.union %} + {%- assign union = simple_type.union %} +{{simple_type_indent}} + {%- for union_simple_type in union.simple_type %} + {%- render "sources/simple_type", simple_type: union_simple_type, indent: extended_indent %} +{{simple_type_indent}} + {%- endfor %} +{%- endif %} +{{indent}} \ No newline at end of file From 6f87860accc47f302de3f1c5333fe3938f6a6b2d Mon Sep 17 00:00:00 2001 From: Suleman Uzair <96812483+suleman-uzair@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:25:40 +0500 Subject: [PATCH 02/15] Delete sources/unitsml_xsd_docs/document.html --- sources/unitsml_xsd_docs/document.html | 3597 ------------------------ 1 file changed, 3597 deletions(-) delete mode 100644 sources/unitsml_xsd_docs/document.html diff --git a/sources/unitsml_xsd_docs/document.html b/sources/unitsml_xsd_docs/document.html deleted file mode 100644 index ec7c555..0000000 --- a/sources/unitsml_xsd_docs/document.html +++ /dev/null @@ -1,3597 +0,0 @@ - - -XSD Templates - - - - - - - - - - - - - - -
-

Published

-
- -
-

CalConnect Standard

-
- -
- -
- - -
-
- -
-
- CC :2025 - -
- -
- XSD Templates - -
-
- - - -
- TC XXXX -
- - - - - -
- - -
-
- -
-
- CalConnect Standard -
- -
- -
- - - - - - - -
-
-
-
-

- - -
-

- - - - -

XSD Templates

1.  Elements

1.1.  Element: UnitsML

- - - -

1.1.2.  Description Container for UnitsML units, quantities, and prefixes.

- -
<UnitsML>
  <UnitSet> ... </UnitSet> [0..1]
  <CountedItemSet> ... </CountedItemSet> [0..1]
  <QuantitySet> ... </QuantitySet> [0..1]
  <DimensionSet> ... </DimensionSet> [0..1]
  <PrefixSet> ... </PrefixSet> [0..1]
</UnitsML>

Figure 1 — XML Instance Representation

- - -
<xsd:element name="UnitsML" type="UnitsMLType" />

Figure 2 — Schema Component Representation

- - -
-

1.2.  Element: UnitSet

- - - - - -

1.2.3.  Description Container for units. Use in UnitsML container or directly incorporate into a host schema.

- -
<UnitSet>
  <Unit> ... </Unit> [1..*]
</UnitSet>

Figure 3 — XML Instance Representation

- - -
<xsd:element name="UnitSet" type="UnitSetType" />

Figure 4 — Schema Component Representation

- - -
-

1.3.  Element: Unit

- - - - - -

1.3.3.  Description Element for describing units. Use in containers UnitSet or directly incorporate into a host schema.

- -
<Unit
 xml:id="" [1]
 timeStamp="xsd:dateTime" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <UnitSystem> ... </UnitSystem> [0..*]
  <UnitName> ... </UnitName> [1..*]
  <UnitSymbol> ... </UnitSymbol> [0..*]
  <CodeListValue> ... </CodeListValue> [0..*]
  <RootUnits> ... </RootUnits> [0..1]
  <Conversions> ... </Conversions> [0..1]
  <QuantityReference> ... </QuantityReference> [0..*]
  <UnitVersionHistory> ... </UnitVersionHistory> [0..*]
  <UnitDefinition> ... </UnitDefinition> [0..*]
  <UnitHistory> ... </UnitHistory> [0..*]
  <UnitRemark> ... </UnitRemark> [0..*]
</Unit>

Figure 5 — XML Instance Representation

- - -
<xsd:element name="Unit" type="UnitType" />

Figure 6 — Schema Component Representation

- - -
-

1.4.  Element: UnitSystem

- - - - - -

1.4.3.  Description Container for describing the system of units.

- -
<UnitSystem
 name="xsd:token" [1]
 type="xsd:string" [0..1]
 xml:lang="" [0..1]
/>

Figure 7 — XML Instance Representation

- - -
<xsd:element name="UnitSystem" type="SystemType" />

Figure 8 — Schema Component Representation

- - -
-

1.5.  Element: UnitName

- - - - - -

1.5.3.  Description Element containing the unit name.

- -
<UnitName
 xml:lang="" [0..1]
>
  xsd:token
</UnitName>

Figure 9 — XML Instance Representation

- - -
<xsd:element name="UnitName" type="NameType" />

Figure 10 — Schema Component Representation

- - -
-

1.6.  Element: UnitSymbol

- - - - - -

1.6.3.  Description Element containing various unit symbols. Examples include Aring (ASCII), Å (HTML).

- -
<UnitSymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 11 — XML Instance Representation

- - -
<xsd:element name="UnitSymbol" type="SymbolType" />

Figure 12 — Schema Component Representation

- - -
-

1.7.  Element: UnitVersionHistory

- - - - - -

1.7.3.  Description Element for descriptive information, including version changes to the unit.

- -
<UnitVersionHistory
 xml:lang="" [0..1]
>
  xsd:string
</UnitVersionHistory>

Figure 13 — XML Instance Representation

- - -
<xsd:element name="UnitVersionHistory" type="NoteType" />

Figure 14 — Schema Component Representation

- - -
-

1.8.  Element: CodeListValue

- - - - - -

1.8.3.  Description Element for listing the unit code value from a specific code list.

- -
<CodeListValue
 unitCodeValue="xsd:string" [1]
 codeListName="xsd:normalizedString" [0..1]
 codeListVersion="xsd:token" [0..1]
 locationURL="xsd:anyURI" [0..1]
 organizationName="xsd:normalizedString" [0..1]
 organizationURI="xsd:anyURI" [0..1]
 xml:lang="" [0..1]
/>

Figure 15 — XML Instance Representation

- - -
<xsd:element name="CodeListValue" type="CodeListValueType" />

Figure 16 — Schema Component Representation

- - -
-

1.9.  Element: RootUnits

- - - - - -

1.9.3.  Description Container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered root units.

- -
<RootUnits>
  <EnumeratedRootUnit> ... </EnumeratedRootUnit> [0..*]
  <ExternalRootUnit> ... </ExternalRootUnit> [0..*]
</RootUnits>

Figure 17 — XML Instance Representation

- - -
<xsd:element name="RootUnits" type="RootUnitsType" />

Figure 18 — Schema Component Representation

- - -
-

1.10.  Element: EnumeratedRootUnit

- - - - - -

1.10.3.  Description Element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2

- -
<EnumeratedRootUnit
 unit="xsd:token (value comes from list: {'meter'|'gram'|'second'|'ampere'|'kelvin'|'mole'|'candela'|'radian'|'steradian'|'hertz'|'newton'|'pascal'|'joule'|'watt'|'coulomb'|'volt'|'farad'|'ohm'|'siemens'|'weber'|'tesla'|'henry'|'degree_Celsius'|'lumen'|'lux'|'katal'|'becquerel'|'gray'|'sievert'|'minute'|'hour'|'day'|'arc_degree'|'arc_minute'|'arc_second'|'liter'|'metric_ton'|'electronvolt'|'unified_atomic_mass_unit'|'astronomical_unit'|'atomic_unit_of_1st_hyperpolarizability'|'atomic_unit_of_2nd_hyperpolarizability'|'atomic_unit_of_action'|'atomic_unit_of_charge'|'atomic_unit_of_charge_density'|'atomic_unit_of_current'|'atomic_unit_of_electric_dipole_moment'|'atomic_unit_of_electric_field'|'atomic_unit_of_electric_field_gradient'|'atomic_unit_of_electric_polarizability'|'atomic_unit_of_electric_potential'|'atomic_unit_of_electric_quadrupole_moment'|'atomic_unit_of_energy'|'atomic_unit_of_force'|'atomic_unit_of_length'|'atomic_unit_of_magnetic_dipole_moment'|'atomic_unit_of_magnetic_flux_density'|'atomic_unit_of_magnetizability'|'atomic_unit_of_mass'|'atomic_unit_of_momentum'|'atomic_unit_of_permittivity'|'atomic_unit_of_time'|'atomic_unit_of_velocity'|'natural_unit_of_action'|'natural_unit_of_action_in_eV_s'|'natural_unit_of_energy'|'natural_unit_of_energy_in_MeV'|'natural_unit_of_length'|'natural_unit_of_mass'|'natural_unit_of_momentum'|'natural_unit_of_momentum_in_MeV_per_c'|'natural_unit_of_time'|'natural_unit_of_velocity'|'nautical_mile'|'knot'|'angstrom'|'are'|'hectare'|'barn'|'bar'|'gal'|'curie'|'roentgen'|'rad'|'rem'|'erg'|'dyne'|'barye'|'poise'|'rhe'|'stokes'|'darcy'|'kayser'|'lambert'|'phot'|'thermo_calorie'|'table_calorie'|'debye'|'abampere'|'abcoulomb'|'abfarad'|'abhenry'|'abohm'|'abmho'|'abvolt'|'abwatt'|'maxwell'|'gauss'|'gilbert'|'oersted'|'stilb'|'statampere'|'statcoulomb'|'statfarad'|'stathenry'|'statohm'|'statmho'|'statvolt'|'statwatt'|'statweber'|'stattesla'|'long_ton'|'short_ton'|'gross_hundredweight'|'hundredweight'|'av_pound'|'av_ounce'|'av_dram'|'troy_pound'|'troy_ounce'|'pennyweight'|'apothecaries_dram'|'scruple'|'grain'|'slug'|'pound_force'|'poundal'|'kip'|'ton_force'|'gram_force'|'inch'|'foot'|'yard'|'mile'|'us_survey_inch'|'us_survey_foot'|'us_survey_yard'|'us_survey_fathom'|'us_survey_rod'|'us_survey_chain'|'us_survey_link'|'us_survey_furlong'|'us_survey_mile'|'us_acre'|'imperial_gallon'|'imperial_quart'|'imperial_pint'|'imperial_gill'|'imperial_ounce'|'us_gallon'|'us_quart'|'us_pint'|'us_cup'|'us_gill'|'us_fluid_ounce'|'us_fluid_dram'|'us_minim'|'us_tablespoon'|'us_teaspoon'|'us_bushel'|'us_peck'|'us_dry_quart'|'us_dry_pint'|'thermo_kg_calorie'|'table_kg_calorie'|'us_label_teaspoon'|'us_label_tablespoon'|'us_label_cup'|'us_label_fluid_ounce'|'us_label_ounce'|'horsepower'|'electric_horsepower'|'boiler_horsepower'|'metric_horsepower'|'water_horsepower'|'uk_horsepower'|'degree_Fahrenheit'|'degree_Rankine'|'torr'|'standard_atmosphere'|'technical_atmosphere'|'mm_Hg'|'cm_Hg'|'0C_cm_Hg'|'in_Hg'|'32F_in_Hg'|'60F_in_Hg'|'ft_Hg'|'mm_water'|'cm_water'|'4C_cm_water'|'in_water'|'39F_in_water'|'60F_in_water'|'ft_water'|'39F_ft_water'|'light_year'|'light_week'|'light_hour'|'light_minute'|'light_second'|'parsec'|'printers_pica'|'computer_pica'|'printers_point'|'computer_point'|'thermo_btu'|'table_btu'|'mean_btu'|'39F_btu'|'59F_btu'|'60F_btu'|'tons_of_tnt'|'ec_therm'|'us_therm'|'year_365'|'tropical_year'|'sidereal_year'|'sidereal_day'|'sidereal_hour'|'sidereal_minute'|'sidereal_second'|'shake'|'denier'|'tex'|'gon'|'nato_mil'|'pound_mole'|'ton_refrigeration'|'circular_mil'|'bel'|'neper'|'pH'|'petro_barrel'|'footlambert'|'footcandle'|'carat'|'bit'|'byte'})" [1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 19 — XML Instance Representation

- - -
<xsd:element name="EnumeratedRootUnit" type="EnumeratedRootUnitType" />

Figure 20 — Schema Component Representation

- - -
-

1.11.  Element: ExternalRootUnit

- - - - - -

1.11.3.  Description Element for those special cases where the root unit needed is not included in the enumerated list in the above element.

- -
<ExternalRootUnit
 unit="xsd:anyURI" [1]
 annotation="xsd:string" [0..1]
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 21 — XML Instance Representation

- - -
<xsd:element name="ExternalRootUnit" type="ExternalRootUnitType" />

Figure 22 — Schema Component Representation

- - -
-

1.12.  Element: Conversions

- - - - - -

1.12.3.  Description Container for providing conversion information to other units.

- -
<Conversions>
  <Float64ConversionFrom> ... </Float64ConversionFrom> [0..*]
  <SpecialConversionFrom> ... </SpecialConversionFrom> [0..*]
  <WSDLConversionFrom> ... </WSDLConversionFrom> [0..*]
</Conversions>

Figure 23 — XML Instance Representation

- - -
<xsd:element name="Conversions" type="ConversionsType" />

Figure 24 — Schema Component Representation

- - -
-

1.13.  Element: Float64ConversionFrom

- - - - - -

1.13.3.  Description Element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a))

- -
<Float64ConversionFrom
 xml:id="" [1]
 initialAddend="xsd:double" [0..1]
 initialAddendDecimalPlace="xsd:byte" [0..1]
 multiplicand="xsd:double" [0..1]
 multiplicandDigits="xsd:unsignedByte" [0..1]
 divisor="xsd:double" [0..1]
 divisorDigits="xsd:unsignedByte" [0..1]
 finalAddend="xsd:double" [0..1]
 finalAddendDecimalPlace="xsd:byte" [0..1]
 exact="xsd:boolean" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionNote> ... </ConversionNote> [0..*]
</Float64ConversionFrom>

Figure 25 — XML Instance Representation

- - -
<xsd:element name="Float64ConversionFrom" type="Float64ConversionFromType" />

Figure 26 — Schema Component Representation

- - -
-

1.14.  Element: ConversionNote

- - - - - -

1.14.3.  Description Element for descriptive information.

- -
<ConversionNote
 xml:lang="" [0..1]
>
  xsd:string
</ConversionNote>

Figure 27 — XML Instance Representation

- - -
<xsd:element name="ConversionNote" type="NoteType" />

Figure 28 — Schema Component Representation

- - -
-

1.15.  Element: SpecialConversionFrom

- - - - - -

1.15.3.  Description Element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation.

- -
<SpecialConversionFrom
 xml:id="" [1]
 conversionURL="xsd:anyURI" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionDescription> ... </ConversionDescription> [0..*]
</SpecialConversionFrom>

Figure 29 — XML Instance Representation

- - -
<xsd:element name="SpecialConversionFrom" type="SpecialConversionFromType" />

Figure 30 — Schema Component Representation

- - -
-

1.16.  Element: WSDLConversionFrom

- - - - - -

1.16.3.  Description Element for providing conversion based on SOAP/WSDL calls to a remote server.

- -
<WSDLConversionFrom
 xml:id="" [1]
 wsdlURL="xsd:anyURI" [1]
 initialUnit="xsd:anyURI" [1]
>
  <WSDLDescription> ... </WSDLDescription> [0..*]
</WSDLConversionFrom>

Figure 31 — XML Instance Representation

- - -
<xsd:element name="WSDLConversionFrom" type="WSDLConversionFromType" />

Figure 32 — Schema Component Representation

- - -
-

1.17.  Element: WSDLDescription

- - - - - -

1.17.3.  Description Element to describe the WSDL service.

- -
<WSDLDescription
 xml:lang="" [0..1]
>
  xsd:string
</WSDLDescription>

Figure 33 — XML Instance Representation

- - -
<xsd:element name="WSDLDescription" type="NoteType" />

Figure 34 — Schema Component Representation

- - -
-

1.18.  Element: ConversionDescription

- - - - - -

1.18.3.  Description Element for a description of the SpecialConversionFrom.

- -
<ConversionDescription
 xml:lang="" [0..1]
>
  xsd:string
</ConversionDescription>

Figure 35 — XML Instance Representation

- - -
<xsd:element name="ConversionDescription" type="NoteType" />

Figure 36 — Schema Component Representation

- - -
-

1.19.  Element: QuantityReference

- - - - - -

1.19.3.  Description Element for all quantities that can be expressed using this unit.

- -
<QuantityReference
 url="xsd:anyURI" [1]
 name="xsd:token" [0..1]
 xml:lang="" [0..1]
/>

Figure 37 — XML Instance Representation

- - -
<xsd:element name="QuantityReference" type="ReferenceType" />

Figure 38 — Schema Component Representation

- - -
-

1.20.  Element: UnitDefinition

- - - - - -

1.20.3.  Description Element to describe the definition of the unit.

- -
<UnitDefinition
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</UnitDefinition>

Figure 39 — XML Instance Representation

- - -
<xsd:element name="UnitDefinition" type="DefinitionType" />

Figure 40 — Schema Component Representation

- - -
-

1.21.  Element: UnitHistory

- - - - - -

1.21.3.  Description Element to describe the historical development of the unit.

- -
<UnitHistory
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</UnitHistory>

Figure 41 — XML Instance Representation

- - -
<xsd:element name="UnitHistory" type="HistoryType" />

Figure 42 — Schema Component Representation

- - -
-

1.22.  Element: UnitRemark

- - - - - -

1.22.3.  Description Element as a placeholder for additional information.

- -
<UnitRemark
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</UnitRemark>

Figure 43 — XML Instance Representation

- - -
<xsd:element name="UnitRemark" type="RemarkType" />

Figure 44 — Schema Component Representation

- - -
-

1.23.  Element: CountedItemSet

- - - - - -

1.23.3.  Description Container for items that are counted and are (in practice) combined with scientific units of measure.

- -
<CountedItemSet>
  <CountedItem> ... </CountedItem> [1..*]
</CountedItemSet>

Figure 45 — XML Instance Representation

- - -
<xsd:element name="CountedItemSet" type="CountedItemSetType" />

Figure 46 — Schema Component Representation

- - -
-

1.24.  Element: CountedItem

- - - - - -

1.24.3.  Description Container for a single counted item.

- -
<CountedItem
 xml:id="" [1]
>
  <ItemName> ... </ItemName> [1..*]
  <ItemSymbol> ... </ItemSymbol> [0..*]
  <ItemVersionHistory> ... </ItemVersionHistory> [0..*]
  <ItemDefinition> ... </ItemDefinition> [0..*]
  <ItemHistory> ... </ItemHistory> [0..*]
  <ItemRemark> ... </ItemRemark> [0..*]
</CountedItem>

Figure 47 — XML Instance Representation

- - -
<xsd:element name="CountedItem" type="CountedItemType" />

Figure 48 — Schema Component Representation

- - -
-

1.25.  Element: ItemName

- - - - - -

1.25.3.  Description Element containing the item name(s).

- -
<ItemName
 xml:lang="" [0..1]
>
  xsd:token
</ItemName>

Figure 49 — XML Instance Representation

- - -
<xsd:element name="ItemName" type="NameType" />

Figure 50 — Schema Component Representation

- - -
-

1.26.  Element: ItemSymbol

- - - - - -

1.26.3.  Description Element containing symbols for the item.

- -
<ItemSymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 51 — XML Instance Representation

- - -
<xsd:element name="ItemSymbol" type="SymbolType" />

Figure 52 — Schema Component Representation

- - -
-

1.27.  Element: ItemVersionHistory

- - - - - -

1.27.3.  Description Element for descriptive information, including version changes to the item.

- -
<ItemVersionHistory
 xml:lang="" [0..1]
>
  xsd:string
</ItemVersionHistory>

Figure 53 — XML Instance Representation

- - -
<xsd:element name="ItemVersionHistory" type="NoteType" />

Figure 54 — Schema Component Representation

- - -
-

1.28.  Element: ItemDefinition

- - - - - -

1.28.3.  Description Element to describe the definition of the item.

- -
<ItemDefinition
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</ItemDefinition>

Figure 55 — XML Instance Representation

- - -
<xsd:element name="ItemDefinition" type="DefinitionType" />

Figure 56 — Schema Component Representation

- - -
-

1.29.  Element: ItemHistory

- - - - - -

1.29.3.  Description Element to describe the historical development of the item.

- -
<ItemHistory
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</ItemHistory>

Figure 57 — XML Instance Representation

- - -
<xsd:element name="ItemHistory" type="HistoryType" />

Figure 58 — Schema Component Representation

- - -
-

1.30.  Element: ItemRemark

- - - - - -

1.30.3.  Description Element as a placeholder for additional information.

- -
<ItemRemark
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</ItemRemark>

Figure 59 — XML Instance Representation

- - -
<xsd:element name="ItemRemark" type="RemarkType" />

Figure 60 — Schema Component Representation

- - -
-

1.31.  Element: QuantitySet

- - - - - -

1.31.3.  Description Container for quantities.

- -
<QuantitySet>
  <Quantity> ... </Quantity> [1..*]
</QuantitySet>

Figure 61 — XML Instance Representation

- - -
<xsd:element name="QuantitySet" type="QuantitySetType" />

Figure 62 — Schema Component Representation

- - -
-

1.32.  Element: Quantity

- - - - - -

1.32.3.  Description Element for describing quantities and referencing corresponding units. Use in container or directly incorporate into a host schema.

- -
<Quantity
 xml:id="" [1]
 quantityType="xsd:token (value comes from list: {'base'|'derived'})" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <QuantityName> ... </QuantityName> [1..*]
  <QuantitySymbol> ... </QuantitySymbol> [0..*]
  <UnitReference> ... </UnitReference> [0..*]
  <QuantityVersionHistory> ... </QuantityVersionHistory> [0..*]
  <QuantityDefinition> ... </QuantityDefinition> [0..*]
  <QuantityHistory> ... </QuantityHistory> [0..*]
  <QuantityRemark> ... </QuantityRemark> [0..*]
</Quantity>

Figure 63 — XML Instance Representation

- - -
<xsd:element name="Quantity" type="QuantityType" />

Figure 64 — Schema Component Representation

- - -
-

1.33.  Element: QuantityName

- - - - - -

1.33.3.  Description Element containing the quantity name.

- -
<QuantityName
 xml:lang="" [0..1]
>
  xsd:token
</QuantityName>

Figure 65 — XML Instance Representation

- - -
<xsd:element name="QuantityName" type="NameType" />

Figure 66 — Schema Component Representation

- - -
-

1.34.  Element: QuantitySymbol

- - - - - -

1.34.3.  Description Element containing various quantity symbols.

- -
<QuantitySymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 67 — XML Instance Representation

- - -
<xsd:element name="QuantitySymbol" type="SymbolType" />

Figure 68 — Schema Component Representation

- - -
-

1.35.  Element: UnitReference

- - - - - -

1.35.3.  Description Element for referencing a unit of measure from within the Quantity element.

- -
<UnitReference
 url="xsd:anyURI" [1]
 name="xsd:token" [0..1]
 xml:lang="" [0..1]
/>

Figure 69 — XML Instance Representation

- - -
<xsd:element name="UnitReference" type="ReferenceType" />

Figure 70 — Schema Component Representation

- - -
-

1.36.  Element: QuantityVersionHistory

- - - - - -

1.36.3.  Description Element for descriptive information, including version changes to the unit.

- -
<QuantityVersionHistory
 xml:lang="" [0..1]
>
  xsd:string
</QuantityVersionHistory>

Figure 71 — XML Instance Representation

- - -
<xsd:element name="QuantityVersionHistory" type="NoteType" />

Figure 72 — Schema Component Representation

- - -
-

1.37.  Element: QuantityDefinition

- - - - - -

1.37.3.  Description Element to describe the definition of the quantity.

- -
<QuantityDefinition
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</QuantityDefinition>

Figure 73 — XML Instance Representation

- - -
<xsd:element name="QuantityDefinition" type="DefinitionType" />

Figure 74 — Schema Component Representation

- - -
-

1.38.  Element: QuantityHistory

- - - - - -

1.38.3.  Description Element to describe the historical development of the quantity.

- -
<QuantityHistory
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</QuantityHistory>

Figure 75 — XML Instance Representation

- - -
<xsd:element name="QuantityHistory" type="HistoryType" />

Figure 76 — Schema Component Representation

- - -
-

1.39.  Element: QuantityRemark

- - - - - -

1.39.3.  Description Element as a placeholder for additional information.

- -
<QuantityRemark
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</QuantityRemark>

Figure 77 — XML Instance Representation

- - -
<xsd:element name="QuantityRemark" type="RemarkType" />

Figure 78 — Schema Component Representation

- - -
-

1.40.  Element: DimensionSet

- - - - - -

1.40.3.  Description Container for dimensions.

- -
<DimensionSet>
  <Dimension> ... </Dimension> [1..*]
</DimensionSet>

Figure 79 — XML Instance Representation

- - -
<xsd:element name="DimensionSet" type="DimensionSetType" />

Figure 80 — Schema Component Representation

- - -
-

1.41.  Element: Dimension

- - - - - -

1.41.3.  Description Element to express the dimension of a unit or quantity in terms of the SI base quantities length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity.

- -
<Dimension
 xml:id="" [1]
 dimensionless="xsd:boolean" [0..1]
>
  <Length> ... </Length> [0..1]
  <Mass> ... </Mass> [0..1]
  <Time> ... </Time> [0..1]
  <ElectricCurrent> ... </ElectricCurrent> [0..1]
  <ThermodynamicTemperature> ... </ThermodynamicTemperature> [0..1]
  <AmountOfSubstance> ... </AmountOfSubstance> [0..1]
  <LuminousIntensity> ... </LuminousIntensity> [0..1]
  <PlaneAngle> ... </PlaneAngle> [0..1]
  <Item> ... </Item> [0..*]
</Dimension>

Figure 81 — XML Instance Representation

- - -
<xsd:element name="Dimension" type="DimensionType" />

Figure 82 — Schema Component Representation

- - -
-

1.42.  Element: Length

- - - - - -

1.42.3.  Description Element containing the dimension of the quantity length.

- -
<Length
 symbol="L" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 83 — XML Instance Representation

- - -
<xsd:element name="Length" type="LengthType" />

Figure 84 — Schema Component Representation

- - -
-

1.43.  Element: Mass

- - - - - -

1.43.3.  Description Element containing the dimension of the quantity mass.

- -
<Mass
 symbol="M" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 85 — XML Instance Representation

- - -
<xsd:element name="Mass" type="MassType" />

Figure 86 — Schema Component Representation

- - -
-

1.44.  Element: Time

- - - - - -

1.44.3.  Description Element containing the dimension of the quantity time.

- -
<Time
 symbol="T" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 87 — XML Instance Representation

- - -
<xsd:element name="Time" type="TimeType" />

Figure 88 — Schema Component Representation

- - -
-

1.45.  Element: ElectricCurrent

- - - - - -

1.45.3.  Description Element containing the dimension of the quantity electric current.

- -
<ElectricCurrent
 symbol="I" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 89 — XML Instance Representation

- - -
<xsd:element name="ElectricCurrent" type="ElectricCurrentType" />

Figure 90 — Schema Component Representation

- - -
-

1.46.  Element: ThermodynamicTemperature

- - - - - -

1.46.3.  Description Element containing the dimension of the quantity thermodynamic temerature.

- -
<ThermodynamicTemperature
 symbol="Θ" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 91 — XML Instance Representation

- - -
<xsd:element name="ThermodynamicTemperature" type="ThermodynamicTemperatureType" />

Figure 92 — Schema Component Representation

- - -
-

1.47.  Element: AmountOfSubstance

- - - - - -

1.47.3.  Description Element containing the dimension of the quantity amount of substance.

- -
<AmountOfSubstance
 symbol="N" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 93 — XML Instance Representation

- - -
<xsd:element name="AmountOfSubstance" type="AmountOfSubstanceType" />

Figure 94 — Schema Component Representation

- - -
-

1.48.  Element: LuminousIntensity

- - - - - -

1.48.3.  Description Element containing the dimension of the quantity luminous intensity.

- -
<LuminousIntensity
 symbol="J" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 95 — XML Instance Representation

- - -
<xsd:element name="LuminousIntensity" type="LuminousIntensityType" />

Figure 96 — Schema Component Representation

- - -
-

1.49.  Element: PlaneAngle

- - - - - -

1.49.3.  Description Element containing the dimension of the quantity plane angle.

- -
<PlaneAngle
 symbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 97 — XML Instance Representation

- - -
<xsd:element name="PlaneAngle" type="PlaneAngleType" />

Figure 98 — Schema Component Representation

- - -
-

1.50.  Element: Item

- - - - - -

1.50.3.  Description Element containing the dimension of any item. Note: this element is meant to be used to allow counted items to be included in the dimensioning of a derived quantity, e.g., electrons per time; usage of this element does not conform to the SI description of the dimension of a quantity in terms of seven base quantities.

- -
<Item
 itemURL="xsd:anyURI" [1]
 itemSymbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 99 — XML Instance Representation

- - -
<xsd:element name="Item" type="ItemType" />

Figure 100 — Schema Component Representation

- - -
-

1.51.  Element: PrefixSet

- - - - - -

1.51.3.  Description Container for prefixes.

- -
<PrefixSet>
  <Prefix> ... </Prefix> [1..*]
</PrefixSet>

Figure 101 — XML Instance Representation

- - -
<xsd:element name="PrefixSet" type="PrefixSetType" />

Figure 102 — Schema Component Representation

- - -
-

1.52.  Element: Prefix

- - - - - -

1.52.3.  Description Element containing information about a prefix.

- -
<Prefix
 xml:id="" [1]
 prefixBase="xsd:byte (value comes from list: {'10'|'2'})" [0..1]
 prefixPower="xsd:byte" [0..1]
>
  <PrefixName> ... </PrefixName> [1..*]
  <PrefixSymbol> ... </PrefixSymbol> [0..*]
</Prefix>

Figure 103 — XML Instance Representation

- - -
<xsd:element name="Prefix" type="PrefixType" />

Figure 104 — Schema Component Representation

- - -
-

1.53.  Element: PrefixName

- - - - - -

1.53.3.  Description Element containing the prefix name.

- -
<PrefixName
 xml:lang="" [0..1]
>
  xsd:token
</PrefixName>

Figure 105 — XML Instance Representation

- - -
<xsd:element name="PrefixName" type="NameType" />

Figure 106 — Schema Component Representation

- - -
-

1.54.  Element: PrefixSymbol

- - - - - -

1.54.3.  Description Element containing prefix symbols.

- -
<PrefixSymbol
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 107 — XML Instance Representation

- - -
<xsd:element name="PrefixSymbol" type="SymbolType" />

Figure 108 — Schema Component Representation

- - -
-

2.  Complex Types

2.1.  Complex Type: UnitsMLType

- -

2.1.1.  Used By UnitsML

- -

Description ComplexType for the root element of an UnitsML document.

- -
<...>
  <UnitSet> ... </UnitSet> [0..1]
  <CountedItemSet> ... </CountedItemSet> [0..1]
  <QuantitySet> ... </QuantitySet> [0..1]
  <DimensionSet> ... </DimensionSet> [0..1]
  <PrefixSet> ... </PrefixSet> [0..1]
</...>

Figure 109 — XML Instance Representation

- - -
<xsd:complexType name="UnitsMLType">
  <xsd:sequence>
    <xsd:element ref="UnitSet" minOccurs="0"/>
    <xsd:element ref="CountedItemSet" minOccurs="0"/>
    <xsd:element ref="QuantitySet" minOccurs="0"/>
    <xsd:element ref="DimensionSet" minOccurs="0"/>
    <xsd:element ref="PrefixSet" minOccurs="0"/>
  </xsd:sequence>
</xsd:complexType>

Figure 110 — Schema Component Representation

- - -
-

2.2.  Complex Type: UnitSetType

- -

2.2.1.  Used By UnitSet

- -

Description Type for the unit container.

- -
<...>
  <Unit> ... </Unit> [1..*]
</...>

Figure 111 — XML Instance Representation

- - -
<xsd:complexType name="UnitSetType">
  <xsd:sequence>
    <xsd:element ref="Unit" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 112 — Schema Component Representation

- - -
-

2.3.  Complex Type: UnitType

- -

2.3.1.  Used By Unit

- -

Description Type for the unit.

- -
<...
 xml:id="" [1]
 timeStamp="xsd:dateTime" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <UnitSystem> ... </UnitSystem> [0..*]
  <UnitName> ... </UnitName> [1..*]
  <UnitSymbol> ... </UnitSymbol> [0..*]
  <CodeListValue> ... </CodeListValue> [0..*]
  <RootUnits> ... </RootUnits> [0..1]
  <Conversions> ... </Conversions> [0..1]
  <QuantityReference> ... </QuantityReference> [0..*]
  <UnitVersionHistory> ... </UnitVersionHistory> [0..*]
  <UnitDefinition> ... </UnitDefinition> [0..*]
  <UnitHistory> ... </UnitHistory> [0..*]
  <UnitRemark> ... </UnitRemark> [0..*]
</...>

Figure 113 — XML Instance Representation

- - -
<xsd:complexType name="UnitType">
  <xsd:sequence>
    <xsd:element ref="UnitSystem" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitName" maxOccurs="unbounded"/>
    <xsd:element ref="UnitSymbol" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="CodeListValue" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="RootUnits" minOccurs="0"/>
    <xsd:element ref="Conversions" minOccurs="0"/>
    <xsd:element ref="QuantityReference" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitVersionHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitDefinition" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitRemark" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="timeStamp" type="xsd:dateTime" use="optional"/>
  <xsd:attributeGroup ref="dimensionURL"/>
</xsd:complexType>

Figure 114 — Schema Component Representation

- - -
-

2.4.  Complex Type: CodeListValueType

- -

2.4.1.  Used By CodeListValue

- -

Description Type for the element for listing the unit code value from a specific code list.

- -
<...
 unitCodeValue="xsd:string" [1]
 codeListName="xsd:normalizedString" [0..1]
 codeListVersion="xsd:token" [0..1]
 locationURL="xsd:anyURI" [0..1]
 organizationName="xsd:normalizedString" [0..1]
 organizationURI="xsd:anyURI" [0..1]
 xml:lang="" [0..1]
/>

Figure 115 — XML Instance Representation

- - -
<xsd:complexType name="CodeListValueType">
  <xsd:attribute name="unitCodeValue" type="xsd:string" use="required"/>
  <xsd:attribute name="codeListName" type="xsd:normalizedString" use="optional"/>
  <xsd:attribute name="codeListVersion" type="xsd:token" use="optional"/>
  <xsd:attribute name="locationURL" type="xsd:anyURI" use="optional"/>
  <xsd:attribute name="organizationName" type="xsd:normalizedString" use="optional"/>
  <xsd:attribute name="organizationURI" type="xsd:anyURI" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
</xsd:complexType>

Figure 116 — Schema Component Representation

- - -
-

2.5.  Complex Type: RootUnitsType

- -

2.5.1.  Used By RootUnits

- -

Description Type for the container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered base units.

- -
<...>
  <EnumeratedRootUnit> ... </EnumeratedRootUnit> [0..*]
  <ExternalRootUnit> ... </ExternalRootUnit> [0..*]
</...>

Figure 117 — XML Instance Representation

- - -
<xsd:complexType name="RootUnitsType">
  <xsd:sequence>
    <xsd:element ref="EnumeratedRootUnit" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ExternalRootUnit" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 118 — Schema Component Representation

- - -
-

2.6.  Complex Type: EnumeratedRootUnitType

- -

2.6.1.  Used By EnumeratedRootUnit

- -

Description Type for the element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2

- -
<...
 unit="xsd:token (value comes from list: {'meter'|'gram'|'second'|'ampere'|'kelvin'|'mole'|'candela'|'radian'|'steradian'|'hertz'|'newton'|'pascal'|'joule'|'watt'|'coulomb'|'volt'|'farad'|'ohm'|'siemens'|'weber'|'tesla'|'henry'|'degree_Celsius'|'lumen'|'lux'|'katal'|'becquerel'|'gray'|'sievert'|'minute'|'hour'|'day'|'arc_degree'|'arc_minute'|'arc_second'|'liter'|'metric_ton'|'electronvolt'|'unified_atomic_mass_unit'|'astronomical_unit'|'atomic_unit_of_1st_hyperpolarizability'|'atomic_unit_of_2nd_hyperpolarizability'|'atomic_unit_of_action'|'atomic_unit_of_charge'|'atomic_unit_of_charge_density'|'atomic_unit_of_current'|'atomic_unit_of_electric_dipole_moment'|'atomic_unit_of_electric_field'|'atomic_unit_of_electric_field_gradient'|'atomic_unit_of_electric_polarizability'|'atomic_unit_of_electric_potential'|'atomic_unit_of_electric_quadrupole_moment'|'atomic_unit_of_energy'|'atomic_unit_of_force'|'atomic_unit_of_length'|'atomic_unit_of_magnetic_dipole_moment'|'atomic_unit_of_magnetic_flux_density'|'atomic_unit_of_magnetizability'|'atomic_unit_of_mass'|'atomic_unit_of_momentum'|'atomic_unit_of_permittivity'|'atomic_unit_of_time'|'atomic_unit_of_velocity'|'natural_unit_of_action'|'natural_unit_of_action_in_eV_s'|'natural_unit_of_energy'|'natural_unit_of_energy_in_MeV'|'natural_unit_of_length'|'natural_unit_of_mass'|'natural_unit_of_momentum'|'natural_unit_of_momentum_in_MeV_per_c'|'natural_unit_of_time'|'natural_unit_of_velocity'|'nautical_mile'|'knot'|'angstrom'|'are'|'hectare'|'barn'|'bar'|'gal'|'curie'|'roentgen'|'rad'|'rem'|'erg'|'dyne'|'barye'|'poise'|'rhe'|'stokes'|'darcy'|'kayser'|'lambert'|'phot'|'thermo_calorie'|'table_calorie'|'debye'|'abampere'|'abcoulomb'|'abfarad'|'abhenry'|'abohm'|'abmho'|'abvolt'|'abwatt'|'maxwell'|'gauss'|'gilbert'|'oersted'|'stilb'|'statampere'|'statcoulomb'|'statfarad'|'stathenry'|'statohm'|'statmho'|'statvolt'|'statwatt'|'statweber'|'stattesla'|'long_ton'|'short_ton'|'gross_hundredweight'|'hundredweight'|'av_pound'|'av_ounce'|'av_dram'|'troy_pound'|'troy_ounce'|'pennyweight'|'apothecaries_dram'|'scruple'|'grain'|'slug'|'pound_force'|'poundal'|'kip'|'ton_force'|'gram_force'|'inch'|'foot'|'yard'|'mile'|'us_survey_inch'|'us_survey_foot'|'us_survey_yard'|'us_survey_fathom'|'us_survey_rod'|'us_survey_chain'|'us_survey_link'|'us_survey_furlong'|'us_survey_mile'|'us_acre'|'imperial_gallon'|'imperial_quart'|'imperial_pint'|'imperial_gill'|'imperial_ounce'|'us_gallon'|'us_quart'|'us_pint'|'us_cup'|'us_gill'|'us_fluid_ounce'|'us_fluid_dram'|'us_minim'|'us_tablespoon'|'us_teaspoon'|'us_bushel'|'us_peck'|'us_dry_quart'|'us_dry_pint'|'thermo_kg_calorie'|'table_kg_calorie'|'us_label_teaspoon'|'us_label_tablespoon'|'us_label_cup'|'us_label_fluid_ounce'|'us_label_ounce'|'horsepower'|'electric_horsepower'|'boiler_horsepower'|'metric_horsepower'|'water_horsepower'|'uk_horsepower'|'degree_Fahrenheit'|'degree_Rankine'|'torr'|'standard_atmosphere'|'technical_atmosphere'|'mm_Hg'|'cm_Hg'|'0C_cm_Hg'|'in_Hg'|'32F_in_Hg'|'60F_in_Hg'|'ft_Hg'|'mm_water'|'cm_water'|'4C_cm_water'|'in_water'|'39F_in_water'|'60F_in_water'|'ft_water'|'39F_ft_water'|'light_year'|'light_week'|'light_hour'|'light_minute'|'light_second'|'parsec'|'printers_pica'|'computer_pica'|'printers_point'|'computer_point'|'thermo_btu'|'table_btu'|'mean_btu'|'39F_btu'|'59F_btu'|'60F_btu'|'tons_of_tnt'|'ec_therm'|'us_therm'|'year_365'|'tropical_year'|'sidereal_year'|'sidereal_day'|'sidereal_hour'|'sidereal_minute'|'sidereal_second'|'shake'|'denier'|'tex'|'gon'|'nato_mil'|'pound_mole'|'ton_refrigeration'|'circular_mil'|'bel'|'neper'|'pH'|'petro_barrel'|'footlambert'|'footcandle'|'carat'|'bit'|'byte'})" [1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 119 — XML Instance Representation

- - -
<xsd:complexType name="EnumeratedRootUnitType">
  <xsd:attribute name="unit" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="meter"/>
        <xsd:enumeration value="gram"/>
        <xsd:enumeration value="second"/>
        <xsd:enumeration value="ampere"/>
        <xsd:enumeration value="kelvin"/>
        <xsd:enumeration value="mole"/>
        <xsd:enumeration value="candela"/>
        <xsd:enumeration value="radian"/>
        <xsd:enumeration value="steradian"/>
        <xsd:enumeration value="hertz"/>
        <xsd:enumeration value="newton"/>
        <xsd:enumeration value="pascal"/>
        <xsd:enumeration value="joule"/>
        <xsd:enumeration value="watt"/>
        <xsd:enumeration value="coulomb"/>
        <xsd:enumeration value="volt"/>
        <xsd:enumeration value="farad"/>
        <xsd:enumeration value="ohm"/>
        <xsd:enumeration value="siemens"/>
        <xsd:enumeration value="weber"/>
        <xsd:enumeration value="tesla"/>
        <xsd:enumeration value="henry"/>
        <xsd:enumeration value="degree_Celsius"/>
        <xsd:enumeration value="lumen"/>
        <xsd:enumeration value="lux"/>
        <xsd:enumeration value="katal"/>
        <xsd:enumeration value="becquerel"/>
        <xsd:enumeration value="gray"/>
        <xsd:enumeration value="sievert"/>
        <xsd:enumeration value="minute"/>
        <xsd:enumeration value="hour"/>
        <xsd:enumeration value="day"/>
        <xsd:enumeration value="arc_degree"/>
        <xsd:enumeration value="arc_minute"/>
        <xsd:enumeration value="arc_second"/>
        <xsd:enumeration value="liter"/>
        <xsd:enumeration value="metric_ton"/>
        <xsd:enumeration value="electronvolt"/>
        <xsd:enumeration value="unified_atomic_mass_unit"/>
        <xsd:enumeration value="astronomical_unit"/>
        <xsd:enumeration value="atomic_unit_of_1st_hyperpolarizability"/>
        <xsd:enumeration value="atomic_unit_of_2nd_hyperpolarizability"/>
        <xsd:enumeration value="atomic_unit_of_action"/>
        <xsd:enumeration value="atomic_unit_of_charge"/>
        <xsd:enumeration value="atomic_unit_of_charge_density"/>
        <xsd:enumeration value="atomic_unit_of_current"/>
        <xsd:enumeration value="atomic_unit_of_electric_dipole_moment"/>
        <xsd:enumeration value="atomic_unit_of_electric_field"/>
        <xsd:enumeration value="atomic_unit_of_electric_field_gradient"/>
        <xsd:enumeration value="atomic_unit_of_electric_polarizability"/>
        <xsd:enumeration value="atomic_unit_of_electric_potential"/>
        <xsd:enumeration value="atomic_unit_of_electric_quadrupole_moment"/>
        <xsd:enumeration value="atomic_unit_of_energy"/>
        <xsd:enumeration value="atomic_unit_of_force"/>
        <xsd:enumeration value="atomic_unit_of_length"/>
        <xsd:enumeration value="atomic_unit_of_magnetic_dipole_moment"/>
        <xsd:enumeration value="atomic_unit_of_magnetic_flux_density"/>
        <xsd:enumeration value="atomic_unit_of_magnetizability"/>
        <xsd:enumeration value="atomic_unit_of_mass"/>
        <xsd:enumeration value="atomic_unit_of_momentum"/>
        <xsd:enumeration value="atomic_unit_of_permittivity"/>
        <xsd:enumeration value="atomic_unit_of_time"/>
        <xsd:enumeration value="atomic_unit_of_velocity"/>
        <xsd:enumeration value="natural_unit_of_action"/>
        <xsd:enumeration value="natural_unit_of_action_in_eV_s"/>
        <xsd:enumeration value="natural_unit_of_energy"/>
        <xsd:enumeration value="natural_unit_of_energy_in_MeV"/>
        <xsd:enumeration value="natural_unit_of_length"/>
        <xsd:enumeration value="natural_unit_of_mass"/>
        <xsd:enumeration value="natural_unit_of_momentum"/>
        <xsd:enumeration value="natural_unit_of_momentum_in_MeV_per_c"/>
        <xsd:enumeration value="natural_unit_of_time"/>
        <xsd:enumeration value="natural_unit_of_velocity"/>
        <xsd:enumeration value="nautical_mile"/>
        <xsd:enumeration value="knot"/>
        <xsd:enumeration value="angstrom"/>
        <xsd:enumeration value="are"/>
        <xsd:enumeration value="hectare"/>
        <xsd:enumeration value="barn"/>
        <xsd:enumeration value="bar"/>
        <xsd:enumeration value="gal"/>
        <xsd:enumeration value="curie"/>
        <xsd:enumeration value="roentgen"/>
        <xsd:enumeration value="rad"/>
        <xsd:enumeration value="rem"/>
        <xsd:enumeration value="erg"/>
        <xsd:enumeration value="dyne"/>
        <xsd:enumeration value="barye"/>
        <xsd:enumeration value="poise"/>
        <xsd:enumeration value="rhe"/>
        <xsd:enumeration value="stokes"/>
        <xsd:enumeration value="darcy"/>
        <xsd:enumeration value="kayser"/>
        <xsd:enumeration value="lambert"/>
        <xsd:enumeration value="phot"/>
        <xsd:enumeration value="thermo_calorie"/>
        <xsd:enumeration value="table_calorie"/>
        <xsd:enumeration value="debye"/>
        <xsd:enumeration value="abampere"/>
        <xsd:enumeration value="abcoulomb"/>
        <xsd:enumeration value="abfarad"/>
        <xsd:enumeration value="abhenry"/>
        <xsd:enumeration value="abohm"/>
        <xsd:enumeration value="abmho"/>
        <xsd:enumeration value="abvolt"/>
        <xsd:enumeration value="abwatt"/>
        <xsd:enumeration value="maxwell"/>
        <xsd:enumeration value="gauss"/>
        <xsd:enumeration value="gilbert"/>
        <xsd:enumeration value="oersted"/>
        <xsd:enumeration value="stilb"/>
        <xsd:enumeration value="statampere"/>
        <xsd:enumeration value="statcoulomb"/>
        <xsd:enumeration value="statfarad"/>
        <xsd:enumeration value="stathenry"/>
        <xsd:enumeration value="statohm"/>
        <xsd:enumeration value="statmho"/>
        <xsd:enumeration value="statvolt"/>
        <xsd:enumeration value="statwatt"/>
        <xsd:enumeration value="statweber"/>
        <xsd:enumeration value="stattesla"/>
        <xsd:enumeration value="long_ton"/>
        <xsd:enumeration value="short_ton"/>
        <xsd:enumeration value="gross_hundredweight"/>
        <xsd:enumeration value="hundredweight"/>
        <xsd:enumeration value="av_pound"/>
        <xsd:enumeration value="av_ounce"/>
        <xsd:enumeration value="av_dram"/>
        <xsd:enumeration value="troy_pound"/>
        <xsd:enumeration value="troy_ounce"/>
        <xsd:enumeration value="pennyweight"/>
        <xsd:enumeration value="apothecaries_dram"/>
        <xsd:enumeration value="scruple"/>
        <xsd:enumeration value="grain"/>
        <xsd:enumeration value="slug"/>
        <xsd:enumeration value="pound_force"/>
        <xsd:enumeration value="poundal"/>
        <xsd:enumeration value="kip"/>
        <xsd:enumeration value="ton_force"/>
        <xsd:enumeration value="gram_force"/>
        <xsd:enumeration value="inch"/>
        <xsd:enumeration value="foot"/>
        <xsd:enumeration value="yard"/>
        <xsd:enumeration value="mile"/>
        <xsd:enumeration value="us_survey_inch"/>
        <xsd:enumeration value="us_survey_foot"/>
        <xsd:enumeration value="us_survey_yard"/>
        <xsd:enumeration value="us_survey_fathom"/>
        <xsd:enumeration value="us_survey_rod"/>
        <xsd:enumeration value="us_survey_chain"/>
        <xsd:enumeration value="us_survey_link"/>
        <xsd:enumeration value="us_survey_furlong"/>
        <xsd:enumeration value="us_survey_mile"/>
        <xsd:enumeration value="us_acre"/>
        <xsd:enumeration value="imperial_gallon"/>
        <xsd:enumeration value="imperial_quart"/>
        <xsd:enumeration value="imperial_pint"/>
        <xsd:enumeration value="imperial_gill"/>
        <xsd:enumeration value="imperial_ounce"/>
        <xsd:enumeration value="us_gallon"/>
        <xsd:enumeration value="us_quart"/>
        <xsd:enumeration value="us_pint"/>
        <xsd:enumeration value="us_cup"/>
        <xsd:enumeration value="us_gill"/>
        <xsd:enumeration value="us_fluid_ounce"/>
        <xsd:enumeration value="us_fluid_dram"/>
        <xsd:enumeration value="us_minim"/>
        <xsd:enumeration value="us_tablespoon"/>
        <xsd:enumeration value="us_teaspoon"/>
        <xsd:enumeration value="us_bushel"/>
        <xsd:enumeration value="us_peck"/>
        <xsd:enumeration value="us_dry_quart"/>
        <xsd:enumeration value="us_dry_pint"/>
        <xsd:enumeration value="thermo_kg_calorie"/>
        <xsd:enumeration value="table_kg_calorie"/>
        <xsd:enumeration value="us_label_teaspoon"/>
        <xsd:enumeration value="us_label_tablespoon"/>
        <xsd:enumeration value="us_label_cup"/>
        <xsd:enumeration value="us_label_fluid_ounce"/>
        <xsd:enumeration value="us_label_ounce"/>
        <xsd:enumeration value="horsepower"/>
        <xsd:enumeration value="electric_horsepower"/>
        <xsd:enumeration value="boiler_horsepower"/>
        <xsd:enumeration value="metric_horsepower"/>
        <xsd:enumeration value="water_horsepower"/>
        <xsd:enumeration value="uk_horsepower"/>
        <xsd:enumeration value="degree_Fahrenheit"/>
        <xsd:enumeration value="degree_Rankine"/>
        <xsd:enumeration value="torr"/>
        <xsd:enumeration value="standard_atmosphere"/>
        <xsd:enumeration value="technical_atmosphere"/>
        <xsd:enumeration value="mm_Hg"/>
        <xsd:enumeration value="cm_Hg"/>
        <xsd:enumeration value="0C_cm_Hg"/>
        <xsd:enumeration value="in_Hg"/>
        <xsd:enumeration value="32F_in_Hg"/>
        <xsd:enumeration value="60F_in_Hg"/>
        <xsd:enumeration value="ft_Hg"/>
        <xsd:enumeration value="mm_water"/>
        <xsd:enumeration value="cm_water"/>
        <xsd:enumeration value="4C_cm_water"/>
        <xsd:enumeration value="in_water"/>
        <xsd:enumeration value="39F_in_water"/>
        <xsd:enumeration value="60F_in_water"/>
        <xsd:enumeration value="ft_water"/>
        <xsd:enumeration value="39F_ft_water"/>
        <xsd:enumeration value="light_year"/>
        <xsd:enumeration value="light_week"/>
        <xsd:enumeration value="light_hour"/>
        <xsd:enumeration value="light_minute"/>
        <xsd:enumeration value="light_second"/>
        <xsd:enumeration value="parsec"/>
        <xsd:enumeration value="printers_pica"/>
        <xsd:enumeration value="computer_pica"/>
        <xsd:enumeration value="printers_point"/>
        <xsd:enumeration value="computer_point"/>
        <xsd:enumeration value="thermo_btu"/>
        <xsd:enumeration value="table_btu"/>
        <xsd:enumeration value="mean_btu"/>
        <xsd:enumeration value="39F_btu"/>
        <xsd:enumeration value="59F_btu"/>
        <xsd:enumeration value="60F_btu"/>
        <xsd:enumeration value="tons_of_tnt"/>
        <xsd:enumeration value="ec_therm"/>
        <xsd:enumeration value="us_therm"/>
        <xsd:enumeration value="year_365"/>
        <xsd:enumeration value="tropical_year"/>
        <xsd:enumeration value="sidereal_year"/>
        <xsd:enumeration value="sidereal_day"/>
        <xsd:enumeration value="sidereal_hour"/>
        <xsd:enumeration value="sidereal_minute"/>
        <xsd:enumeration value="sidereal_second"/>
        <xsd:enumeration value="shake"/>
        <xsd:enumeration value="denier"/>
        <xsd:enumeration value="tex"/>
        <xsd:enumeration value="gon"/>
        <xsd:enumeration value="nato_mil"/>
        <xsd:enumeration value="pound_mole"/>
        <xsd:enumeration value="ton_refrigeration"/>
        <xsd:enumeration value="circular_mil"/>
        <xsd:enumeration value="bel"/>
        <xsd:enumeration value="neper"/>
        <xsd:enumeration value="pH"/>
        <xsd:enumeration value="petro_barrel"/>
        <xsd:enumeration value="footlambert"/>
        <xsd:enumeration value="footcandle"/>
        <xsd:enumeration value="carat"/>
        <xsd:enumeration value="bit"/>
        <xsd:enumeration value="byte"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attributeGroup ref="sourceURL"/>
  <xsd:attributeGroup ref="prefix"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 120 — Schema Component Representation

- - -
-

2.7.  Complex Type: ExternalRootUnitType

- -

2.7.1.  Used By ExternalRootUnit

- -

Description Type for the element for those special cases where the root unit needed is not included in the enumerated list in the above element.

- -
<...
 unit="xsd:anyURI" [1]
 annotation="xsd:string" [0..1]
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 121 — XML Instance Representation

- - -
<xsd:complexType name="ExternalRootUnitType">
  <xsd:attribute name="unit" type="xsd:anyURI" use="required"/>
  <xsd:attributeGroup ref="sourceURL"/>
  <xsd:attribute name="annotation" type="xsd:string" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
  <xsd:attributeGroup ref="prefix"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 122 — Schema Component Representation

- - -
-

2.8.  Complex Type: ConversionsType

- -

2.8.1.  Used By Conversions

- -

Description Type for the container for providing conversion information to other units.

- -
<...>
  <Float64ConversionFrom> ... </Float64ConversionFrom> [0..*]
  <SpecialConversionFrom> ... </SpecialConversionFrom> [0..*]
  <WSDLConversionFrom> ... </WSDLConversionFrom> [0..*]
</...>

Figure 123 — XML Instance Representation

- - -
<xsd:complexType name="ConversionsType">
  <xsd:sequence>
    <xsd:element ref="Float64ConversionFrom" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="SpecialConversionFrom" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="WSDLConversionFrom" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 124 — Schema Component Representation

- - -
-

2.9.  Complex Type: Float64ConversionFromType

- -

2.9.1.  Used By Float64ConversionFrom

- -

Description Type for the element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a))

- -
<...
 xml:id="" [1]
 initialAddend="xsd:double" [0..1]
 initialAddendDecimalPlace="xsd:byte" [0..1]
 multiplicand="xsd:double" [0..1]
 multiplicandDigits="xsd:unsignedByte" [0..1]
 divisor="xsd:double" [0..1]
 divisorDigits="xsd:unsignedByte" [0..1]
 finalAddend="xsd:double" [0..1]
 finalAddendDecimalPlace="xsd:byte" [0..1]
 exact="xsd:boolean" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionNote> ... </ConversionNote> [0..*]
</...>

Figure 125 — XML Instance Representation

- - -
<xsd:complexType name="Float64ConversionFromType">
  <xsd:sequence>
    <xsd:element ref="ConversionNote" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attributeGroup ref="initialUnit"/>
  <xsd:attribute name="initialAddend" type="xsd:double" use="optional" default="0"/>
  <xsd:attribute name="initialAddendDecimalPlace" type="xsd:byte" use="optional"/>
  <xsd:attribute name="multiplicand" type="xsd:double" use="optional" default="1"/>
  <xsd:attribute name="multiplicandDigits" type="xsd:unsignedByte" use="optional"/>
  <xsd:attribute name="divisor" type="xsd:double" use="optional" default="1"/>
  <xsd:attribute name="divisorDigits" type="xsd:unsignedByte" use="optional"/>
  <xsd:attribute name="finalAddend" type="xsd:double" use="optional" default="0"/>
  <xsd:attribute name="finalAddendDecimalPlace" type="xsd:byte" use="optional"/>
  <xsd:attribute name="exact" type="xsd:boolean" use="optional" default="false"/>
</xsd:complexType>

Figure 126 — Schema Component Representation

- - -
-

2.10.  Complex Type: SpecialConversionFromType

- -

2.10.1.  Used By SpecialConversionFrom

- -

Description Type for the element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation.

- -
<...
 xml:id="" [1]
 conversionURL="xsd:anyURI" [0..1]
 initialUnit="xsd:anyURI" [1]
>
  <ConversionDescription> ... </ConversionDescription> [0..*]
</...>

Figure 127 — XML Instance Representation

- - -
<xsd:complexType name="SpecialConversionFromType">
  <xsd:sequence>
    <xsd:element ref="ConversionDescription" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="conversionURL" type="xsd:anyURI" use="optional"/>
  <xsd:attributeGroup ref="initialUnit"/>
</xsd:complexType>

Figure 128 — Schema Component Representation

- - -
-

2.11.  Complex Type: WSDLConversionFromType

- -

2.11.1.  Used By WSDLConversionFrom

- -

Description Type for the element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation.

- -
<...
 xml:id="" [1]
 wsdlURL="xsd:anyURI" [1]
 initialUnit="xsd:anyURI" [1]
>
  <WSDLDescription> ... </WSDLDescription> [0..*]
</...>

Figure 129 — XML Instance Representation

- - -
<xsd:complexType name="WSDLConversionFromType">
  <xsd:sequence>
    <xsd:element ref="WSDLDescription" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attributeGroup ref="initialUnit"/>
  <xsd:attribute name="wsdlURL" type="xsd:anyURI" use="required"/>
</xsd:complexType>

Figure 130 — Schema Component Representation

- - -
-

2.12.  Complex Type: CountedItemSetType

- -

2.12.1.  Used By CountedItemSet

- -

Description Type for a set of counted items.

- -
<...>
  <CountedItem> ... </CountedItem> [1..*]
</...>

Figure 131 — XML Instance Representation

- - -
<xsd:complexType name="CountedItemSetType">
  <xsd:sequence>
    <xsd:element ref="CountedItem" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 132 — Schema Component Representation

- - -
-

2.13.  Complex Type: CountedItemType

- -

2.13.1.  Used By CountedItem

- -

Description Type for a single counted item.

- -
<...
 xml:id="" [1]
>
  <ItemName> ... </ItemName> [1..*]
  <ItemSymbol> ... </ItemSymbol> [0..*]
  <ItemVersionHistory> ... </ItemVersionHistory> [0..*]
  <ItemDefinition> ... </ItemDefinition> [0..*]
  <ItemHistory> ... </ItemHistory> [0..*]
  <ItemRemark> ... </ItemRemark> [0..*]
</...>

Figure 133 — XML Instance Representation

- - -
<xsd:complexType name="CountedItemType">
  <xsd:sequence>
    <xsd:element ref="ItemName" maxOccurs="unbounded"/>
    <xsd:element ref="ItemSymbol" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemVersionHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="ItemRemark" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
</xsd:complexType>

Figure 134 — Schema Component Representation

- - -
-

2.14.  Complex Type: QuantitySetType

- -

2.14.1.  Used By QuantitySet

- -

Description Type for quantity container.

- -
<...>
  <Quantity> ... </Quantity> [1..*]
</...>

Figure 135 — XML Instance Representation

- - -
<xsd:complexType name="QuantitySetType">
  <xsd:sequence>
    <xsd:element ref="Quantity" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 136 — Schema Component Representation

- - -
-

2.15.  Complex Type: QuantityType

- -

2.15.1.  Used By Quantity

- -

Description Type for the quantity.

- -
<...
 xml:id="" [1]
 quantityType="xsd:token (value comes from list: {'base'|'derived'})" [0..1]
 dimensionURL="xsd:anyURI" [0..1]
>
  <QuantityName> ... </QuantityName> [1..*]
  <QuantitySymbol> ... </QuantitySymbol> [0..*]
  <UnitReference> ... </UnitReference> [0..*]
  <QuantityVersionHistory> ... </QuantityVersionHistory> [0..*]
  <QuantityDefinition> ... </QuantityDefinition> [0..*]
  <QuantityHistory> ... </QuantityHistory> [0..*]
  <QuantityRemark> ... </QuantityRemark> [0..*]
</...>

Figure 137 — XML Instance Representation

- - -
<xsd:complexType name="QuantityType">
  <xsd:sequence>
    <xsd:element ref="QuantityName" maxOccurs="unbounded"/>
    <xsd:element ref="QuantitySymbol" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="UnitReference" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityVersionHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityDefinition" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityHistory" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element ref="QuantityRemark" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="quantityType" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="base"/>
        <xsd:enumeration value="derived"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attributeGroup ref="dimensionURL"/>
</xsd:complexType>

Figure 138 — Schema Component Representation

- - -
-

2.16.  Complex Type: DimensionSetType

- -

2.16.1.  Used By DimensionSet

- -

Description Type for the dimension container.

- -
<...>
  <Dimension> ... </Dimension> [1..*]
</...>

Figure 139 — XML Instance Representation

- - -
<xsd:complexType name="DimensionSetType">
  <xsd:sequence>
    <xsd:element ref="Dimension" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 140 — Schema Component Representation

- - -
-

2.17.  Complex Type: DimensionType

- -

2.17.1.  Used By Dimension

- -

Description Type for dimension.

- -
<...
 xml:id="" [1]
 dimensionless="xsd:boolean" [0..1]
>
  <Length> ... </Length> [0..1]
  <Mass> ... </Mass> [0..1]
  <Time> ... </Time> [0..1]
  <ElectricCurrent> ... </ElectricCurrent> [0..1]
  <ThermodynamicTemperature> ... </ThermodynamicTemperature> [0..1]
  <AmountOfSubstance> ... </AmountOfSubstance> [0..1]
  <LuminousIntensity> ... </LuminousIntensity> [0..1]
  <PlaneAngle> ... </PlaneAngle> [0..1]
  <Item> ... </Item> [0..*]
</...>

Figure 141 — XML Instance Representation

- - -
<xsd:complexType name="DimensionType">
  <xsd:sequence maxOccurs="unbounded">
    <xsd:element ref="Length" minOccurs="0"/>
    <xsd:element ref="Mass" minOccurs="0"/>
    <xsd:element ref="Time" minOccurs="0"/>
    <xsd:element ref="ElectricCurrent" minOccurs="0"/>
    <xsd:element ref="ThermodynamicTemperature" minOccurs="0"/>
    <xsd:element ref="AmountOfSubstance" minOccurs="0"/>
    <xsd:element ref="LuminousIntensity" minOccurs="0"/>
    <xsd:element ref="PlaneAngle" minOccurs="0"/>
    <xsd:element ref="Item" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="dimensionless" type="xsd:boolean" use="optional" default="0"/>
</xsd:complexType>

Figure 142 — Schema Component Representation

- - -
-

2.18.  Complex Type: LengthType

- -

2.18.1.  Used By Length

- -

Description Type of the quantity length.

- -
<...
 symbol="L" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 143 — XML Instance Representation

- - -
<xsd:complexType name="LengthType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="L" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 144 — Schema Component Representation

- - -
-

2.19.  Complex Type: MassType

- -

2.19.1.  Used By Mass

- -

Description Type of the quantity mass.

- -
<...
 symbol="M" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 145 — XML Instance Representation

- - -
<xsd:complexType name="MassType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="M" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 146 — Schema Component Representation

- - -
-

2.20.  Complex Type: TimeType

- -

2.20.1.  Used By Time

- -

Description Type of the quantity time.

- -
<...
 symbol="T" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 147 — XML Instance Representation

- - -
<xsd:complexType name="TimeType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="T" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 148 — Schema Component Representation

- - -
-

2.21.  Complex Type: ElectricCurrentType

- -

2.21.1.  Used By ElectricCurrent

- -

Description Type of the quantity electric current.

- -
<...
 symbol="I" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 149 — XML Instance Representation

- - -
<xsd:complexType name="ElectricCurrentType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="I" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 150 — Schema Component Representation

- - -
-

2.22.  Complex Type: ThermodynamicTemperatureType

- -

2.22.1.  Used By ThermodynamicTemperature

- -

Description Type of the quantity thermodynamic temperature.

- -
<...
 symbol="Θ" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 151 — XML Instance Representation

- - -
<xsd:complexType name="ThermodynamicTemperatureType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="Θ" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 152 — Schema Component Representation

- - -
-

2.23.  Complex Type: AmountOfSubstanceType

- -

2.23.1.  Used By AmountOfSubstance

- -

Description Type of the quantity amount of substance.

- -
<...
 symbol="N" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 153 — XML Instance Representation

- - -
<xsd:complexType name="AmountOfSubstanceType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="N" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 154 — Schema Component Representation

- - -
-

2.24.  Complex Type: LuminousIntensityType

- -

2.24.1.  Used By LuminousIntensity

- -

Description Type of the quantity luminous intensity.

- -
<...
 symbol="J" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 155 — XML Instance Representation

- - -
<xsd:complexType name="LuminousIntensityType">
  <xsd:attribute name="symbol" type="xsd:token" fixed="J" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 156 — Schema Component Representation

- - -
-

2.25.  Complex Type: PlaneAngleType

- -

2.25.1.  Used By PlaneAngle

- -

Description Type of the quantity plane angle.

- -
<...
 symbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 157 — XML Instance Representation

- - -
<xsd:complexType name="PlaneAngleType">
  <xsd:attribute name="symbol" type="xsd:token" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 158 — Schema Component Representation

- - -
-

2.26.  Complex Type: ItemType

- -

2.26.1.  Used By Item

- -

Description Type of the quantity represented by a counted item, e.g., electron

- -
<...
 itemURL="xsd:anyURI" [1]
 itemSymbol="xsd:token" [0..1]
 powerNumerator="xsd:byte" [0..1]
 powerDenominator="xsd:byte" [0..1]
/>

Figure 159 — XML Instance Representation

- - -
<xsd:complexType name="ItemType">
  <xsd:attribute name="itemURL" type="xsd:anyURI" use="required"/>
  <xsd:attribute name="itemSymbol" type="xsd:token" use="optional"/>
  <xsd:attributeGroup ref="powerRational"/>
</xsd:complexType>

Figure 160 — Schema Component Representation

- - -
-

2.27.  Complex Type: PrefixSetType

- -

2.27.1.  Used By PrefixSet

- -

Description Type for container for prefixes.

- -
<...>
  <Prefix> ... </Prefix> [1..*]
</...>

Figure 161 — XML Instance Representation

- - -
<xsd:complexType name="PrefixSetType">
  <xsd:sequence>
    <xsd:element ref="Prefix" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Figure 162 — Schema Component Representation

- - -
-

2.28.  Complex Type: PrefixType

- -

2.28.1.  Used By Prefix

- -

Description Type for element for describing prefixes. Use in container PrefixSet.

- -
<...
 xml:id="" [1]
 prefixBase="xsd:byte (value comes from list: {'10'|'2'})" [0..1]
 prefixPower="xsd:byte" [0..1]
>
  <PrefixName> ... </PrefixName> [1..*]
  <PrefixSymbol> ... </PrefixSymbol> [0..*]
</...>

Figure 163 — XML Instance Representation

- - -
<xsd:complexType name="PrefixType">
  <xsd:sequence>
    <xsd:element ref="PrefixName" maxOccurs="unbounded"/>
    <xsd:element ref="PrefixSymbol" minOccurs="0" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:id" use="required"/>
  <xsd:attribute name="prefixBase" use="optional" default="10">
    <xsd:simpleType>
      <xsd:restriction base="xsd:byte">
        <xsd:enumeration value="10"/>
        <xsd:enumeration value="2"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="prefixPower" type="xsd:byte" use="optional"/>
</xsd:complexType>

Figure 164 — Schema Component Representation

- - -
-

2.29.  Complex Type: NameType

- -

2.29.1.  Used By UnitName, ItemName, QuantityName, PrefixName

- -

Description Type for name. Used for names in units, quantities, and prefixes.

- -
<...
 xml:lang="" [0..1]
>
  xsd:token
</...>

Figure 165 — XML Instance Representation

- - -
<xsd:complexType name="NameType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 166 — Schema Component Representation

- - -
-

2.30.  Complex Type: SystemType

- -

2.30.1.  Used By UnitSystem

- -

Description Type for unit system.

- -
<...
 name="xsd:token" [1]
 type="xsd:string" [0..1]
 xml:lang="" [0..1]
/>

Figure 167 — XML Instance Representation

- - -
<xsd:complexType name="SystemType">
  <xsd:attribute name="name" type="xsd:token" use="required"/>
  <xsd:attribute name="type" type="xsd:string" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
</xsd:complexType>

Figure 168 — Schema Component Representation

- - -
-

2.31.  Complex Type: SymbolType

- -

2.31.1.  Used By UnitSymbol, ItemSymbol, QuantitySymbol, PrefixSymbol

- -

Description Type for symbols. Used in units, quantities, and prefixes.

- -
<...
 xml:lang="" [0..1]
 type="union of: [ xsd:token, [ xsd:token (value comes from list: {'ASCII'|'Unicode'|'LaTeX'|'HTML'|'MathML'|'SVG'}) ] ]" [1]
/>

Figure 169 — XML Instance Representation

- - -
<xsd:complexType name="SymbolType">
  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
    <xsd:any processContents="skip" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute ref="xml:lang" use="optional"/>
  <xsd:attribute name="type" use="required">
    <xsd:simpleType>
      <xsd:union memberTypes="xsd:token">
        <xsd:simpleType>
          <xsd:restriction base="xsd:token">
            <xsd:enumeration value="ASCII"/>
            <xsd:enumeration value="Unicode"/>
            <xsd:enumeration value="LaTeX"/>
            <xsd:enumeration value="HTML"/>
            <xsd:enumeration value="MathML"/>
            <xsd:enumeration value="SVG"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:union>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:complexType>

Figure 170 — Schema Component Representation

- - -
-

2.32.  Complex Type: NoteType

- -

2.32.1.  Used By UnitVersionHistory, ConversionNote, WSDLDescription, ConversionDescription, ItemVersionHistory, QuantityVersionHistory

- -

Description Type for notes. Used in units and conversion factors.

- -
<...
 xml:lang="" [0..1]
>
  xsd:string
</...>

Figure 171 — XML Instance Representation

- - -
<xsd:complexType name="NoteType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 172 — Schema Component Representation

- - -
-

2.33.  Complex Type: DefinitionType

- -

2.33.1.  Used By UnitDefinition, ItemDefinition, QuantityDefinition

- -

Description Type for definition.

- -
<...
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</...>

Figure 173 — XML Instance Representation

- - -
<xsd:complexType name="DefinitionType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 174 — Schema Component Representation

- - -
-

2.34.  Complex Type: HistoryType

- -

2.34.1.  Used By UnitHistory, ItemHistory, QuantityHistory

- -

Description Type for history.

- -
<...
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</...>

Figure 175 — XML Instance Representation

- - -
<xsd:complexType name="HistoryType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 176 — Schema Component Representation

- - -
-

2.35.  Complex Type: RemarkType

- -

2.35.1.  Used By UnitRemark, ItemRemark, QuantityRemark

- -

Description Type for remark.

- -
<...
 xml:lang="" [0..1]
 sourceURL="xsd:anyURI" [0..1]
 sourceName="xsd:string" [0..1]
>
  xsd:string
</...>

Figure 177 — XML Instance Representation

- - -
<xsd:complexType name="RemarkType">
  <xsd:simpleContent>
  </xsd:simpleContent>
</xsd:complexType>

Figure 178 — Schema Component Representation

- - -
-

2.36.  Complex Type: ReferenceType

- -

2.36.1.  Used By QuantityReference, UnitReference

- -

Description Type for reference to a unit or quantity.

- -
<...
 url="xsd:anyURI" [1]
 name="xsd:token" [0..1]
 xml:lang="" [0..1]
/>

Figure 179 — XML Instance Representation

- - -
<xsd:complexType name="ReferenceType">
  <xsd:attribute name="url" type="xsd:anyURI" use="required"/>
  <xsd:attribute name="name" type="xsd:token" use="optional"/>
  <xsd:attribute ref="xml:lang" use="optional"/>
</xsd:complexType>

Figure 180 — Schema Component Representation

- - -
-

3.  Attribute Groups

3.1.  Attribute Group: initialUnit

- - - -

3.1.2.  Description URI indicating the unitID of the starting unit for the conversion. For units which are defined in the same document, the URI should consist of a pound sign (#) followed by the ID value.

- -
initialUnit="xsd:anyURI" [1]

Figure 181 — XML Instance Representation

- - -
<xsd:attributeGroup name="initialUnit">
  <xsd:attribute name="initialUnit" type="xsd:anyURI" use="required"/>
</xsd:attributeGroup>

Figure 182 — Schema Component Representation

- - -
-

3.2.  Attribute Group: sourceName

- - - -

3.2.2.  Description Name of relevant publication.

- -
sourceName="xsd:string" [0..1]

Figure 183 — XML Instance Representation

- - -
<xsd:attributeGroup name="sourceName">
  <xsd:attribute name="sourceName" type="xsd:string" use="optional"/>
</xsd:attributeGroup>

Figure 184 — Schema Component Representation

- - -
-

3.3.  Attribute Group: sourceURL

- - - -

3.3.2.  Description Relevant URL for available information.

- -
sourceURL="xsd:anyURI" [0..1]

Figure 185 — XML Instance Representation

- - -
<xsd:attributeGroup name="sourceURL">
  <xsd:attribute name="sourceURL" type="xsd:anyURI" use="optional"/>
</xsd:attributeGroup>

Figure 186 — Schema Component Representation

- - -
-

3.4.  Attribute Group: powerRational

- - - -

3.4.2.  Description An exponent of the unit, specified as powerNumerator and powerDenominator.

- -
powerNumerator="xsd:byte" [0..1]
powerDenominator="xsd:byte" [0..1]

Figure 187 — XML Instance Representation

- - -
<xsd:attributeGroup name="powerRational">
  <xsd:attribute name="powerNumerator" type="xsd:byte" use="optional" default="1"/>
  <xsd:attribute name="powerDenominator" type="xsd:byte" use="optional" default="1"/>
</xsd:attributeGroup>

Figure 188 — Schema Component Representation

- - -
-

3.5.  Attribute Group: prefix

- - - -

3.5.2.  Description Prefix identifier; e.g., m, k, M, G. [Enumeration order is by prefix magnitude (Y to y) followed by binary prefixes.]

- -
prefix="xsd:token (value comes from list: {'Y'|'Z'|'E'|'P'|'T'|'G'|'M'|'k'|'h'|'da'|'d'|'c'|'m'|'u'|'n'|'p'|'f'|'a'|'z'|'y'|'Ki'|'Mi'|'Gi'|'Ti'|'Pi'|'Ei'|'Zi'|'Yi'})" [0..1]

Figure 189 — XML Instance Representation

- - -
<xsd:attributeGroup name="prefix">
  <xsd:attribute name="prefix" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="Y"/>
        <xsd:enumeration value="Z"/>
        <xsd:enumeration value="E"/>
        <xsd:enumeration value="P"/>
        <xsd:enumeration value="T"/>
        <xsd:enumeration value="G"/>
        <xsd:enumeration value="M"/>
        <xsd:enumeration value="k"/>
        <xsd:enumeration value="h"/>
        <xsd:enumeration value="da"/>
        <xsd:enumeration value="d"/>
        <xsd:enumeration value="c"/>
        <xsd:enumeration value="m"/>
        <xsd:enumeration value="u"/>
        <xsd:enumeration value="n"/>
        <xsd:enumeration value="p"/>
        <xsd:enumeration value="f"/>
        <xsd:enumeration value="a"/>
        <xsd:enumeration value="z"/>
        <xsd:enumeration value="y"/>
        <xsd:enumeration value="Ki"/>
        <xsd:enumeration value="Mi"/>
        <xsd:enumeration value="Gi"/>
        <xsd:enumeration value="Ti"/>
        <xsd:enumeration value="Pi"/>
        <xsd:enumeration value="Ei"/>
        <xsd:enumeration value="Zi"/>
        <xsd:enumeration value="Yi"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:attributeGroup>

Figure 190 — Schema Component Representation

- - -
-

3.6.  Attribute Group: dimensionURL

- - - -

3.6.2.  Description URL to a representation of the unit or quantity in terms of the 7 SI base dimensions.

- -
dimensionURL="xsd:anyURI" [0..1]

Figure 191 — XML Instance Representation

- - -
<xsd:attributeGroup name="dimensionURL">
  <xsd:attribute name="dimensionURL" type="xsd:anyURI" use="optional"/>
</xsd:attributeGroup>

Figure 192 — Schema Component Representation

- - -
-
- - - - - - - - - - - - - - - - - - - - - From 470dad3d9d7a7a1584c57b79c9b5899e276ac5f1 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Fri, 29 Aug 2025 21:36:07 +0500 Subject: [PATCH 03/15] removed handcrafted xml --- .../unitsml-schemas/unitsml-v1.0-csd04.xsd | 1334 +++++++++++++++++ sources/unitsml_xsd_docs/document.adoc | 27 +- .../sources/_attribute_groups.adoc | 19 +- .../sources/_complex_type.adoc | 36 +- 4 files changed, 1360 insertions(+), 56 deletions(-) create mode 100644 sources/unitsml-schemas/unitsml-v1.0-csd04.xsd diff --git a/sources/unitsml-schemas/unitsml-v1.0-csd04.xsd b/sources/unitsml-schemas/unitsml-v1.0-csd04.xsd new file mode 100644 index 0000000..6942d53 --- /dev/null +++ b/sources/unitsml-schemas/unitsml-v1.0-csd04.xsd @@ -0,0 +1,1334 @@ + + + + + + + + Container for UnitsML units, quantities, and prefixes. + + + + + ComplexType for the root element of an UnitsML document. + + + + + + + + + + + + + + Container for units. Use in UnitsML container or directly incorporate into a host schema. + + + + + Element for describing units. Use in containers UnitSet or directly incorporate into a host schema. + + + + + Container for describing the system of units. + + + + + Element containing the unit name. + + + + + Element containing various unit symbols. Examples include Aring (ASCII), Å (HTML). + + + + + Element for descriptive information, including version changes to the unit. + + + + + Element for listing the unit code value from a specific code list. + + + + + Container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered root units. + + + + + Element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2 + + + + + Element for those special cases where the root unit needed is not included in the enumerated list in the above element. + + + + + Container for providing conversion information to other units. + + + + + Element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a)) + + + + + Element for descriptive information. + + + + + Element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation. + + + + + Element for providing conversion based on SOAP/WSDL calls to a remote server. + + + + + Element to describe the WSDL service. + + + + + Element for a description of the SpecialConversionFrom. + + + + + Element for all quantities that can be expressed using this unit. + + + + + Element to describe the definition of the unit. + + + + + Element to describe the historical development of the unit. + + + + + Element as a placeholder for additional information. + + + + + + Container for items that are counted and are (in practice) combined with scientific units of measure. + + + + + Container for a single counted item. + + + + + Element containing the item name(s). + + + + + Element containing symbols for the item. + + + + + Element for descriptive information, including version changes to the item. + + + + + Element to describe the definition of the item. + + + + + Element to describe the historical development of the item. + + + + + Element as a placeholder for additional information. + + + + + + Container for quantities. + + + + + Element for describing quantities and referencing corresponding units. Use in container or directly incorporate into a host schema. + + + + + Element containing the quantity name. + + + + + Element containing various quantity symbols. + + + + + Element for referencing a unit of measure from within the Quantity element. + + + + + Element for descriptive information, including version changes to the unit. + + + + + Element to describe the definition of the quantity. + + + + + Element to describe the historical development of the quantity. + + + + + Element as a placeholder for additional information. + + + + + + Container for dimensions. + + + + + Element to express the dimension of a unit or quantity in terms of the SI base quantities length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity. + + + + + Element containing the dimension of the quantity length. + + + + + Element containing the dimension of the quantity mass. + + + + + Element containing the dimension of the quantity time. + + + + + Element containing the dimension of the quantity electric current. + + + + + Element containing the dimension of the quantity thermodynamic temerature. + + + + + Element containing the dimension of the quantity amount of substance. + + + + + Element containing the dimension of the quantity luminous intensity. + + + + + Element containing the dimension of the quantity plane angle. + + + + + Element containing the dimension of any item. Note: this element is meant to be used to allow counted items to be included in the dimensioning of a derived quantity, e.g., electrons per time; usage of this element does not conform to the SI description of the dimension of a quantity in terms of seven base quantities. + + + + + + Container for prefixes. + + + + + Element containing information about a prefix. + + + + + Element containing the prefix name. + + + + + Element containing prefix symbols. + + + + + + URI indicating the unitID of the starting unit for the conversion. For units which are defined in the same document, the URI should consist of a pound sign (#) followed by the ID value. + + + + URI indicating the unitID of the starting unit for the conversion. For units which are defined in the same document, the URI should consist of a pound sign (#) followed by the ID value. + + + + + + Name of relevant publication. + + + + Name of relevant publication. + + + + + + Relevant URL for available information. + + + + Relevant URL for available information. + + + + + + An exponent of the unit, specified as powerNumerator and powerDenominator. + + + + An integer exponent of the unit. + + + + + An integer value divided into the powerNumerator to create a non integer exponent of a unit. For example 1/2. + + + + + + Prefix identifier; e.g., m, k, M, G. [Enumeration order is by prefix magnitude (Y to y) followed by binary prefixes.] + + + + Prefix identifier; e.g., m, k, M, G. [Enumeration order is by prefix magnitude (Y to y) followed by binary prefixes.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + URL to a representation of the unit or quantity in terms of the 7 SI base dimensions. + + + + URL to a representation of the unit or quantity in terms of the 7 SI base dimensions. + + + + + + + + Type for the unit container. + + + + + Element for describing units. Use in containers UnitSet or directly incorporate into a host schema. + + + + + + + Type for the unit. + + + + + Container for describing the system(s) of units. + + + + + + + + Container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered root units. + + + + + + + Element for descriptive information, including version changes to the unit. + + + + + + + + + + Used to indicate the version of the unit output from the Units Database. Changes in the time-stamp are made if a substantive change has been made to the unit, such as a change in the unit definition or changes in conversion factors. + + + + + Reference to a representation of the unit or quantity in terms of the 7 SI base dimensions. + + + + + + Type for the element for listing the unit code value from a specific code list. + + + + The code associated for this unit in a specific code list. + + + + + The name of the code list. + + + + + The version of the code list containing the unit code. + + + + + Suggested retrieval location for this version of the code list. + + + + + Organization responsible for publication and/or maintenance of the code list. + + + + + URI for organization responsible for the code list. + + + + + Primary language of the element and/or its attributes. [See RFC 4646, RFC 4647 and ISO 639.] + + + + + + Type for the container for defining derived units in terms of their root units. This allows a precise definition of a wide range of units. The goal is to improve interoperability among applications and databases which use derived units based on commonly encountered base units. + + + + + Element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2 + + + + + Element for those special cases where the root unit needed is not included in the enumerated list in the above element. + + + + + + + Type for the element for a root unit (from an extensive enumerated list) allowing an optional prefix and power. E.g., mm^2 + + + + Unit identifier; the enumerated list is basically English unit names in lowercase, with a few upper case exceptions, e.g., 32F, mmHg, pH. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Prefix identifier; e.g., m, k, M, G. [Enumeration order is by prefix magnitude (Y to y) followed by binary prefixes.] + + + + + + + Type for the element for those special cases where the root unit needed is not included in the enumerated list in the above element. + + + + URI to identify the unit. + + + + + URI identifying the source and possibly the definition of the unit. + + + + + Optional unit annotation; e.g., a unit name if the unit identifier above is an uncommon code. + + + + + + + + + Type for the container for providing conversion information to other units. + + + + + Element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a)). Note: The related "conversion to" equation is a simple inversion of the above equation; i.e., x = ((c / b) (y - d)) - a. + + + + + Element for describing a conversion that cannot be described by the linear expression in the element Float64ConversionFrom. + + + + + Element for providing conversion based on SOAP/WSDL calls to a remote server. + + + + + + + Type for the element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a)) + + + + + + + + + Number to be added at the start of the conversion (prior to multiplication or division) [factor 'a' in equation]. + + + + + Indicates the position of the least +significant digit (in decimal) of +the initialAddend; the position of +this digit is given by ten to +additive inverse of this number. + + + + + Number by which to multiply sum of initial addend and initial value [factor 'b' in equation]. + + + + + Number of significant digits in the multiplicand value. + + + + + Divisor to be applied to the value at the same time as the multiplicand [factor 'c' in equation]. + + + + + Number of significant digits in the divisor value. + + + + + Number to be added at the end of the conversion [factor 'd' in equation]. + + + + + Indicates the position of the least +significant digit (in decimal) of +the finalAddend; the position of +this digit is given by ten to +additive inverse of this number. + + + + + Indicates if the conversion is exact. + + + + + + Type for the element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation. + + + + + Description of the conversion. + + + + + + + URL for external description of the conversion or for an online convertor. + + + + + + + Type for the element for providing unit conversion information for conversions that are more complex than the Float64ConversionFrom linear equation. + + + + + Description of the service. + + + + + + + + URL for external WSDL definition file. + + + + + + + Type for a set of counted items. + + + + + + + + Type for a single counted item. + + + + + + + + + + + + + + + Type for quantity container. + + + + + + + + Type for the quantity. + + + + + + Element containing various quantity symbols. + + + + + Element for specifying particular units associated with the quantity. + + + + + Element for descriptive information, including version changes to the quantity. + + + + + + + + + + Type of the quantity. For example base or derived. + + + + + + + + + + + + + + + Type for the dimension container. + + + + + Element to express a unit or quantity in terms of the SI base quantities length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity. + + + + + + + Type for dimension. + + + + This unbounded sequence allows any order of any number of elements; e.g., L^1 · L^-1. + + + + + + + + + + + + Element containing the dimension of any item. Note: this element is meant to be used to allow counted items to be included in the dimensioning of a derived quantity, e.g., electrons per time; usage of this element does not conform to the SI description of the dimension of a quantity in terms of seven base quantities. + + + + + + + Boolean to designate that a quantity or unit is dimensionless. + + + + + + Type of the quantity length. + + + + Symbol of the quantity length. + + + + + + + Type of the quantity mass. + + + + Symbol of the quantity mass. + + + + + + + Type of the quantity time. + + + + Symbol of the quantity time. + + + + + + + Type of the quantity electric current. + + + + Symbol of the quantity electric current. + + + + + + + Type of the quantity thermodynamic temperature. + + + + Symbol of the quantity thermodynamic temperature. + + + + + + + Type of the quantity amount of substance. + + + + Symbol of the quantity amount of substance. + + + + + + + Type of the quantity luminous intensity. + + + + Symbol of the quantity luminous intensity. + + + + + + + Type of the quantity plane angle. + + + + Symbol of the quantity plane angle. + + + + + + + Type of the quantity represented by a counted item, e.g., electron + + + + Unique URL for identifying or describing the item. + + + + + Symbol for the item. + + + + + + + + Type for container for prefixes. + + + + + + + + Type for element for describing prefixes. Use in container PrefixSet. + + + + + + + + + The base of the prefix system, i.e., 10 (SI) or 2 (binary). + + + + + + + + + + + The exponential power of the prefix with relation to the base. + + + + + + + Type for name. Used for names in units, quantities, and prefixes. + + + + + + + + + + Type for unit system. + + + + Name of the unit system. For example, SI, inch-pound, CGS, and MKS. + + + + + Description of the unit relative to the unit system. Examples are SI_base and non-SI_not_acceptable. + + + + + + + Type for symbols. Used in units, quantities, and prefixes. + + + + + + + + Type of symbol representation. Examples include ASCII, unicode, HTML, and MathML. + + + + + + + + + + + + + + + + + + + + Type for notes. Used in units and conversion factors. + + + + + + + + + + Type for definition. + + + + + + + + + + + + Type for history. + + + + + + + + + + + + Type for remark. + + + + + + + + Primary language of the element and/or its attributes. [See RFC 4646, RFC 4647 and ISO 639.] + + + + + + + + Type for reference to a unit or quantity. + + + + URL to the reference item. + + + + + Name of the referenced item. + + + + + Primary language of the element and/or its attributes. [See RFC 4646, RFC 4647 and ISO 639.] + + + + diff --git a/sources/unitsml_xsd_docs/document.adoc b/sources/unitsml_xsd_docs/document.adoc index 145d9af..64db76a 100644 --- a/sources/unitsml_xsd_docs/document.adoc +++ b/sources/unitsml_xsd_docs/document.adoc @@ -1,7 +1,28 @@ -[#top] -= XSD Templates += CalConnect Standard: UnitsML Schema specification +:title: UnitsML Schema specification +:docnumber: 36811 +:copyright-year: 2025 +:doctype: standard +:edition: 1 +:status: committee-draft +:revdate: 2025-08-22 +:published-date: 2025-08-22 +:technical-committee: UnitsML +:fullname: Ronald Tse +:surname: Tse +:givenname: Ronald +:affiliation: Ribose Inc. +:fullname_2: Suleman Uzair +:surname_2: Uzair +:givenname_2: Suleman +:affiliation_2: Ribose Inc. +:imagesdir: images +:mn-document-class: cc +:mn-output-extensions: xml,html,pdf,rxl +:local-cache-only: +:data-uri-image: -[lutaml_xsd, ../../unitsdb/unitsml-v1.0-csd04.xsd, schema] +[lutaml_xsd, ../unitsml-schemas/unitsml-v1.0-csd04.xsd, schema, skip_rendering_of=annotation] ---- == Elements diff --git a/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc b/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc index 584cd64..2bd1dc5 100644 --- a/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc +++ b/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc @@ -19,24 +19,7 @@ .Schema Component Representation [source, xml] ----- - -{%- assign element_order = attribute_group | resolved_element_order: %} -{%- for element in element_order %} -{%- assign attribute_drop = element | class_name_end_with: "::AttributeDrop" -%} -{%- assign attribute_group_drop = element | class_name_end_with: "::AttributeGroupDrop" -%} -{%- assign simple_type = element.simple_type %} -{%- if attribute_drop %} - - {%- if simple_type %} - {%- render "sources/simple_type", simple_type: simple_type, element: element, indent: " " %} - - {%- endif %} -{%- endif %} -{%- if attribute_group_drop %} - -{%- endif %} -{%- endfor %} - +{{ attribute_group | to_xml_representation: skip_rendering_of }} ----- --- diff --git a/sources/unitsml_xsd_docs/sources/_complex_type.adoc b/sources/unitsml_xsd_docs/sources/_complex_type.adoc index 3a99534..25f6f4f 100644 --- a/sources/unitsml_xsd_docs/sources/_complex_type.adoc +++ b/sources/unitsml_xsd_docs/sources/_complex_type.adoc @@ -33,41 +33,7 @@ Description pass:[{{ complex_type.annotation.documentation.first.content }}] .Schema Component Representation [source, xml] ----- - -{%- for object in complex_type_element_order %} -{%- assign sequence_drop = object | class_name_end_with: "::SequenceDrop" -%} -{%- assign attribute_drop = object | class_name_end_with: "::AttributeDrop" -%} -{%- assign simple_content_drop = object | class_name_end_with: "::SimpleContentDrop" -%} -{%- assign attribute_group_drop = object | class_name_end_with: "::AttributeGroupDrop" -%} -{%- if sequence_drop %} - - {%- for element in object.element %} - - {%- endfor %} - {%- for any in object.any %} - - {%- endfor %} - -{%- endif %} -{%- if attribute_drop %} - - {%- if object.simple_type %} - {%- render "sources/simple_type", simple_type: object.simple_type, indent: " " %} - - {%- endif %} -{%- endif %} -{%- if attribute_group_drop %} - -{%- endif %} -{%- if simple_content_drop %}{% assign simple_content_children = object | simple_content_children: %} - - {%- for child in simple_content_children %} - {{ child }} - {%- endfor %} - -{%- endif %} -{%- endfor %} - +{{ complex_type | to_xml_representation: skip_rendering_of }} ----- --- From 7afdfc422d081e8b8c43767131ad4162fb5bcf62 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Mon, 1 Sep 2025 16:19:00 +0500 Subject: [PATCH 04/15] used Lutaml::Xsd#to_xml method over handcrafted XML --- sources/unitsml_xsd_docs/sources/_elements.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/unitsml_xsd_docs/sources/_elements.adoc b/sources/unitsml_xsd_docs/sources/_elements.adoc index ed09d29..97df83b 100644 --- a/sources/unitsml_xsd_docs/sources/_elements.adoc +++ b/sources/unitsml_xsd_docs/sources/_elements.adoc @@ -33,7 +33,7 @@ .Schema Component Representation [source, xml] ----- - +{{ element | to_xml_representation: skip_rendering_of }} ----- --- From 5a379831e19248d2f4f32b4b28fb90df7f3f45a1 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Mon, 22 Sep 2025 17:58:00 +0800 Subject: [PATCH 05/15] feat: update xsd document --- sources/unitsml-xml-schema/document.adoc | 45 ++++++ .../schemas}/unitsml-v1.0-csd04.xsd | 44 +++++- .../sections/00-foreword.adoc | 35 +++++ .../unitsml-xml-schema/sections/00-intro.adoc | 9 ++ .../unitsml-xml-schema/sections/01-scope.adoc | 4 + .../sections/02-normrefs.adoc | 6 + .../unitsml-xml-schema/sections/03-terms.adoc | 48 +++++++ .../sections/04-conventions.adoc | 90 ++++++++++++ .../sections/05-schema.adoc | 26 ++++ .../sections/06-elements.adoc | 9 ++ .../sections/07-complex-types.adoc | 9 ++ .../sections/08-attribute-groups.adoc | 9 ++ .../sections/99-bibliography.adoc | 2 + .../templates/_attribute_group.adoc.liquid | 66 +++++++++ .../templates/_complex_type.adoc.liquid | 133 +++++++++++++++++ .../templates/_element.adoc.liquid | 136 ++++++++++++++++++ .../templates}/_simple_type.liquid | 0 sources/unitsml_xsd_docs/document.adoc | 38 ----- .../sources/_attribute_groups.adoc | 27 ---- .../sources/_complex_type.adoc | 41 ------ .../unitsml_xsd_docs/sources/_elements.adoc | 40 ------ 21 files changed, 666 insertions(+), 151 deletions(-) create mode 100644 sources/unitsml-xml-schema/document.adoc rename sources/{unitsml-schemas => unitsml-xml-schema/schemas}/unitsml-v1.0-csd04.xsd (96%) create mode 100644 sources/unitsml-xml-schema/sections/00-foreword.adoc create mode 100644 sources/unitsml-xml-schema/sections/00-intro.adoc create mode 100644 sources/unitsml-xml-schema/sections/01-scope.adoc create mode 100644 sources/unitsml-xml-schema/sections/02-normrefs.adoc create mode 100644 sources/unitsml-xml-schema/sections/03-terms.adoc create mode 100644 sources/unitsml-xml-schema/sections/04-conventions.adoc create mode 100644 sources/unitsml-xml-schema/sections/05-schema.adoc create mode 100644 sources/unitsml-xml-schema/sections/06-elements.adoc create mode 100644 sources/unitsml-xml-schema/sections/07-complex-types.adoc create mode 100644 sources/unitsml-xml-schema/sections/08-attribute-groups.adoc create mode 100644 sources/unitsml-xml-schema/sections/99-bibliography.adoc create mode 100644 sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid create mode 100644 sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid create mode 100644 sources/unitsml-xml-schema/templates/_element.adoc.liquid rename sources/{unitsml_xsd_docs/sources => unitsml-xml-schema/templates}/_simple_type.liquid (100%) delete mode 100644 sources/unitsml_xsd_docs/document.adoc delete mode 100644 sources/unitsml_xsd_docs/sources/_attribute_groups.adoc delete mode 100644 sources/unitsml_xsd_docs/sources/_complex_type.adoc delete mode 100644 sources/unitsml_xsd_docs/sources/_elements.adoc diff --git a/sources/unitsml-xml-schema/document.adoc b/sources/unitsml-xml-schema/document.adoc new file mode 100644 index 0000000..133f1ca --- /dev/null +++ b/sources/unitsml-xml-schema/document.adoc @@ -0,0 +1,45 @@ += CalConnect Standard: UnitsML XML schema specification +:title: UnitsML XML schema specification +:docnumber: 36811 +:copyright-year: 2025 +:doctype: standard +:edition: 1 +:status: committee-draft +:revdate: 2025-08-22 +:published-date: 2025-08-22 +:technical-committee: TC UNITS +:fullname: Ronald Tse +:surname: Tse +:givenname: Ronald +:affiliation: Ribose Inc. +:fullname_2: Suleman Uzair +:surname_2: Uzair +:givenname_2: Suleman +:affiliation_2: Ribose Inc. +:imagesdir: images +:mn-document-class: cc +:mn-output-extensions: xml,html,pdf,rxl +:local-cache-only: +:data-uri-image: + +include::sections/00-foreword.adoc[] + +include::sections/00-intro.adoc[] + +include::sections/01-scope.adoc[] + +include::sections/02-normrefs.adoc[] + +include::sections/03-terms.adoc[] + +include::sections/04-conventions.adoc[] + +include::sections/05-schema.adoc[] + +include::sections/06-elements.adoc[] + +include::sections/07-complex-types.adoc[] + +include::sections/08-attribute-groups.adoc[] + +include::sections/99-bibliography.adoc[] diff --git a/sources/unitsml-schemas/unitsml-v1.0-csd04.xsd b/sources/unitsml-xml-schema/schemas/unitsml-v1.0-csd04.xsd similarity index 96% rename from sources/unitsml-schemas/unitsml-v1.0-csd04.xsd rename to sources/unitsml-xml-schema/schemas/unitsml-v1.0-csd04.xsd index 6942d53..23e821f 100644 --- a/sources/unitsml-schemas/unitsml-v1.0-csd04.xsd +++ b/sources/unitsml-xml-schema/schemas/unitsml-v1.0-csd04.xsd @@ -1,9 +1,37 @@ - + @@ -115,7 +149,7 @@ PURPOSE. - Element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a)) + Element for providing factors for a conversion equation from another unit; stem:[y = d + ((b / c) (x + a))] @@ -837,7 +871,7 @@ PURPOSE. - Element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a)). Note: The related "conversion to" equation is a simple inversion of the above equation; i.e., x = ((c / b) (y - d)) - a. + Element for providing factors for a conversion equation from another unit; stem:[y = d + ((b / c) (x + a))]. Note: The related "conversion to" equation is a simple inversion of the above equation; i.e., stem:[x = ((c / b) (y - d)) - a]. @@ -854,7 +888,7 @@ PURPOSE. - Type for the element for providing factors for a conversion equation from another unit; y = d + ((b / c) (x + a)) + Type for the element for providing factors for a conversion equation from another unit; stem:[y = d + ((b / c) (x + a))] diff --git a/sources/unitsml-xml-schema/sections/00-foreword.adoc b/sources/unitsml-xml-schema/sections/00-foreword.adoc new file mode 100644 index 0000000..b0c4217 --- /dev/null +++ b/sources/unitsml-xml-schema/sections/00-foreword.adoc @@ -0,0 +1,35 @@ + +.Foreword +The Calendaring and Scheduling Consortium ("`CalConnect`") is a global +non-profit organization with the aim to facilitate interoperability of +collaborative technologies and tools through open standards. + +CalConnect works closely with international and regional partners, +of which the full list is available on our website +(https://www.calconnect.org/about/liaisons-and-relationships). + +The procedures used to develop this document and those intended for its +further maintenance are described in the CalConnect Directives. + +In particular the different approval criteria needed for the different +types of CalConnect documents should be noted. This document was drafted in +accordance with the editorial rules of the CalConnect Directives. + +Attention is drawn to the possibility that some of the elements of this +document may be the subject of patent rights. CalConnect shall not be +held responsible for identifying any or all such patent rights. Details +of any patent rights identified during the development of the document +will be provided in the Introduction. + +//// +// TODO: re-enable when we finish the IPR policy +and/or on the CalConnect list of patent +declarations received (see www.calconnect.com/patents). +//// + +Any trade name used in this document is information given for the +convenience of users and does not constitute an endorsement. + +This document was prepared by Technical Committee +_{technical-committee}_. + diff --git a/sources/unitsml-xml-schema/sections/00-intro.adoc b/sources/unitsml-xml-schema/sections/00-intro.adoc new file mode 100644 index 0000000..c4b051a --- /dev/null +++ b/sources/unitsml-xml-schema/sections/00-intro.adoc @@ -0,0 +1,9 @@ +== Introduction + +The UnitsML XML Schema defines the structure and content of the +representation of UnitsML objects in XML. + +It is defined as an XML Schema definition (XSD) for use in XML +applications. The schema is intended to be used in conjunction with the +UnitsML specification, which defines the semantics of the UnitsML +vocabulary. diff --git a/sources/unitsml-xml-schema/sections/01-scope.adoc b/sources/unitsml-xml-schema/sections/01-scope.adoc new file mode 100644 index 0000000..9850c5e --- /dev/null +++ b/sources/unitsml-xml-schema/sections/01-scope.adoc @@ -0,0 +1,4 @@ +== Scope + +This document describes the UnitsML XML Schema (UnitsML XSD), which is an +XML Schema definition for the representation of UnitsML objects in XML. diff --git a/sources/unitsml-xml-schema/sections/02-normrefs.adoc b/sources/unitsml-xml-schema/sections/02-normrefs.adoc new file mode 100644 index 0000000..f53842b --- /dev/null +++ b/sources/unitsml-xml-schema/sections/02-normrefs.adoc @@ -0,0 +1,6 @@ +[bibliography] +== Normative references + +* [[[w3c_xmlschema,W3C xmlschema-1]]] +* [[[w3c_xmlschema-1,W3C xmlschema11-1]]] +* [[[w3c_xmlschema-2,W3C xmlschema11-2]]] diff --git a/sources/unitsml-xml-schema/sections/03-terms.adoc b/sources/unitsml-xml-schema/sections/03-terms.adoc new file mode 100644 index 0000000..05c991f --- /dev/null +++ b/sources/unitsml-xml-schema/sections/03-terms.adoc @@ -0,0 +1,48 @@ +== Terms and definitions + +=== unit + +standard quantity used to express a physical quantity + +=== basic unit + +unit not derived from other units + +=== composite unit + +unit derived from two or more basic units conjoined by multiplication or division + +=== prefix + +modifier to a unit with a fixed factor + +=== quantity + +type of measurement that is represented by a unit + +[example] +distance, moment of force, temperature, energy. + +=== dimension + +basic physical quantity that can be expressed in terms of fundamental +quantities + +[example] +length, mass, time, plane angle. + +=== unit name + +name of a unit + +=== unit symbol + +abbreviated representation of a unit + +=== unit reference + +reference identifier to a unit in a database + +=== unit dimensions + +fundamental quantities to which the unit applies diff --git a/sources/unitsml-xml-schema/sections/04-conventions.adoc b/sources/unitsml-xml-schema/sections/04-conventions.adoc new file mode 100644 index 0000000..5cfa8b5 --- /dev/null +++ b/sources/unitsml-xml-schema/sections/04-conventions.adoc @@ -0,0 +1,90 @@ +== Conventions + +=== General + +Elements and attributes defined in the UnitsML XML schema are described in +following clauses. + +Each element and attribute is described in a separate entry, with entries +arranged in alphabetical order. + +=== Element + +Each element entry contains the following information: + +* The XML Name (tag or generic identifier) of the element or attribute that is +used in UnitsML XML files. ++ +[example] +==== +`` +==== + +* The informational name of the element or attribute. ++ +[example] +==== +Unit +==== + +* A description of the element or attribute. ++ +[example] +==== +For the element ``: "Specifies a unit of measurement." +==== + +* A list of all of the attributes that may be applied to the element, with first +the attribute name and then the attribute's informal expanded name. Attribute +names are prefixed with an at sign (`@`). + +* The content model or type of the element's content. If the element has a type, +the type is given first, with a link to the type definition. If the element +does not have a type, the content model is described in detail, supporting +groups, sequences, choices, one of and any of. ++ +[example] +==== +string, integer, boolean, or a reference to a simple or complex type defined in +the schema. +==== + + +=== Attribute + +Each attribute entry contains the following information: + +* The XML Name of the attribute. ++ +[example] +==== +`@quantityType` +==== + +* The informational name of the attribute. ++ +[example] +==== +Quantity Type +==== + +* A description of the attribute +[example] +==== +Type of the quantity. +==== + +* The data type of the attribute's value. ++ +[example] +==== +string, integer, boolean, or a reference to a simple type defined in the schema. +==== + +* A list of all of the elements or groups of elements in which the attribute may +be used, with first the element name and then the element's informal +expanded name. Element names are not prefixed. + +* For each element or group of elements in which the attribute may be used, a +block of usage information with required or suggested values and other +information. diff --git a/sources/unitsml-xml-schema/sections/05-schema.adoc b/sources/unitsml-xml-schema/sections/05-schema.adoc new file mode 100644 index 0000000..0281ec0 --- /dev/null +++ b/sources/unitsml-xml-schema/sections/05-schema.adoc @@ -0,0 +1,26 @@ +== Schema + +The UnitsML XML schema is defined in the file `unitsml.xsd`, which is +included in the UnitsML distribution. + +The root element of the schema is ``, which contains all other +elements. + +The schema is defined using the W3C XML Schema Definition Language +(<>), and conforms to <> and +<>. + +The UnitsML XML schema may be used in the following ways: + +* To validate UnitsML XML documents, ensuring that they conform to the + structure and content rules defined in the schema. + +* To incorportate UnitsML XML into XML application schemas, allowing for the + integration of UnitsML data with other XML-based data formats. + +* To generate code or data structures in programming languages that + support XML schema, facilitating the processing of UnitsML XML + documents. + +The UnitsML XML schema is maintained by the CalConnect TC UNITS Technical +Committee, and is available from https://www.unitsml.org. diff --git a/sources/unitsml-xml-schema/sections/06-elements.adoc b/sources/unitsml-xml-schema/sections/06-elements.adoc new file mode 100644 index 0000000..113e6fe --- /dev/null +++ b/sources/unitsml-xml-schema/sections/06-elements.adoc @@ -0,0 +1,9 @@ +== Elements + +[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] +---- +{% for item in schema.element %} +include::../templates/_element.adoc.liquid[] + +{% endfor %} +---- diff --git a/sources/unitsml-xml-schema/sections/07-complex-types.adoc b/sources/unitsml-xml-schema/sections/07-complex-types.adoc new file mode 100644 index 0000000..33c8b40 --- /dev/null +++ b/sources/unitsml-xml-schema/sections/07-complex-types.adoc @@ -0,0 +1,9 @@ +== Complex types + +[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] +---- +{% for item in schema.complex_type %} +include::../templates/_complex_type.adoc.liquid[] + +{% endfor %} +---- diff --git a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc new file mode 100644 index 0000000..200fe84 --- /dev/null +++ b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc @@ -0,0 +1,9 @@ +== Attribute groups + +[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] +---- +{% for item in schema.attribute_group %} +include::../templates/_attribute_group.adoc.liquid[] + +{% endfor %} +---- diff --git a/sources/unitsml-xml-schema/sections/99-bibliography.adoc b/sources/unitsml-xml-schema/sections/99-bibliography.adoc new file mode 100644 index 0000000..f494396 --- /dev/null +++ b/sources/unitsml-xml-schema/sections/99-bibliography.adoc @@ -0,0 +1,2 @@ +[bibliography] +== Bibliography diff --git a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid b/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid new file mode 100644 index 0000000..5caf6fc --- /dev/null +++ b/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid @@ -0,0 +1,66 @@ +{%# Documentation #%} +{%liquid + assign item_attributes = schema | attributes: item + assign used_by_items = schema | used_by: item +%} +{% capture docs %} +{% for paragraph in item.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} + +[[xsd_{{item.name}}]] +=== `{{ item.name }}` + +==== Group + +{{ docs }} + +{% if used_by_items.size > 0 %} +{% comment %} + TODO: used_by_* should return the element, not an anchor. + There should be 0 Metanorma things in Lutaml liquid drops. + TODO: Make the following work + + {% for used_by in used_by_items %} + * {{ used_by.name }} (<>) + + {% endfor %} +{% endcomment %} +This attribute group is used by: + +{% for used_by in used_by_items %} +* {{ used_by }} + +{% endfor %} +{% endif %} + +==== Attributes + +{% if item_attributes.size > 0 %} +{% for attribute in item_attributes %} +{% capture attribute_docs %} +{% for paragraph in attribute.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} +`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute | min_max_arg: }}]` +{% if attribute_docs %} ++ +-- +{{ attribute_docs }} +-- +{% endif %} + +{% endfor %} +{% else %} +No attributes defined. +{% endif %} + +.XSD source of `<{{ item.name }}>` +[source,xml] +----- +{{ item | to_xml_representation: skip_rendering_of }} +----- diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid new file mode 100644 index 0000000..9efb81a --- /dev/null +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid @@ -0,0 +1,133 @@ +{%# Documentation #%} +{%liquid + assign item_attributes = schema | attributes: item + assign item_children = schema | child_elements: item + assign used_by_items = schema | used_by: item + assign item_element_order = item | resolved_element_order: + assign elements = schema | child_elements: item +%} +{% capture docs %} +{% for paragraph in item.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} + +[[xsd_{{item.name}}]] +=== `{{ item.name }}` + +==== General + +{{ docs }} + +{% if used_by_items.size > 0 %} +{% comment %} + TODO: used_by_items should return the element, not an anchor. + There should be 0 Metanorma things in Lutaml liquid drops. + TODO: Make the following work + {% for used_by in used_by_items %} + * {{ used_by.name }} (<>) + + {% endfor %} +{% endcomment %} +This complex type is used by: + +{% for used_by in used_by_items %} +* {{ used_by }} + +{% endfor %} +{% endif %} + +==== Attributes + +{% if item_attributes.size > 0 %} +{% for attribute in item_attributes %} +{% capture attribute_docs %} +{% for paragraph in attribute.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} +`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute | min_max_arg: }}]` +{% if attribute_docs %} ++ +-- +{{ attribute_docs }} +-- +{% endif %} + +{% endfor %} +{% else %} +No attributes defined. +{% endif %} + +==== Content model + +{% comment %} +TODO: The "content model" section needs to describe sequence, anyOf, allOf, +choice, etc, in proper hierarchy. +{% endcomment %} + +{% if item_children.size > 0 %} + +{% for child in item_children %} +{% assign item_name = child.ref || child.name %} +{% if item_name %} +{% capture child_docs %} +{% for paragraph in child.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} + +{% comment %} + {# TODO: cardinality_representation is very weird. We don't want a filter like this. We want direct access to the model instead. #} + {{ child.name }}:: `{{ child.type }}` ({{ child.minOccurs }}..{{ child.maxOccurs }}) +{% endcomment %} +{{ item_name }}:: `{{ child.type }}` {{ child | cardinality_representation: }} +{% if child_docs %} ++ +-- +{{ child_docs }} +-- +{% endif %} + +{% else %} +{{ child }} + +{% endif %} +{% endfor %} + +{% else %} +No child elements defined. +{% endif %} + + + +[example] +.Illustrative usage of `<{{ item.name }}>` +==== +[source,xml] +----- +<...{{ item_attributes | xml_representations: schema }} +{%- if elements.size > 0 -%}> +{%- for child in elements -%} +{% assign element_name = child.ref || child.name %} +{%- if element_name %} + <{{ element_name }}> ... {{ child | cardinality_representation: }} +{%- else %} + {{ child }} +{%- endif %} +{%- endfor %} + +{%- else -%} +/> +{% endif %} +----- +==== + +.XSD source of `<{{ item.name }}>` +[source,xml] +----- +{{ item | to_xml_representation: skip_rendering_of }} +----- diff --git a/sources/unitsml-xml-schema/templates/_element.adoc.liquid b/sources/unitsml-xml-schema/templates/_element.adoc.liquid new file mode 100644 index 0000000..407f3a8 --- /dev/null +++ b/sources/unitsml-xml-schema/templates/_element.adoc.liquid @@ -0,0 +1,136 @@ +{%# Documentation #%} +{%liquid + assign item_attributes = schema | attributes: item + assign item_children = schema | child_elements: item + assign used_by_items = schema | used_by: item +%} +{% capture docs %} +{% for paragraph in item.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} + +[[xsd_{{item.name}}]] +=== `<{{ item.name }}>` + +==== General + +{{ docs }} + +{% if used_by_items.size > 0 %} +{% comment %} + TODO: used_by_elements should return the element, not an anchor. + There should be 0 Metanorma things in Lutaml liquid drops. + TODO: Make the following work + {% for used_by in used_by_elements %} + * {{ used_by.name }} (<>) + + {% endfor %} +{% endcomment %} +This element is used by: + +{% for used_by in used_by_items %} +* {{ used_by }} + +{% endfor %} +{% endif %} + +==== Attributes + +{% if item_attributes.size > 0 %} +{% for attribute in item_attributes %} +{% capture attribute_docs %} +{% for paragraph in attribute.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} +`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute | min_max_arg: }}]` +{% if attribute_docs %} ++ +-- +{{ attribute_docs }} +-- +{% endif %} + +{% endfor %} +{% else %} +No attributes defined. +{% endif %} + +==== Content model + +{% comment %} +TODO: Not all elements have type? +{% endcomment %} + +This element is specified the type {{ item.type }} (<>). + +{% comment %} +TODO: The "content model" section needs to describe sequence, anyOf, allOf, +choice, etc, in proper hierarchy. +{% endcomment %} + +{% if item_children.size > 0 %} + +{% for child in item_children %} +{% assign item_name = child.ref || child.name %} +{% if item_name %} +{% capture child_docs %} +{% for paragraph in child.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} + +{% comment %} + {# TODO: cardinality_representation is very weird. We don't want a filter like this. We want direct access to the model instead. #} + {{ child.name }}:: `{{ child.type }}` ({{ child.minOccurs }}..{{ child.maxOccurs }}) +{% endcomment %} +{{ item_name }}:: `{{ child.type }}` {{ child | cardinality_representation: }} +{% if child_docs %} ++ +-- +{{ child_docs }} +-- +{% endif %} + +{% else %} +{{ child }} + +{% endif %} +{% endfor %} + +{% else %} +No child elements defined. +{% endif %} + + +[example] +.Illustrative usage of `<{{ item.name }}>` +==== +[source,xml] +----- +<{{item.name}}{{ item_attributes | xml_representations: schema }} +{%- if item_children.size > 0 -%}> +{%- for child in item_children -%} +{% assign item_name = child.ref || child.name %} +{%- if item_name %} + <{{item_name}}> ... {{ child | cardinality_representation: }} +{%- else %} + {{ child }} +{%- endif %} +{%- endfor %} + +{%- else -%} +/> +{% endif %} +----- +==== + +.XSD source of `<{{ item.name }}>` +[source,xml] +----- +{{ item | to_xml_representation: skip_rendering_of }} +----- diff --git a/sources/unitsml_xsd_docs/sources/_simple_type.liquid b/sources/unitsml-xml-schema/templates/_simple_type.liquid similarity index 100% rename from sources/unitsml_xsd_docs/sources/_simple_type.liquid rename to sources/unitsml-xml-schema/templates/_simple_type.liquid diff --git a/sources/unitsml_xsd_docs/document.adoc b/sources/unitsml_xsd_docs/document.adoc deleted file mode 100644 index 64db76a..0000000 --- a/sources/unitsml_xsd_docs/document.adoc +++ /dev/null @@ -1,38 +0,0 @@ -= CalConnect Standard: UnitsML Schema specification -:title: UnitsML Schema specification -:docnumber: 36811 -:copyright-year: 2025 -:doctype: standard -:edition: 1 -:status: committee-draft -:revdate: 2025-08-22 -:published-date: 2025-08-22 -:technical-committee: UnitsML -:fullname: Ronald Tse -:surname: Tse -:givenname: Ronald -:affiliation: Ribose Inc. -:fullname_2: Suleman Uzair -:surname_2: Uzair -:givenname_2: Suleman -:affiliation_2: Ribose Inc. -:imagesdir: images -:mn-document-class: cc -:mn-output-extensions: xml,html,pdf,rxl -:local-cache-only: -:data-uri-image: - -[lutaml_xsd, ../unitsml-schemas/unitsml-v1.0-csd04.xsd, schema, skip_rendering_of=annotation] ----- -== Elements - -include::sources/_elements.adoc[] - -== Complex Types - -include::sources/_complex_type.adoc[] - -== Attribute Groups - -include::sources/_attribute_groups.adoc[] ----- diff --git a/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc b/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc deleted file mode 100644 index 2bd1dc5..0000000 --- a/sources/unitsml_xsd_docs/sources/_attribute_groups.adoc +++ /dev/null @@ -1,27 +0,0 @@ -{% for attribute_group in schema.attribute_group %} - -[#attribute_group_{{attribute_group.name}}] - -=== Attribute Group: *{{ attribute_group.name }}* - -==== **Used By** {{ schema | used_by: attribute_group | join: ", " }} - -==== Description pass:[{{ attribute_group.annotation.documentation.first.content }}] - -.XML Instance Representation -[source, xml] ------ -{%- for attr in attribute_group.attribute %} -{{ attr.name }}="{{ attr | attr_type: }}" [{{ attr | min_max_arg: }}] -{%- endfor %} ------ - -.Schema Component Representation -[source, xml] ------ -{{ attribute_group | to_xml_representation: skip_rendering_of }} ------ - ---- - -{% endfor %} diff --git a/sources/unitsml_xsd_docs/sources/_complex_type.adoc b/sources/unitsml_xsd_docs/sources/_complex_type.adoc deleted file mode 100644 index 25f6f4f..0000000 --- a/sources/unitsml_xsd_docs/sources/_complex_type.adoc +++ /dev/null @@ -1,41 +0,0 @@ -{% for complex_type in schema.complex_type %} - -[#complex_type_{{complex_type.name}}] - -=== Complex Type: *{{ complex_type.name }}* - -==== Used By {{ schema | used_by: complex_type | join: ", " }} - -Description pass:[{{ complex_type.annotation.documentation.first.content }}] - -{% assign complex_type_element_order = complex_type | resolved_element_order: %} -{% assign complex_type_attributes = schema | attributes: complex_type -%} -{% assign elements = schema | child_elements: complex_type %} -.XML Instance Representation -[source, xml] ------ -<...{{ complex_type_attributes | xml_representations: schema }} -{%- if elements.size > 0 -%}> -{%- for child in elements -%} -{% assign element_name = child.ref || child.name %} -{%- if element_name %} - <{{ element_name }}> ... {{ child | cardinality_representation: }} -{%- else %} - {{ child }} -{%- endif %} -{%- endfor %} - -{%- else -%} -/> -{% endif %} ------ - -.Schema Component Representation -[source, xml] ------ -{{ complex_type | to_xml_representation: skip_rendering_of }} ------ - ---- - -{% endfor %} diff --git a/sources/unitsml_xsd_docs/sources/_elements.adoc b/sources/unitsml_xsd_docs/sources/_elements.adoc deleted file mode 100644 index 97df83b..0000000 --- a/sources/unitsml_xsd_docs/sources/_elements.adoc +++ /dev/null @@ -1,40 +0,0 @@ -{% for element in schema.element %} - -[#element_{{element.name}}] -=== Element: *{{ element.name }}* - -==== Type <> -{% assign used_by_elements = schema | used_by: element %} -{% if used_by_elements.size > 0 %}==== *Used By* {{ used_by_elements | join: ", " }}{% endif %} - -==== Description *pass:[{{ element.annotation.documentation.first.content }}]* -{% assign element_attributes = schema | attributes: element %} -{% assign element_children = schema | child_elements: element %} - -.XML Instance Representation -[source, xml] ------ -<{{element.name}}{{ element_attributes | xml_representations: schema }} -{%- if element_children.size > 0 -%}> -{%- for child in element_children -%} -{% assign element_name = child.ref || child.name %} -{%- if element_name %} - <{{element_name}}> ... {{ child | cardinality_representation: }} -{%- else %} - {{ child }} -{%- endif %} -{%- endfor %} - -{%- else -%} -/> -{% endif %} ------ - -.Schema Component Representation -[source, xml] ------ -{{ element | to_xml_representation: skip_rendering_of }} ------ ---- - -{% endfor %} From 9a3379ea783b14631f2466adae81a7c583f72c01 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Thu, 25 Sep 2025 21:04:32 +0500 Subject: [PATCH 06/15] Changed filter calls to drop method calls --- .../templates/_attribute_group.adoc.liquid | 29 +++++++++++++++---- .../templates/_complex_type.adoc.liquid | 27 +++++++++++------ 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid b/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid index 5caf6fc..b306f4f 100644 --- a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid @@ -1,7 +1,8 @@ {%# Documentation #%} + {%liquid - assign item_attributes = schema | attributes: item - assign used_by_items = schema | used_by: item + assign item_attributes = item.attribute_elements + assign used_by_items = item.used_by %} {% capture docs %} {% for paragraph in item.annotation.documentation %} @@ -31,7 +32,19 @@ This attribute group is used by: {% for used_by in used_by_items %} -* {{ used_by }} +{% capture description %} +{% for paragraph in used_by.annotation.documentation %} +{{ paragraph.content }} + +{% endfor %} +{% endcapture %} +@{{ used_by.name }}:: +{% if description %} ++ +-- +{{ description }} +-- +{% endif %} {% endfor %} {% endif %} @@ -46,7 +59,7 @@ This attribute group is used by: {% endfor %} {% endcapture %} -`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute | min_max_arg: }}]` +`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute.cardinality }}]` {% if attribute_docs %} + -- @@ -60,7 +73,13 @@ No attributes defined. {% endif %} .XSD source of `<{{ item.name }}>` + +{%liquid + assign xml_representation = item.to_formatted_xml + assign item_xml_representation = item | to_xml_representation: +%} + [source,xml] ----- -{{ item | to_xml_representation: skip_rendering_of }} +{{ xml_representation }} ----- diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid index 9efb81a..abb91d1 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid @@ -1,10 +1,10 @@ {%# Documentation #%} {%liquid - assign item_attributes = schema | attributes: item - assign item_children = schema | child_elements: item - assign used_by_items = schema | used_by: item - assign item_element_order = item | resolved_element_order: - assign elements = schema | child_elements: item + assign item_attributes = item.attribute_elements + assign item_children = item.child_elements + assign used_by_items = item.used_by + assign item_element_order = item.resolved_element_order + assign elements = item_children %} {% capture docs %} {% for paragraph in item.annotation.documentation %} @@ -33,7 +33,7 @@ This complex type is used by: {% for used_by in used_by_items %} -* {{ used_by }} +* {{ used_by.name }} (<>) {% endfor %} {% endif %} @@ -48,7 +48,16 @@ This complex type is used by: {% endfor %} {% endcapture %} -`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute | min_max_arg: }}]` + +{% capture attr_name %} +{%- if attribute.ref -%} +{{- attribute.ref -}} +{%- else -%} +{{- attribute.name -}} +{%- endif -%} +{% endcapture %} + +`@{{ attr_name }}`:: {% if attribute.type %}`{{ attribute.type }}`{% endif %} `[{{ attribute.cardinality }}]` {% if attribute_docs %} + -- @@ -84,7 +93,7 @@ choice, etc, in proper hierarchy. {# TODO: cardinality_representation is very weird. We don't want a filter like this. We want direct access to the model instead. #} {{ child.name }}:: `{{ child.type }}` ({{ child.minOccurs }}..{{ child.maxOccurs }}) {% endcomment %} -{{ item_name }}:: `{{ child.type }}` {{ child | cardinality_representation: }} +{{ item_name }}:: {% if child.type %}`{{ child.type }}`{% endif %} [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {% if child_docs %} + -- @@ -129,5 +138,5 @@ No child elements defined. .XSD source of `<{{ item.name }}>` [source,xml] ----- -{{ item | to_xml_representation: skip_rendering_of }} +{{ item.to_formatted_xml }} ----- From 83ccf2f4ad0c211a6e751218090005dbb92f396a Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Mon, 6 Oct 2025 21:29:19 +0500 Subject: [PATCH 07/15] moved from filter use to lutaml-xsd liquid methods --- .../templates/_attribute_group.adoc.liquid | 10 ---- .../templates/_complex_type.adoc.liquid | 32 ++++++------- .../templates/_element.adoc.liquid | 47 ++++++++++--------- 3 files changed, 40 insertions(+), 49 deletions(-) diff --git a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid b/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid index b306f4f..ddbf297 100644 --- a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid @@ -19,16 +19,6 @@ {{ docs }} {% if used_by_items.size > 0 %} -{% comment %} - TODO: used_by_* should return the element, not an anchor. - There should be 0 Metanorma things in Lutaml liquid drops. - TODO: Make the following work - - {% for used_by in used_by_items %} - * {{ used_by.name }} (<>) - - {% endfor %} -{% endcomment %} This attribute group is used by: {% for used_by in used_by_items %} diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid index abb91d1..c944958 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid @@ -21,15 +21,6 @@ {{ docs }} {% if used_by_items.size > 0 %} -{% comment %} - TODO: used_by_items should return the element, not an anchor. - There should be 0 Metanorma things in Lutaml liquid drops. - TODO: Make the following work - {% for used_by in used_by_items %} - * {{ used_by.name }} (<>) - - {% endfor %} -{% endcomment %} This complex type is used by: {% for used_by in used_by_items %} @@ -89,10 +80,6 @@ choice, etc, in proper hierarchy. {% endfor %} {% endcapture %} -{% comment %} - {# TODO: cardinality_representation is very weird. We don't want a filter like this. We want direct access to the model instead. #} - {{ child.name }}:: `{{ child.type }}` ({{ child.minOccurs }}..{{ child.maxOccurs }}) -{% endcomment %} {{ item_name }}:: {% if child.type %}`{{ child.type }}`{% endif %} [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {% if child_docs %} + @@ -118,12 +105,25 @@ No child elements defined. ==== [source,xml] ----- -<...{{ item_attributes | xml_representations: schema }} +<...{% for attr in item_attributes %} +{%- capture type %} +{%- if attr.referenced_type %} +{{- attr.referenced_type }} +{%- elsif attr.simple_type.restriction %} +{{- attr.simple_type.restriction.base }} (value comes from list: '{{ attr.simple_type.restriction.enumeration | map: "value" | join: "'|'" }}') +{%- elsif attr.simple_type.union %} +{%- assign union = attr.simple_type.union %} +{%- assign restriction = union.simple_type.restriction %} +{{ union.member_types }} (value comes from list: {{ restriction.enumeration | map: "value" | join: "'|'" }}) +{%- endif %} +{%- endcapture %} + {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] +{%- endfor %} {%- if elements.size > 0 -%}> {%- for child in elements -%} {% assign element_name = child.ref || child.name %} {%- if element_name %} - <{{ element_name }}> ... {{ child | cardinality_representation: }} + <{{ element_name }}> ... [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {%- else %} {{ child }} {%- endif %} @@ -138,5 +138,5 @@ No child elements defined. .XSD source of `<{{ item.name }}>` [source,xml] ----- -{{ item.to_formatted_xml }} +{{ item | to_xml_representation: skip_rendering_of }} ----- diff --git a/sources/unitsml-xml-schema/templates/_element.adoc.liquid b/sources/unitsml-xml-schema/templates/_element.adoc.liquid index 407f3a8..5546fb6 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_element.adoc.liquid @@ -1,8 +1,8 @@ {%# Documentation #%} {%liquid - assign item_attributes = schema | attributes: item - assign item_children = schema | child_elements: item - assign used_by_items = schema | used_by: item + assign item_attributes = item.attributes + assign item_children = item.child_elements + assign used_by_items = item.used_by %} {% capture docs %} {% for paragraph in item.annotation.documentation %} @@ -19,19 +19,11 @@ {{ docs }} {% if used_by_items.size > 0 %} -{% comment %} - TODO: used_by_elements should return the element, not an anchor. - There should be 0 Metanorma things in Lutaml liquid drops. - TODO: Make the following work - {% for used_by in used_by_elements %} - * {{ used_by.name }} (<>) - - {% endfor %} -{% endcomment %} This element is used by: {% for used_by in used_by_items %} -* {{ used_by }} +{%- assign used_by_name = used_by.ref | default: used_by.name -%} +* {{ used_by.name }} (<>) {% endfor %} {% endif %} @@ -46,7 +38,7 @@ This element is used by: {% endfor %} {% endcapture %} -`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute | min_max_arg: }}]` +`@{{ attribute.name | default: attribute.ref }}`:: {% if attribute.referenced_type %}`{{ attribute.referenced_type }}`::{% endif %} `[{{ attribute.cardinality }}]` {% if attribute_docs %} + -- @@ -75,7 +67,7 @@ choice, etc, in proper hierarchy. {% if item_children.size > 0 %} {% for child in item_children %} -{% assign item_name = child.ref || child.name %} +{% assign item_name = child.ref | default: child.name %} {% if item_name %} {% capture child_docs %} {% for paragraph in child.annotation.documentation %} @@ -84,11 +76,7 @@ choice, etc, in proper hierarchy. {% endfor %} {% endcapture %} -{% comment %} - {# TODO: cardinality_representation is very weird. We don't want a filter like this. We want direct access to the model instead. #} - {{ child.name }}:: `{{ child.type }}` ({{ child.minOccurs }}..{{ child.maxOccurs }}) -{% endcomment %} -{{ item_name }}:: `{{ child.type }}` {{ child | cardinality_representation: }} +{{ item_name }}:: `{{ child.type }}` [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {% if child_docs %} + -- @@ -112,12 +100,25 @@ No child elements defined. ==== [source,xml] ----- -<{{item.name}}{{ item_attributes | xml_representations: schema }} +<{{item.name}}{% for attr in item_attributes %} +{%- capture type %} +{%- if attr.referenced_type %} +{{- attr.referenced_type }} +{%- elsif attr.simple_type.restriction -%} +{{- attr.simple_type.restriction.base -}} (value comes from list: '{{ attr.simple_type.restriction.enumeration | map: "value" | join: "'|'" }}') +{%- elsif attr.simple_type.union -%} +{%- assign union = attr.simple_type.union -%} +{%- assign restriction = union.simple_type.restriction -%} +{{- union.member_types }} (value comes from list: {{ restriction.enumeration | map: "value" | join: "'|'" }}) +{%- endif %} +{%- endcapture %} + {{- attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] +{% endfor %} {%- if item_children.size > 0 -%}> {%- for child in item_children -%} -{% assign item_name = child.ref || child.name %} +{% assign item_name = child.ref | default: child.name %} {%- if item_name %} - <{{item_name}}> ... {{ child | cardinality_representation: }} + <{{item_name}}> ... [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {%- else %} {{ child }} {%- endif %} From 59102cc1fbb8f634c09d0083bdec6b2b2cd298d2 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Tue, 7 Oct 2025 14:29:32 +0500 Subject: [PATCH 08/15] updated complex type and element documents --- .../templates/_complex_type.adoc.liquid | 9 ++++--- .../templates/_element.adoc.liquid | 24 +++++++------------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid index c944958..7e822e4 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid @@ -80,7 +80,7 @@ choice, etc, in proper hierarchy. {% endfor %} {% endcapture %} -{{ item_name }}:: {% if child.type %}`{{ child.type }}`{% endif %} [{{ child.min_occurrences }}..{{ child.max_occurrences }}] +{{ item_name }}:: {% if child.referenced_type %}`{{ child.referenced_type }}`{% endif %} [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {% if child_docs %} + -- @@ -118,8 +118,11 @@ No child elements defined. {%- endif %} {%- endcapture %} {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] -{%- endfor %} -{%- if elements.size > 0 -%}> +{%- endfor -%} +{%- if elements.size > 0 -%} +{% if item_attributes.size > 0 %} +> +{%- else -%}>{% endif %} {%- for child in elements -%} {% assign element_name = child.ref || child.name %} {%- if element_name %} diff --git a/sources/unitsml-xml-schema/templates/_element.adoc.liquid b/sources/unitsml-xml-schema/templates/_element.adoc.liquid index 5546fb6..e0e3501 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_element.adoc.liquid @@ -38,7 +38,7 @@ This element is used by: {% endfor %} {% endcapture %} -`@{{ attribute.name | default: attribute.ref }}`:: {% if attribute.referenced_type %}`{{ attribute.referenced_type }}`::{% endif %} `[{{ attribute.cardinality }}]` +`@{{ attribute.name | default: attribute.ref }}`:: {% if attribute.referenced_type %}`{{ attribute.referenced_type }}`{% endif %} `[{{ attribute.cardinality }}]` {% if attribute_docs %} + -- @@ -53,17 +53,8 @@ No attributes defined. ==== Content model -{% comment %} -TODO: Not all elements have type? -{% endcomment %} - This element is specified the type {{ item.type }} (<>). -{% comment %} -TODO: The "content model" section needs to describe sequence, anyOf, allOf, -choice, etc, in proper hierarchy. -{% endcomment %} - {% if item_children.size > 0 %} {% for child in item_children %} @@ -76,7 +67,7 @@ choice, etc, in proper hierarchy. {% endfor %} {% endcapture %} -{{ item_name }}:: `{{ child.type }}` [{{ child.min_occurrences }}..{{ child.max_occurrences }}] +{{ item_name }}:: {% if child.referenced_type %}`{{ child.referenced_type }}`{% endif %} [{{ child.min_occurrences }}..{{ child.max_occurrences }}] {% if child_docs %} + -- @@ -112,9 +103,12 @@ No child elements defined. {{- union.member_types }} (value comes from list: {{ restriction.enumeration | map: "value" | join: "'|'" }}) {%- endif %} {%- endcapture %} - {{- attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] -{% endfor %} -{%- if item_children.size > 0 -%}> + {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] +{%- endfor -%} +{%- if item_children.size > 0 -%} +{% if item_attributes.size > 1 %} +> +{%- else -%}>{% endif %} {%- for child in item_children -%} {% assign item_name = child.ref | default: child.name %} {%- if item_name %} @@ -124,7 +118,7 @@ No child elements defined. {%- endif %} {%- endfor %} -{%- else -%} +{%- else %} /> {% endif %} ----- From f7afc1c987de75020ad1b8b97778ee058391e49c Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Tue, 7 Oct 2025 21:21:53 +0500 Subject: [PATCH 09/15] updated documents and removed unused liquid files --- .../templates/_complex_type.adoc.liquid | 13 +++++++++---- .../templates/_element.adoc.liquid | 9 +++++++-- .../templates/_simple_type.liquid | 19 ------------------- 3 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 sources/unitsml-xml-schema/templates/_simple_type.liquid diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid index 7e822e4..223b2eb 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid @@ -112,9 +112,14 @@ No child elements defined. {%- elsif attr.simple_type.restriction %} {{- attr.simple_type.restriction.base }} (value comes from list: '{{ attr.simple_type.restriction.enumeration | map: "value" | join: "'|'" }}') {%- elsif attr.simple_type.union %} -{%- assign union = attr.simple_type.union %} -{%- assign restriction = union.simple_type.restriction %} -{{ union.member_types }} (value comes from list: {{ restriction.enumeration | map: "value" | join: "'|'" }}) +{%- assign union = attr.simple_type.union -%} +{% capture enums %} +{%- for u_s_type in union.simple_type -%} +{% assign something = u_s_type.restriction %} +{{- u_s_type.restriction.enumeration | map: "value" | join: "'|'" -}} +{%- endfor -%} +{% endcapture %} +{{- union.member_types }} (value comes from list: {{ enums }}) {%- endif %} {%- endcapture %} {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] @@ -132,7 +137,7 @@ No child elements defined. {%- endif %} {%- endfor %} -{%- else -%} +{%- else %} /> {% endif %} ----- diff --git a/sources/unitsml-xml-schema/templates/_element.adoc.liquid b/sources/unitsml-xml-schema/templates/_element.adoc.liquid index e0e3501..176f24b 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_element.adoc.liquid @@ -99,8 +99,13 @@ No child elements defined. {{- attr.simple_type.restriction.base -}} (value comes from list: '{{ attr.simple_type.restriction.enumeration | map: "value" | join: "'|'" }}') {%- elsif attr.simple_type.union -%} {%- assign union = attr.simple_type.union -%} -{%- assign restriction = union.simple_type.restriction -%} -{{- union.member_types }} (value comes from list: {{ restriction.enumeration | map: "value" | join: "'|'" }}) +{% capture enums %} +{%- for u_s_type in union.simple_type -%} +{% assign something = u_s_type.restriction %} +{{- u_s_type.restriction.enumeration | map: "value" | join: "'|'" -}} +{%- endfor -%} +{% endcapture %} +{{- union.member_types }} (value comes from list: {{ enums }}) {%- endif %} {%- endcapture %} {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] diff --git a/sources/unitsml-xml-schema/templates/_simple_type.liquid b/sources/unitsml-xml-schema/templates/_simple_type.liquid deleted file mode 100644 index 7ffe86d..0000000 --- a/sources/unitsml-xml-schema/templates/_simple_type.liquid +++ /dev/null @@ -1,19 +0,0 @@ -{%- assign simple_type_indent = indent | append: " " %} -{%- assign extended_indent = simple_type_indent | append: " " %} -{{indent}} -{%- if simple_type.restriction %} - {%- assign restriction = simple_type.restriction %} -{{simple_type_indent}} - {%- for enumeration in restriction.enumeration %} -{{extended_indent}} - {%- endfor %} -{{simple_type_indent}} -{%- elsif simple_type.union %} - {%- assign union = simple_type.union %} -{{simple_type_indent}} - {%- for union_simple_type in union.simple_type %} - {%- render "sources/simple_type", simple_type: union_simple_type, indent: extended_indent %} -{{simple_type_indent}} - {%- endfor %} -{%- endif %} -{{indent}} \ No newline at end of file From 2280f89a5f288d1233c192cfbed0917c3bf61dde Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Thu, 9 Oct 2025 20:32:45 +0500 Subject: [PATCH 10/15] updated file extensions and documents --- sources/unitsml-xml-schema/sections/06-elements.adoc | 2 +- .../unitsml-xml-schema/sections/07-complex-types.adoc | 2 +- .../sections/08-attribute-groups.adoc | 2 +- ...tribute_group.adoc.liquid => _attribute_group.adoc} | 9 ++------- .../{_complex_type.adoc.liquid => _complex_type.adoc} | 10 +--------- .../templates/{_element.adoc.liquid => _element.adoc} | 0 6 files changed, 6 insertions(+), 19 deletions(-) rename sources/unitsml-xml-schema/templates/{_attribute_group.adoc.liquid => _attribute_group.adoc} (82%) rename sources/unitsml-xml-schema/templates/{_complex_type.adoc.liquid => _complex_type.adoc} (92%) rename sources/unitsml-xml-schema/templates/{_element.adoc.liquid => _element.adoc} (100%) diff --git a/sources/unitsml-xml-schema/sections/06-elements.adoc b/sources/unitsml-xml-schema/sections/06-elements.adoc index 113e6fe..3e25c23 100644 --- a/sources/unitsml-xml-schema/sections/06-elements.adoc +++ b/sources/unitsml-xml-schema/sections/06-elements.adoc @@ -3,7 +3,7 @@ [lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] ---- {% for item in schema.element %} -include::../templates/_element.adoc.liquid[] +include::../templates/_element.adoc[] {% endfor %} ---- diff --git a/sources/unitsml-xml-schema/sections/07-complex-types.adoc b/sources/unitsml-xml-schema/sections/07-complex-types.adoc index 33c8b40..94db312 100644 --- a/sources/unitsml-xml-schema/sections/07-complex-types.adoc +++ b/sources/unitsml-xml-schema/sections/07-complex-types.adoc @@ -3,7 +3,7 @@ [lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] ---- {% for item in schema.complex_type %} -include::../templates/_complex_type.adoc.liquid[] +include::../templates/_complex_type.adoc[] {% endfor %} ---- diff --git a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc index 200fe84..7840a1d 100644 --- a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc +++ b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc @@ -3,7 +3,7 @@ [lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] ---- {% for item in schema.attribute_group %} -include::../templates/_attribute_group.adoc.liquid[] +include::../templates/_attribute_group.adoc[] {% endfor %} ---- diff --git a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid b/sources/unitsml-xml-schema/templates/_attribute_group.adoc similarity index 82% rename from sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid rename to sources/unitsml-xml-schema/templates/_attribute_group.adoc index ddbf297..2795569 100644 --- a/sources/unitsml-xml-schema/templates/_attribute_group.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_attribute_group.adoc @@ -49,7 +49,7 @@ This attribute group is used by: {% endfor %} {% endcapture %} -`@{{ attribute.name }}`:: `{{ attribute.type }}` `[{{ attribute.cardinality }}]` +`@{{ attribute.name | default: attribute.ref }}`:: {% if attribute.referenced_type %}`{{ attribute.referenced_type }}`{% endif %} `[{{ attribute.cardinality }}]` {% if attribute_docs %} + -- @@ -64,12 +64,7 @@ No attributes defined. .XSD source of `<{{ item.name }}>` -{%liquid - assign xml_representation = item.to_formatted_xml - assign item_xml_representation = item | to_xml_representation: -%} - [source,xml] ----- -{{ xml_representation }} +{{ item | to_xml_representation: skip_rendering_of }} ----- diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid b/sources/unitsml-xml-schema/templates/_complex_type.adoc similarity index 92% rename from sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid rename to sources/unitsml-xml-schema/templates/_complex_type.adoc index 223b2eb..2d8edb8 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc.liquid +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc @@ -40,15 +40,7 @@ This complex type is used by: {% endfor %} {% endcapture %} -{% capture attr_name %} -{%- if attribute.ref -%} -{{- attribute.ref -}} -{%- else -%} -{{- attribute.name -}} -{%- endif -%} -{% endcapture %} - -`@{{ attr_name }}`:: {% if attribute.type %}`{{ attribute.type }}`{% endif %} `[{{ attribute.cardinality }}]` +`@{{ attribute.ref | default: attribute.name }}`:: {% if attribute.referenced_type %}`{{ attribute.referenced_type }}`{% endif %} `[{{ attribute.cardinality }}]` {% if attribute_docs %} + -- diff --git a/sources/unitsml-xml-schema/templates/_element.adoc.liquid b/sources/unitsml-xml-schema/templates/_element.adoc similarity index 100% rename from sources/unitsml-xml-schema/templates/_element.adoc.liquid rename to sources/unitsml-xml-schema/templates/_element.adoc From a31f28da9ab35e3865815ae319e6f4556dce5e9d Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Mon, 10 Nov 2025 22:58:27 +0500 Subject: [PATCH 11/15] Updated templates code and added a new partial --- .../sections/06-elements.adoc | 2 +- .../sections/07-complex-types.adoc | 2 +- .../sections/08-attribute-groups.adoc | 2 +- .../templates/_child_elements.adoc | 20 +++++++++++++++++++ .../templates/_complex_type.adoc | 10 ++-------- .../templates/_element.adoc | 1 - 6 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 sources/unitsml-xml-schema/templates/_child_elements.adoc diff --git a/sources/unitsml-xml-schema/sections/06-elements.adoc b/sources/unitsml-xml-schema/sections/06-elements.adoc index 3e25c23..13196fa 100644 --- a/sources/unitsml-xml-schema/sections/06-elements.adoc +++ b/sources/unitsml-xml-schema/sections/06-elements.adoc @@ -1,6 +1,6 @@ == Elements -[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] +[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation,include_path=templates] ---- {% for item in schema.element %} include::../templates/_element.adoc[] diff --git a/sources/unitsml-xml-schema/sections/07-complex-types.adoc b/sources/unitsml-xml-schema/sections/07-complex-types.adoc index 94db312..c0c0ed7 100644 --- a/sources/unitsml-xml-schema/sections/07-complex-types.adoc +++ b/sources/unitsml-xml-schema/sections/07-complex-types.adoc @@ -1,6 +1,6 @@ == Complex types -[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] +[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation,include_path=templates] ---- {% for item in schema.complex_type %} include::../templates/_complex_type.adoc[] diff --git a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc index 7840a1d..ea8fab6 100644 --- a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc +++ b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc @@ -1,6 +1,6 @@ == Attribute groups -[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation] +[lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation,include_path=templates] ---- {% for item in schema.attribute_group %} include::../templates/_attribute_group.adoc[] diff --git a/sources/unitsml-xml-schema/templates/_child_elements.adoc b/sources/unitsml-xml-schema/templates/_child_elements.adoc new file mode 100644 index 0000000..7381ccc --- /dev/null +++ b/sources/unitsml-xml-schema/templates/_child_elements.adoc @@ -0,0 +1,20 @@ +{%- assign element_name = child.ref || child.name -%} +{%- assign mixed = child.mixed | default: false -%} +{%- if mixed -%} + +{%- for element in child.resolved_element_order %}{% render "child_elements", child: element %}{% endfor -%} +{%- elsif child.is_sequence? %} + Start Sequence {% if child.cardinality %}[{{ child.min_occurrences }}..{{ child.max_occurrences }}]{% endif %} +{%- for element in child.resolved_element_order -%}{% if element.is_annotation? %}{% continue %}{% endif %} +{%- render "child_elements", child: element %} +{%- endfor %} + End Sequence +{%- elsif child.is_any? -%} + Allow any elements from any namespace (skip validation). [{{ child.min_occurrences }}..{{ child.max_occurrences }}] +{%- elsif child.is_all? -%} + Allow all elements from any namespace (skip validation). [{{ child.min_occurrences }}..{{ child.max_occurrences }}] +{%- elsif child.is_choice? -%} + One of the elements [{{ child.min_occurrences }}..{{ child.max_occurrences }}] times. +{%- elsif element_name -%} + <{{ element_name }}> ... [{{ child.min_occurrences }}..{{ child.max_occurrences }}] +{%- endif %} \ No newline at end of file diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc b/sources/unitsml-xml-schema/templates/_complex_type.adoc index 2d8edb8..5c684b4 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc @@ -85,7 +85,6 @@ choice, etc, in proper hierarchy. {% endif %} {% endfor %} - {% else %} No child elements defined. {% endif %} @@ -120,13 +119,8 @@ No child elements defined. {% if item_attributes.size > 0 %} > {%- else -%}>{% endif %} -{%- for child in elements -%} -{% assign element_name = child.ref || child.name %} -{%- if element_name %} - <{{ element_name }}> ... [{{ child.min_occurrences }}..{{ child.max_occurrences }}] -{%- else %} - {{ child }} -{%- endif %} +{%- for child in item_element_order -%}{% if child.is_annotation? %}{% continue %}{% endif %} +{%- render "child_elements", child: child -%} {%- endfor %} {%- else %} diff --git a/sources/unitsml-xml-schema/templates/_element.adoc b/sources/unitsml-xml-schema/templates/_element.adoc index 176f24b..f272dc7 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc +++ b/sources/unitsml-xml-schema/templates/_element.adoc @@ -22,7 +22,6 @@ This element is used by: {% for used_by in used_by_items %} -{%- assign used_by_name = used_by.ref | default: used_by.name -%} * {{ used_by.name }} (<>) {% endfor %} From 5337377515e0d654493d9ea50769dc37443a822c Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Tue, 11 Nov 2025 21:53:25 +0500 Subject: [PATCH 12/15] Updated document files about child elements rendering in elements and complex_types --- .../templates/_child_elements.adoc | 38 +++++++++---------- .../templates/_complex_type.adoc | 11 ++++-- .../templates/_element.adoc | 18 +++++---- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/sources/unitsml-xml-schema/templates/_child_elements.adoc b/sources/unitsml-xml-schema/templates/_child_elements.adoc index 7381ccc..d20bbc7 100644 --- a/sources/unitsml-xml-schema/templates/_child_elements.adoc +++ b/sources/unitsml-xml-schema/templates/_child_elements.adoc @@ -1,20 +1,20 @@ -{%- assign element_name = child.ref || child.name -%} -{%- assign mixed = child.mixed | default: false -%} -{%- if mixed -%} - -{%- for element in child.resolved_element_order %}{% render "child_elements", child: element %}{% endfor -%} -{%- elsif child.is_sequence? %} - Start Sequence {% if child.cardinality %}[{{ child.min_occurrences }}..{{ child.max_occurrences }}]{% endif %} -{%- for element in child.resolved_element_order -%}{% if element.is_annotation? %}{% continue %}{% endif %} -{%- render "child_elements", child: element %} -{%- endfor %} - End Sequence +{% capture cardinality %}{{ child.min_occurrences }}..{{ child.max_occurrences }}{% endcapture %} +{%- if child.is_sequence? -%} + {%- assign min_or_max_ocurrs = child.min_occurs | default: child.max_occurs -%} + {% if min_or_max_ocurrs -%} + Start Sequence [{{ cardinality }}] + {%- endif -%} + {%- for element in child.resolved_element_order %} + {%- if element.is_annotation? or element.is_attribute? or element.is_attribute_group? -%} + {%- continue -%} + {% else %} + {% render "child_elements", child: element -%} + {%- endif %} + {%- endfor %} + {% if min_or_max_ocurrs %}End Sequence{% endif %} {%- elsif child.is_any? -%} - Allow any elements from any namespace (skip validation). [{{ child.min_occurrences }}..{{ child.max_occurrences }}] -{%- elsif child.is_all? -%} - Allow all elements from any namespace (skip validation). [{{ child.min_occurrences }}..{{ child.max_occurrences }}] -{%- elsif child.is_choice? -%} - One of the elements [{{ child.min_occurrences }}..{{ child.max_occurrences }}] times. -{%- elsif element_name -%} - <{{ element_name }}> ... [{{ child.min_occurrences }}..{{ child.max_occurrences }}] -{%- endif %} \ No newline at end of file + Allow any elements from any namespace ({{ child.process_contents }} validation). [{{ cardinality }}] +{%- else %} + {%- assign element_name = child.ref | default: child.name -%} + <{{ element_name }}> ... [{{ cardinality }}] +{%- endif -%} \ No newline at end of file diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc b/sources/unitsml-xml-schema/templates/_complex_type.adoc index 5c684b4..8118767 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc @@ -4,7 +4,7 @@ assign item_children = item.child_elements assign used_by_items = item.used_by assign item_element_order = item.resolved_element_order - assign elements = item_children + assign elements = item.direct_child_elements %} {% capture docs %} {% for paragraph in item.annotation.documentation %} @@ -119,8 +119,13 @@ No child elements defined. {% if item_attributes.size > 0 %} > {%- else -%}>{% endif %} -{%- for child in item_element_order -%}{% if child.is_annotation? %}{% continue %}{% endif %} -{%- render "child_elements", child: child -%} + {% if item.mixed %}{% endif %} +{%- for child in elements -%} + {%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%} + {%- continue -%} + {%- else %} + {% render "child_elements", child: child -%} + {% endif -%} {%- endfor %} {%- else %} diff --git a/sources/unitsml-xml-schema/templates/_element.adoc b/sources/unitsml-xml-schema/templates/_element.adoc index f272dc7..95812c1 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc +++ b/sources/unitsml-xml-schema/templates/_element.adoc @@ -1,8 +1,10 @@ {%# Documentation #%} {%liquid + assign item_complex_type = item.referenced_complex_type assign item_attributes = item.attributes assign item_children = item.child_elements assign used_by_items = item.used_by + assign elements = item_complex_type.direct_child_elements %} {% capture docs %} {% for paragraph in item.annotation.documentation %} @@ -109,17 +111,17 @@ No child elements defined. {%- endcapture %} {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] {%- endfor -%} -{%- if item_children.size > 0 -%} +{%- if elements.size > 0 -%} {% if item_attributes.size > 1 %} > {%- else -%}>{% endif %} -{%- for child in item_children -%} -{% assign item_name = child.ref | default: child.name %} -{%- if item_name %} - <{{item_name}}> ... [{{ child.min_occurrences }}..{{ child.max_occurrences }}] -{%- else %} - {{ child }} -{%- endif %} + {% if item_complex_type.mixed %}{%- endif %} +{%- for child in elements -%} + {%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%} + {%- continue -%} + {%- else %} + {% render "child_elements", child: child -%} + {% endif -%} {%- endfor %} {%- else %} From 42d74fbfa9869e84f4b14407030c393f5626cc34 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Thu, 13 Nov 2025 12:48:28 +0500 Subject: [PATCH 13/15] Updated example block for complex type and element --- .../templates/_child_elements.adoc | 30 +++++++++---------- .../templates/_complex_type.adoc | 14 ++++----- .../templates/_element.adoc | 14 ++++----- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/sources/unitsml-xml-schema/templates/_child_elements.adoc b/sources/unitsml-xml-schema/templates/_child_elements.adoc index d20bbc7..ecadeab 100644 --- a/sources/unitsml-xml-schema/templates/_child_elements.adoc +++ b/sources/unitsml-xml-schema/templates/_child_elements.adoc @@ -1,20 +1,20 @@ -{% capture cardinality %}{{ child.min_occurrences }}..{{ child.max_occurrences }}{% endcapture %} +{%- capture cardinality -%}{{ child.min_occurrences }}..{{ child.max_occurrences }}{%- endcapture -%} {%- if child.is_sequence? -%} - {%- assign min_or_max_ocurrs = child.min_occurs | default: child.max_occurs -%} - {% if min_or_max_ocurrs -%} - Start Sequence [{{ cardinality }}] - {%- endif -%} - {%- for element in child.resolved_element_order %} - {%- if element.is_annotation? or element.is_attribute? or element.is_attribute_group? -%} - {%- continue -%} - {% else %} - {% render "child_elements", child: element -%} - {%- endif %} - {%- endfor %} - {% if min_or_max_ocurrs %}End Sequence{% endif %} +{%- assign min_or_max_ocurrs = child.min_occurs | default: child.max_occurs -%} +{%- if min_or_max_ocurrs -%}{%- assign indent = " " %} + Start Sequence [{{ cardinality }}] +{%- endif -%}{%- for element in child.resolved_element_order %}{%- if element.is_annotation? or element.is_attribute? or element.is_attribute_group? -%}{%- continue -%}{%- else %} + {{ indent }}{% render "child_elements", child: element -%} +{%- endif -%} +{%- endfor %} +{%- if min_or_max_ocurrs %} + End Sequence +{%- endif -%} {%- elsif child.is_any? -%} Allow any elements from any namespace ({{ child.process_contents }} validation). [{{ cardinality }}] -{%- else %} - {%- assign element_name = child.ref | default: child.name -%} +{%- elsif child.is_simple_content? %} + {{ child.base_type }} +{%- else -%} +{%- assign element_name = child.ref | default: child.name -%} <{{ element_name }}> ... [{{ cardinality }}] {%- endif -%} \ No newline at end of file diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc b/sources/unitsml-xml-schema/templates/_complex_type.adoc index 8118767..a9ea77b 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc @@ -119,14 +119,12 @@ No child elements defined. {% if item_attributes.size > 0 %} > {%- else -%}>{% endif %} - {% if item.mixed %}{% endif %} -{%- for child in elements -%} - {%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%} - {%- continue -%} - {%- else %} - {% render "child_elements", child: child -%} - {% endif -%} -{%- endfor %} +{%- if item.mixed %} + +{%- endif -%}{%- for child in elements -%}{%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%}{%- continue -%}{%- else -%} +{% render "child_elements", child: child -%} +{% endif -%} +{% endfor %} {%- else %} /> diff --git a/sources/unitsml-xml-schema/templates/_element.adoc b/sources/unitsml-xml-schema/templates/_element.adoc index 95812c1..dd9318a 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc +++ b/sources/unitsml-xml-schema/templates/_element.adoc @@ -115,14 +115,12 @@ No child elements defined. {% if item_attributes.size > 1 %} > {%- else -%}>{% endif %} - {% if item_complex_type.mixed %}{%- endif %} -{%- for child in elements -%} - {%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%} - {%- continue -%} - {%- else %} - {% render "child_elements", child: child -%} - {% endif -%} -{%- endfor %} +{%- if item_complex_type.mixed %} + +{%- endif -%}{%- for child in elements -%}{%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%}{%- continue -%}{%- else -%} +{% render "child_elements", child: child -%} +{% endif -%} +{% endfor %} {%- else %} /> From 47a278ce1f9f9551562693f540873ab8a6f2eea0 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Wed, 19 Nov 2025 13:05:27 +0500 Subject: [PATCH 14/15] updated used lutaml-xsd methods names --- sources/unitsml-xml-schema/templates/_child_elements.adoc | 8 ++++---- sources/unitsml-xml-schema/templates/_complex_type.adoc | 2 +- sources/unitsml-xml-schema/templates/_element.adoc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/unitsml-xml-schema/templates/_child_elements.adoc b/sources/unitsml-xml-schema/templates/_child_elements.adoc index ecadeab..e46ee65 100644 --- a/sources/unitsml-xml-schema/templates/_child_elements.adoc +++ b/sources/unitsml-xml-schema/templates/_child_elements.adoc @@ -1,18 +1,18 @@ {%- capture cardinality -%}{{ child.min_occurrences }}..{{ child.max_occurrences }}{%- endcapture -%} -{%- if child.is_sequence? -%} +{%- if child.sequence? -%} {%- assign min_or_max_ocurrs = child.min_occurs | default: child.max_occurs -%} {%- if min_or_max_ocurrs -%}{%- assign indent = " " %} Start Sequence [{{ cardinality }}] -{%- endif -%}{%- for element in child.resolved_element_order %}{%- if element.is_annotation? or element.is_attribute? or element.is_attribute_group? -%}{%- continue -%}{%- else %} +{%- endif -%}{%- for element in child.resolved_element_order %}{%- if element.annotation? or element.attribute? or element.attribute_group? -%}{%- continue -%}{%- else %} {{ indent }}{% render "child_elements", child: element -%} {%- endif -%} {%- endfor %} {%- if min_or_max_ocurrs %} End Sequence {%- endif -%} -{%- elsif child.is_any? -%} +{%- elsif child.any? -%} Allow any elements from any namespace ({{ child.process_contents }} validation). [{{ cardinality }}] -{%- elsif child.is_simple_content? %} +{%- elsif child.simple_content? %} {{ child.base_type }} {%- else -%} {%- assign element_name = child.ref | default: child.name -%} diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc b/sources/unitsml-xml-schema/templates/_complex_type.adoc index a9ea77b..9516ba9 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc @@ -121,7 +121,7 @@ No child elements defined. {%- else -%}>{% endif %} {%- if item.mixed %} -{%- endif -%}{%- for child in elements -%}{%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%}{%- continue -%}{%- else -%} +{%- endif -%}{%- for child in elements -%}{%- if child.annotation? or child.attribute? or child.attribute_group? -%}{%- continue -%}{%- else -%} {% render "child_elements", child: child -%} {% endif -%} {% endfor %} diff --git a/sources/unitsml-xml-schema/templates/_element.adoc b/sources/unitsml-xml-schema/templates/_element.adoc index dd9318a..c034d58 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc +++ b/sources/unitsml-xml-schema/templates/_element.adoc @@ -117,7 +117,7 @@ No child elements defined. {%- else -%}>{% endif %} {%- if item_complex_type.mixed %} -{%- endif -%}{%- for child in elements -%}{%- if child.is_annotation? or child.is_attribute? or child.is_attribute_group? -%}{%- continue -%}{%- else -%} +{%- endif -%}{%- for child in elements -%}{%- if child.annotation? or child.attribute? or child.attribute_group? -%}{%- continue -%}{%- else -%} {% render "child_elements", child: child -%} {% endif -%} {% endfor %} From e55740136b25fa52f5d335f88c9415aa9f6e1c37 Mon Sep 17 00:00:00 2001 From: suleman-uzair Date: Wed, 10 Dec 2025 20:13:37 +0500 Subject: [PATCH 15/15] Updated doc files and branch names in Gemfile --- Gemfile | 8 +++++++- sources/unitsml-xml-schema/sections/06-elements.adoc | 2 +- .../sections/07-complex-types.adoc | 2 +- .../sections/08-attribute-groups.adoc | 2 +- .../templates/_attribute_group.adoc | 4 +++- .../unitsml-xml-schema/templates/_complex_type.adoc | 12 ++++++------ sources/unitsml-xml-schema/templates/_element.adoc | 5 +++-- 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index c59a8c9..b68ee49 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,10 @@ gem "lutaml", branch: "update/xsd_support_metanorma_plugin" gem "lutaml-model", github: "lutaml/lutaml-model", - branch: "update/liquid_element_order" + branch: "main" +gem "lutaml-xsd", + github: "lutaml/lutaml-xsd", + branch: "update/liquid_drop_methods" gem "metanorma" gem "metanorma-cli" gem "metanorma-plugin-lutaml", @@ -14,3 +17,6 @@ gem "metanorma-plugin-lutaml", gem "metanorma-standoc", github: "metanorma/metanorma-standoc", branch: "update/lutaml_xsd_preprocessor_support" +gem "metanorma-utils", + github: "metanorma/metanorma-utils", + branch: "main" diff --git a/sources/unitsml-xml-schema/sections/06-elements.adoc b/sources/unitsml-xml-schema/sections/06-elements.adoc index 13196fa..a563486 100644 --- a/sources/unitsml-xml-schema/sections/06-elements.adoc +++ b/sources/unitsml-xml-schema/sections/06-elements.adoc @@ -2,7 +2,7 @@ [lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation,include_path=templates] ---- -{% for item in schema.element %} +{% for item in schema.elements_sorted_by_name %} include::../templates/_element.adoc[] {% endfor %} diff --git a/sources/unitsml-xml-schema/sections/07-complex-types.adoc b/sources/unitsml-xml-schema/sections/07-complex-types.adoc index c0c0ed7..81feb11 100644 --- a/sources/unitsml-xml-schema/sections/07-complex-types.adoc +++ b/sources/unitsml-xml-schema/sections/07-complex-types.adoc @@ -2,7 +2,7 @@ [lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation,include_path=templates] ---- -{% for item in schema.complex_type %} +{% for item in schema.complex_types_sorted_by_name %} include::../templates/_complex_type.adoc[] {% endfor %} diff --git a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc index ea8fab6..8c1e2a6 100644 --- a/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc +++ b/sources/unitsml-xml-schema/sections/08-attribute-groups.adoc @@ -2,7 +2,7 @@ [lutaml_xsd,schemas/unitsml-v1.0-csd04.xsd,schema,skip_rendering_of=annotation,include_path=templates] ---- -{% for item in schema.attribute_group %} +{% for item in schema.attribute_groups_sorted_by_name %} include::../templates/_attribute_group.adoc[] {% endfor %} diff --git a/sources/unitsml-xml-schema/templates/_attribute_group.adoc b/sources/unitsml-xml-schema/templates/_attribute_group.adoc index 2795569..99a0691 100644 --- a/sources/unitsml-xml-schema/templates/_attribute_group.adoc +++ b/sources/unitsml-xml-schema/templates/_attribute_group.adoc @@ -62,9 +62,11 @@ This attribute group is used by: No attributes defined. {% endif %} +{%- capture xmlns -%}xmlns="http://www.w3.org/2001/XMLSchema" {% endcapture %} + .XSD source of `<{{ item.name }}>` [source,xml] ----- -{{ item | to_xml_representation: skip_rendering_of }} +{{ item | to_xml_representation: skip_rendering_of | remove: xmlns }} ----- diff --git a/sources/unitsml-xml-schema/templates/_complex_type.adoc b/sources/unitsml-xml-schema/templates/_complex_type.adoc index 9516ba9..01dd6ad 100644 --- a/sources/unitsml-xml-schema/templates/_complex_type.adoc +++ b/sources/unitsml-xml-schema/templates/_complex_type.adoc @@ -106,14 +106,13 @@ No child elements defined. {%- assign union = attr.simple_type.union -%} {% capture enums %} {%- for u_s_type in union.simple_type -%} -{% assign something = u_s_type.restriction %} -{{- u_s_type.restriction.enumeration | map: "value" | join: "'|'" -}} +[ {{ u_s_type.restriction.base }} (value comes from list: {{- u_s_type.restriction.enumeration | map: "value" | join: "'|'" -}}) ] {%- endfor -%} -{% endcapture %} -{{- union.member_types }} (value comes from list: {{ enums }}) +{% endcapture -%} +union of: [ {{ union.member_types }}, {{ enums }} ] {%- endif %} {%- endcapture %} - {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] + {{ attr.referenced_name }}="{{ attr.fixed | default: type }}" [{{ attr.cardinality }}] {%- endfor -%} {%- if elements.size > 0 -%} {% if item_attributes.size > 0 %} @@ -131,9 +130,10 @@ No child elements defined. {% endif %} ----- ==== +{%- capture xmlns -%}xmlns="http://www.w3.org/2001/XMLSchema" {% endcapture %} .XSD source of `<{{ item.name }}>` [source,xml] ----- -{{ item | to_xml_representation: skip_rendering_of }} +{{ item | to_xml_representation: skip_rendering_of | remove: xmlns }} ----- diff --git a/sources/unitsml-xml-schema/templates/_element.adoc b/sources/unitsml-xml-schema/templates/_element.adoc index c034d58..7478905 100644 --- a/sources/unitsml-xml-schema/templates/_element.adoc +++ b/sources/unitsml-xml-schema/templates/_element.adoc @@ -109,7 +109,7 @@ No child elements defined. {{- union.member_types }} (value comes from list: {{ enums }}) {%- endif %} {%- endcapture %} - {{ attr.referenced_name }}="{{ type }}" [{{ attr.cardinality }}] + {{ attr.referenced_name }}="{{ attr.fixed | default: type }}" [{{ attr.cardinality }}] {%- endfor -%} {%- if elements.size > 0 -%} {% if item_attributes.size > 1 %} @@ -127,9 +127,10 @@ No child elements defined. {% endif %} ----- ==== +{%- capture xmlns -%}xmlns="http://www.w3.org/2001/XMLSchema" {% endcapture %} .XSD source of `<{{ item.name }}>` [source,xml] ----- -{{ item | to_xml_representation: skip_rendering_of }} +{{ item | to_xml_representation: skip_rendering_of | remove: xmlns }} -----