Definition Type: Element
Name: formula
Namespace: http://www.xml-cml.org/schema
Containing Schema: schema.xsd
Abstract
Documentation:
A molecular formula. It is defined by atomArrays each with a list of elementTypes and their counts (or default=1). All other information in the atomArray is ignored. formula 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. An alternative briefer representation is also available through the concise. This must include whitespace round all elements and their counts, which must be explicit. 2005-10-16. The semantics are now the following. A formula must have one or both: A concise attribute A single atomArray child, using array format. it must also have a formalCharge attribute if atomArray is used and the charge is non-zero. The concise, formalCharge and atomArrary information must always be consistent and software should throw an error if not. 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 document 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.
Collapse XSD Schema Diagram:
Drilldown into atomArray in schema schema_xsd Drilldown into formula in schema schema_xsd Drilldown into inline in schema schema_xsd Drilldown into inline in schema schema_xsd Drilldown into concise in schema schema_xsd Drilldown into concise in schema schema_xsd Drilldown into formalCharge in schema schema_xsd Drilldown into formalCharge in schema schema_xsd Drilldown into count in schema schema_xsd Drilldown into count in schema schema_xsd Drilldown into dictRef in schema schema_xsd Drilldown into dictRef in schema schema_xsd Drilldown into convention in schema schema_xsd Drilldown into convention in schema schema_xsd Drilldown into id in schema schema_xsd Drilldown into id in schema schema_xsd Drilldown into title in schema schema_xsd Drilldown into title in schema schema_xsdXSD Diagram of formula in schema schema_xsd (Chemical Markup Language (CML))
Collapse XSD Schema Code:
<xsd:element name="formula" id="el.formula">
    <xsd:annotation>
        <xsd:documentation>
            <h:div class="summary" xmlns:h="http://www.w3.org/1999/xhtml">A molecular formula.</h:div>
            <h:div class="description" xmlns:h="http://www.w3.org/1999/xhtml">
                <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 document 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" xmlns:h="http://www.w3.org/1999/xhtml" />
        </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:choice>
            <xsd:choice minOccurs="0" maxOccurs="unbounded">
                <xsd:element ref="formula" />
                <xsd:element ref="atomArray" />
            </xsd:choice>
        </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" xmlns:h="http://www.w3.org/1999/xhtml">Allows for fractional components.</h:div>
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attributeGroup>
        <xsd:attributeGroup ref="formalCharge">
            <xsd:annotation>
                <xsd:documentation>
                    <h:div class="specific" xmlns:h="http://www.w3.org/1999/xhtml">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" xmlns:h="http://www.w3.org/1999/xhtml">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:complexType>
</xsd:element>
Collapse Child Elements:
Name Type Min Occurs Max Occurs
formula nsA:formula (1) (1)
atomArray nsA:atomArray (1) (1)
Collapse Child Attributes:
Name Type Default Value Use
title nsA:title (Optional)
id nsA:id (Optional)
convention nsA:convention (Optional)
dictRef nsA:dictRef (Optional)
count nsA:count (Optional)
formalCharge nsA:formalCharge (Optional)
concise nsA:concise (Optional)
inline nsA:inline (Optional)