formula

<h:div class="summary">A molecular formula.</h:div>
<h:div class="description">
  <h:p>It is defined by
    <h:tt>atomArray</h:tt>s each with a list of elementTypes and their counts (or default=1). All other information in the
    <h:tt>atomArray</h:tt>is ignored.
    <h:tt>formula</h:tt>are nestable so that aggregates (e.g. hydrates, salts, etc.) can be described. CML does not require that formula information is consistent with (say) crystallographic information; this allows for experimental variance.</h:p>
  <h:p>An alternative briefer representation is also available through the
    <h:tt>concise</h:tt>. This must include whitespace round all elements and their counts, which must be explicit.</h:p>
  <h:p>2005-10-16. The semantics are now the following. A formula must have one or both:
    <h:ul>
      <h:li>A concise attribute</h:li>A single atomArray child, using array format.</h:ul>it must also have a formalCharge attribute if atomArray is used and the charge is non-zero.</h:p>
  <h:p>The concise, formalCharge and atomArrary information must always be consistent and software should throw an error if not.</h:p>
  <h:p>Until now there was no way of holding inline formula other than concise (although JUMBO5.0 is capable of reading them). We now extend formula.xsd to incorporate this through the attribute "inline" which requires the use of the "convention" attribute. The contents of inline are purely textual. It can be used with or without atomArray or concise but there is no guarantee that it can be interpreted as a meaningful chemical formula or that there is consistency. In some cases a doc supplies several formula representations (e.g. the IUCr's CIF). In this case a molecule (or crystal) element might contain several formula children. The semantics of which to use are application dependent.</h:p>
</h:div>
<h:div class="example" href="formula1.xml"/>

Element Information

Model

anyCml | ANY element from ANY namespace OTHER than 'http://www.xml-cml.org/schema' | ANY element from LOCAL namespace 'No Namespace'
Children: anyCml

Attributes

QName Type Fixed Default Use Inheritable Annotation
concise formulaType optional
<h:div class="summary">A concise formula.</h:div>
<h:div class="general">The string represents an (unstructured) formula i.e. no submolecules. Recommended to use the format "H 2 O 1", etc.</h:div>
convention namespaceRefType optional
<h:div class="summary">A reference to a convention.</h:div>
<h:div class="description">There is no controlled vocabulary for conventions, but the author must ensure that the semantics are openly available and that there are mechanisms for implementation. The convention is inherited by all the subelements, so that a convention for
  <h:tt>molecule</h:tt>would by default extend to its
  <h:tt>bond</h:tt>and
  <h:tt>atom</h:tt>children. This can be overwritten if necessary by an explicit
  <h:tt>convention</h:tt>.
  <h:p>It may be useful to create conventions with namespaces (e.g.
    <h:tt>iupac:name</h:tt>). Use of
    <h:tt>convention</h:tt>will normally require non-STMML semantics, and should be used with caution. We would expect that conventions prefixed with "ISO" would be useful, such as ISO8601 for dateTimes.</h:p>
  <h:p>There is no default, but the conventions of STMML or the related language (e.g. CML) will be assumed.</h:p>
</h:div>
<h:div class="example" id="ex" href="convGroup1.xml"/>
count positiveNumberType optional
<h:div class="summary">The count of the object.</h:div>
<h:div class="description">No fixed semantics or default, normally integers. It is presumed that the element can be multiplied by the count value.</h:div>
dictRef namespaceRefType optional
<h:div class="summary">A reference to a dictionary entry.</h:div>
<h:div class="description">Elements in data instances such as _scalar_ may have a
  <h:tt>dictRef</h:tt>attribute to point to an entry in a dictionary. To avoid excessive use of (mutable) filenames and URIs we recommend a namespace prefix, mapped to a namespace URI in the normal manner. In this case, of course, the namespace URI must point to a real XML doc containing _entry_ elements and validated against STMML Schema.
  <h:p>Where there is concern about the dictionary becoming separated from the doc the dictionary entries can be physically included as part of the data instance and the normal XPointer addressing mechanism can be used.</h:p>
  <h:p>This attribute can also be used on _dictionary_ elements to define the namespace prefix</h:p>
</h:div>
<h:div class="example" href="dictRefGroup1.xml"/>
formalCharge formalChargeType optional
<h:div class="summary">The formalCharge on the object.</h:div>
<h:div class="description">NOT the calculated charge or oxidation state. No formal default, but assumed to be zero if omitted. It may become good practice to include it.</h:div>
id idType optional
<h:div class="summary">A unique ID for an element.</h:div>
<h:div class="description">Id is used for machine identification of elements and in general should not have application semantics. It is similar to the XML ID type as containing only alphanumerics, '_', ',' and '-' and and must start with an alphabetic character. Ids are case sensitive. Ids should be unique within local scope, thus all atoms within a molecule should have unique ids, but separated molecules within a doc (such as a published article) might have identical ids. Software should be able to search local scope (e.g. all atoms within a molecule). However this is under constant review.</h:div>
inline xsd:string optional
<h:div class="summary">An inline representation of the object.</h:div>
<h:div class="general">This can represent a wide range of information from formal serialization as ASCII through to domain-specific textual representations. It will often be used in conjunction with the "convention" attribute. For example it could be used to represent IUPAC formula, SMILES strings, TeX equations, etc. Characters should conforma to the XML character set, and XML markup (lt and amp) should be escaped.
  <h:b>IT SHOULD NEVER BE USED FOR INLINE XML</h:b>
</h:div>
<h:div class="example" href="attributeGroups/inline.xml"/>
title xsd:string optional
<h:div class="summary">A title on an element.</h:div>
<h:div class="description">No controlled value.</h:div>
<h:div class="example" href="title1.xml"/>
Wildcard: ANY attribute from ANY namespace OTHER than 'http://www.xml-cml.org/schema'

Source

<xsd:element name="formula" id="el.formula" substitutionGroup="anyCml">
  <xsd:annotation>
    <xsd:documentation>
      <h:div class="summary">A molecular formula.</h:div>
      <h:div class="description">
        <h:p>It is defined by
          <h:tt>atomArray</h:tt>s each with a list of elementTypes and their counts (or default=1). All other information in the
          <h:tt>atomArray</h:tt>is ignored.
          <h:tt>formula</h:tt>are nestable so that aggregates (e.g. hydrates, salts, etc.) can be described. CML does not require that formula information is consistent with (say) crystallographic information; this allows for experimental variance.</h:p>
        <h:p>An alternative briefer representation is also available through the
          <h:tt>concise</h:tt>. This must include whitespace round all elements and their counts, which must be explicit.</h:p>
        <h:p>2005-10-16. The semantics are now the following. A formula must have one or both:
          <h:ul>
            <h:li>A concise attribute</h:li>A single atomArray child, using array format.</h:ul>it must also have a formalCharge attribute if atomArray is used and the charge is non-zero.</h:p>
        <h:p>The concise, formalCharge and atomArrary information must always be consistent and software should throw an error if not.</h:p>
        <h:p>Until now there was no way of holding inline formula other than concise (although JUMBO5.0 is capable of reading them). We now extend formula.xsd to incorporate this through the attribute "inline" which requires the use of the "convention" attribute. The contents of inline are purely textual. It can be used with or without atomArray or concise but there is no guarantee that it can be interpreted as a meaningful chemical formula or that there is consistency. In some cases a doc supplies several formula representations (e.g. the IUCr's CIF). In this case a molecule (or crystal) element might contain several formula children. The semantics of which to use are application dependent.</h:p>
      </h:div>
      <h:div class="example" href="formula1.xml"/>
    </xsd:documentation>
  </xsd:annotation>
  <xsd:complexType>
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element ref="anyCml"/>
      <xsd:any namespace="##other" processContents="lax"/>
      <xsd:any namespace="##local" processContents="lax"/>
    </xsd:choice>
    <xsd:attributeGroup ref="title"/>
    <xsd:attributeGroup ref="id"/>
    <xsd:attributeGroup ref="convention"/>
    <xsd:attributeGroup ref="dictRef"/>
    <xsd:attributeGroup ref="count">
      <xsd:annotation>
        <xsd:documentation>
          <h:div class="specific">Allows for fractional components.</h:div>
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attributeGroup>
    <xsd:attributeGroup ref="formalCharge">
      <xsd:annotation>
        <xsd:documentation>
          <h:div class="specific">The charge on the formula. Mandatory if non-zero (i.e. cannot rely on concise)</h:div>
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attributeGroup>
    <xsd:attributeGroup ref="concise"/>
    <xsd:attributeGroup ref="inline">
      <xsd:annotation>
        <xsd:documentation>
          <h:div class="specific">An inline representation of the formula. There are no controlled semantics and it need not be compatible with concise or atomArray.</h:div>
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attributeGroup>
    <xsd:anyAttribute namespace="##other" processContents="lax"/>
  </xsd:complexType>
</xsd:element>

Sample