The declare element
(Excerpt from "The MathML Handbook" by Pavi Sandhu)
The declare element is used in content markup to associate a specific property or meaning with a mathematical object. For example, you can indicate that a certain identifier A represents a vector using this markup:
<declare type="vector">
<ci>A</ci>
</declare>
The declare element is always placed at the beginning of a math element, and the scope of the declaration is the entire math element. This element is not rendered visually or aurally but it does affect the semantic interpretation of the identifier it encloses. The declare element is used whenever you need to specify that a given symbol represents a particular type of object such as a vector, matrix, list, set, or function. This information is specified using the type attribute of the declare element, which can be set to the name of any content element. By setting this attribute to the name of a container element such as cn, list, set, vector, matrix, or fn, you can declare any identifier to be an object of the specified type.
For example, the following declaration states that x is a real number with the value 3.75:
<declare>
<ci>x</ci>
<cn>3.75</cn>
</declare>
The following declares A to be a vector with three components a, b, and c:
<declare>
<ci>A</ci>
<vector>
<ci>a</ci>
<ci>b</ci>
<ci>c</ci>
</vector>
</declare>
Subsequent uses of A can then take into account that A is a vector. For example, if three identifiers, R, A, and B, are all declared to be vectors, an equation like the following could be interpreted as vector addition (by a particular MathML processor):
R = A + B
You can declare an identifier to be of a specified type without providing a complete description of it. For example, the declaration
<declare type="function">
<ci>F</ci>
</declare>
specifies that F is a function without indicating the exact meaning of the function or the number of arguments it takes.
<< back | next >> |
Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America