Overview: Mathematical Markup Language (MathML) Version 2.0
Previous: D Operator Dictionary (Non-normative)
Next: F Glossary (Non-normative)
E Document Object Model for MathML (Non-normative)
E.1 IDL Interfaces
E.1.1 Miscellaneous Object Definitions
E.1.2 Generic MathML Elements
E.1.3 Presentation Elements
E.1.4 Content Elements
The following sections describe the interfaces that have been defined in the Document Object Model for MathML. Please refer to Chapter 8 [Document Object Model for MathML] for more information.
Extends:
DOMImplementation
This interface extends the DOMImplementation
interface by adding a method to create a top level MathMLmathElement.
IDL Definition
interface MathMLDOMImplementation: DOMImplementation {
MathMLmathElement createMathMLmathElement(in Document hostDocument, in Node parent);
};
Methods
createMathMLmathElement
Creates a MathMLmathElement to correspond
to a MathML math element. The MathMLmathElement
is empty, having no child elements or non-default attributes.
Parameters
Document | hostDocument |
The Document object containing the
|
Node | parent |
The |
Return value
MathMLmathElement |
The newly created |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if a math
element is not allowed in either hostDocument or the parent
node.
Extends:
MathMLElement
This interface is provided as a specialization of the DocumentFragment interface. The
child Nodes of this MathMLElement must be
MathMLElements or Text nodes.
As with the DocumentFragment object, inserting a
MathMLDocumentFragment into a MathMLElement
which can accept children has the effect of inserting each of the top-level
child Nodes of the fragment rather than the fragment itself.
Note that MathMLDocumentFragments are frequently used in the
DOM as values of readonly attributes, encapsulating, for instance,
various collections of child elements. When used in this way, these objects
are always understood to be live, in the sense that they changes
to the document are immediately reflected in them.
IDL Definition
interface MathMLDocumentFragment: MathMLElement {
};
Extends:
Element
All MathML element interfaces derive from this object, which derives from the basic DOM interface Element.
Note:
At some point it is expected that CSS support for mathematics will be available. At that point, the
styleattribute of a MathML element should be accessed through the ElementCSSInlineStyle interface, which is defined in the CSS DOM specification.
IDL Definition
interface MathMLElement: Element {
attribute DOMString className;
attribute DOMString style;
attribute DOMString id;
};
Attributes
className of type
DOMString
The class attribute of the element. See
the discussion elsewhere in this document and the HTML definition of the
class attribute.
style of type
DOMString
A string identifying the element's style
attribute.
id of type
DOMString
The element's identifier. See the discussion elsewhere in this
document and the HTML definition of the id
attribute.
Extends:
MathMLElement
This interface represents the top-level MathML math
element. It may be useful for interfacing between the Document Object Model objects
encoding an enclosing document and the MathML DOM elements that are its children.
It may also be used for some purposes as a MathML DOM surrogate for a Document
object. For instance, MathML-specific factory methods could be placed here, as could
methods for creating MathML-specific Iterators or TreeWalkers.
IDL Definition
interface MathMLmathElement: MathMLElement {
readonly attribute MathMLDocumentFragment declarations;
attribute DOMString macros;
attribute DOMString display;
MathMLdeclareElement insertDeclaration(in MathMLdeclareElement newDeclaration, in unsigned long index);
MathMLdeclareElement setDeclaration(in MathMLdeclareElement newDeclaration, in unsigned long index);
MathMLdeclareElement removeDeclaration(in unsigned long index);
MathMLDocumentFragment createMathMLDocumentFragment();
MathMLElement createMathMLElement(in DOMString tagName);
};
Attributes
declarations of type
MathMLDocumentFragment, readonlyProvides access to the declare elements
which are children of this math element, in a
MathMLDocumentFragment. All Nodes of this fragment
must be MathMLdeclareElements.
macros of type
DOMString
Represents the macros
attribute of the math element. See
Section 7.1 [Embedding MathML in other Documents].
display of type
DOMString
Represents the display
attribute of the math element. This value is either
block or inline. See
Section 7.1 [Embedding MathML in other Documents].
Methods
insertDeclaration
This method inserts newDeclaration
before the current index-th child declare
element of this MathMLmathElement. If index is 0,
newDeclaration is appended as the last child
declare element.
Parameters
MathMLdeclareElement | newDeclaration |
A |
unsigned long | index |
A one-based index into the list of
child |
Return value
MathMLdeclareElement |
The |
This method raises no exceptions.
setDeclaration
This method inserts newDeclaration
as the index-th child declaration of this
MathMLmathElement. If there is already an index-th
declare child element, it is replaced by
newDeclaration.
Parameters
MathMLdeclareElement | newDeclaration |
A |
unsigned long | index |
A one-based index into the list of
child |
Return value
MathMLdeclareElement |
The |
This method raises no exceptions.
removeDeclaration
This method removes the MathMLdeclareElement representing
the index-th declare child element of
this math element, and returns it to the caller. Note that index
is the position in the list of declare element children,
as opposed to the position in the list of all child Nodes.
Parameters
unsigned long | index |
The one-based index of the |
Return value
MathMLdeclareElement |
The |
This method raises no exceptions.
createMathMLDocumentFragment
Creates a new empty MathMLDocumentFragment element.
Return value
MathMLDocumentFragment |
The |
This method raises no exceptions.
createMathMLElement
This method creates a MathMLElement
to represent a MathML element of type tagName. The returned
MathMLElement should be of the correct derived type to represent
the element.
In addition, if there are known attributes with default values, Attr
nodes representing them are automatically created and attached to the
element. MathMLElements representing required child elements are
created as empty elements.
Parameters
DOMString | tagName |
The case-sensitive name of the element type to instantiate. |
Return value
MathMLElement |
The |
Exceptions
INVALID_CHARACTER_ERR
Raised if the specified name contains an illegal character.
Extends:
MathMLElement
This interface represents the semantics
element in MathML.
IDL Definition
interface MathMLSemanticsElement: MathMLElement {
attribute MathMLElement body;
MathMLElement getAnnotation(in unsigned long index);
MathMLElement insertAnnotation(in MathMLElement newAnnotation, in unsigned long index);
MathMLElement setAnnotation(in MathMLElement newAnnotation, in unsigned long index);
};
Attributes
body of type
MathMLElement
This attribute represents the first child of the semantics element, i.e. the child giving the
`primary' content represented by the element.
Methods
getAnnotation
This method gives access to the index-th
`alternate' content associated with a
semantics element.
Parameters
unsigned long | index |
The one-based index of the annotation being retrieved. |
Return value
MathMLElement |
The |
This method raises no exceptions.
insertAnnotation
This method inserts newAnnotation before
the current index-th `alternate' content associated
with a semantics element. If index is 0,
newAnnotation is appended as the last annotation or xml-annotation child of this element.
Parameters
MathMLElement | newAnnotation |
A |
unsigned long | index |
The position in the list of |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newAnnotation is not a
MathMLAnnotationElement or MathMLXMLAnnotationElement.
INDEX_SIZE_ERR
Raised if index is greater
than the current number of annotation or
xml-annotation children of this
semantics element.
setAnnotation
This method allows setting or replacement of the
index-th `alternate' content associated with a
semantics element. If there is already an
annotation or xml-annotation
element with this index, it is replaced by newAnnotation.
Parameters
MathMLElement | newAnnotation |
A |
unsigned long | index |
The position in the list of
|
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newAnnotation is not a
MathMLAnnotationElement or MathMLXMLAnnotationElement.
INDEX_SIZE_ERR
Raised if index is greater
than one more than the current number of annotation
or xml-annotation children of this
semantics element.
Extends:
MathMLElement
This interface represents the annotation
element of MathML.
IDL Definition
interface MathMLAnnotationElement: MathMLElement {
attribute DOMString body;
attribute DOMString encoding;
};
Attributes
body of type
DOMString
Provides access to the content of an annotation
element.
encoding of type
DOMString
Provides access to the encoding
attribute of an annotation element.
Extends:
MathMLElement
This interface represents the
xml-annotation element of MathML.
IDL Definition
interface MathMLXMLAnnotationElement: MathMLElement {
readonly attribute NodeList contents;
attribute DOMString encoding;
};
Attributes
contents of type
NodeList, readonlyProvides access to the content of an annotation
element, represented by XML DOM Nodes.
encoding of type
DOMString
Provides access to the encoding
attriubte of an annotation element.
Extends:
MathMLElement
This interface is provided to serve as a base interface for various MathML Presentation interfaces. It contains no new attributes or methods at this time; however, it is felt that the distinction between Presentation and Content MathML entities should be indicated in the MathMLElement heirarchy. In particular, future versions of the MathML DOM may add functionality on this interface; it may also serve as an aid to implementors.
IDL Definition
interface MathMLPresentationElement: MathMLElement {
};
Extends:
MathMLPresentationElement
This interface supports the mchar element
Section 3.2.8 [Referring to non-ASCII characters
(mchar)].
IDL Definition
interface MathMLCharacterElement: MathMLPresentationElement {
attribute DOMString name;
};
Attributes
name of type
DOMString
The name of a non-ASCII character, taken from Chapter 6 [Characters, Entities and Fonts].
Extends:
MathMLPresentationElement
This interface supports the mglyph element
Section 3.2.9 [Adding new character glyphs to MathML
(mglyph)].
IDL Definition
interface MathMLGlyphElement: MathMLPresentationElement {
attribute DOMString alt;
attribute DOMString fontfamily;
attribute unsigned long index;
};
Attributes
alt of type
DOMString
A string giving an alternate name for the character. Represents
the mglyph's alt
attribute.
fontfamily of type
DOMString
A string representing the font family.
index of type
unsigned long
An unsigned integer giving the glyph's position within the font.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement
interface for the MathML space element mspace.
Note that this is not derived from MathMLPresentationToken,
despite the fact that mspace is classified as a token element,
since it does not carry the attributes declared for
MathMLPresentationToken.
IDL Definition
interface MathMLSpaceElement: MathMLPresentationElement {
attribute DOMString width;
attribute DOMString height;
attribute DOMString depth;
};
Attributes
width of type
DOMString
A string of the form `number
h-unit'; represents the width
attribute for the mspace element, if specified.
height of type
DOMString
A string of the form `number
v-unit'; represents the height
attribute for the mspace element, if specified.
depth of type
DOMString
A string of the form `number
v-unit'; represents the depth
attribute for the mspace element, if specified.
Interfaces representing the MathML Presentation token elements that may have content are described here.
Extends:
MathMLPresentationElement
This interface extends the MathMLElement interface to
include access for attributes specific to text presentation. It serves as
the base class for all MathML presentation token elements. Access to the
body of the element is via the nodeValue attribute
inherited from Node. Elements that expose only the core presentation
token attributes are directly supported by this object. These elements are:
mi
mn
mtext
IDL Definition
interface MathMLPresentationToken: MathMLPresentationElement {
attribute DOMString fontsize;
attribute DOMString fontweight;
attribute DOMString fontstyle;
attribute DOMString fontfamily;
attribute DOMString color;
readonly attribute MathMLDocumentFragment contents;
};
Attributes
fontsize of type
DOMString
The font size attribute for the element, if specified.
fontweight of type
DOMString
The font weight attribute for the element, if specified.
fontstyle of type
DOMString
The font style attribute for the element, if specified.
fontfamily of type
DOMString
The font family attribute for the element, if specified.
color of type
DOMString
The color attribute for the element, if specified.
contents of type
MathMLDocumentFragment, readonlyReturns the child Nodes of the
element. These should consist only of Text nodes and possibly
MathMLGlyphElements or MathMLCharacterElements. Should
behave the same as the base class's Node::children attribute;
however, it is provided here for clarity.
Extends:
MathMLPresentationToken
This interface extends the MathMLPresentationToken
interface for the MathML operator element mo.
IDL Definition
interface MathMLOperatorElement: MathMLPresentationToken {
attribute DOMString form;
attribute DOMString fence;
attribute DOMString separator;
attribute DOMString lspace;
attribute DOMString rspace;
attribute DOMString stretchy;
attribute DOMString symmetric;
attribute DOMString maxsize;
attribute DOMString minsize;
attribute DOMString largeop;
attribute DOMString moveablelimits;
attribute DOMString accent;
};
Attributes
form of type
DOMString
The form attribute (prefix,
infix or postfix) for the
mo element, if specified.
fence of type
DOMString
The fence attribute
(true or false)
for the mo element, if specified.
separator of type
DOMString
The separator attribute
(true or false) for the
mo element, if specified.
lspace of type
DOMString
The lspace attribute (spacing to left) of
the mo element, if specified.
rspace of type
DOMString
The rspace attribute (spacing to right) of the
mo element, if specified.
stretchy of type
DOMString
The stretchy attribute
(true or false) for the
mo element, if specified.
symmetric of type
DOMString
The symmetric attribute
(true or false) for the
mo element, if specified.
maxsize of type
DOMString
The maxsize attribute for the
mo element, if specified.
minsize of type
DOMString
The minsize attribute for the
mo element, if specified.
largeop of type
DOMString
The largeop attribute for the
mo element, if specified.
moveablelimits of type
DOMString
The moveablelimits
(true or false) attribute for the
mo element, if specified.
accent of type
DOMString
The accent attribute
(true or false) for the
mo element, if specified.
Extends:
MathMLPresentationToken
This interface extends the MathMLPresentationToken
interface for the MathML string literal element
ms.
IDL Definition
interface MathMLStringLitElement: MathMLPresentationToken {
attribute DOMString lquote;
attribute DOMString rquote;
};
Attributes
lquote of type
DOMString
A string giving the opening delimiter for the string literal;
represents the lquote attribute for the
ms element, if specified.
rquote of type
DOMString
A string giving the closing delimiter for the string literal;
represents the rquote attribute for the
ms element, if specified.
We include under the heading of Presentation Container Elements interfaces
designed to represent MathML Presentation elements that can contain arbitrary
numbers of child MathMLElements.
Extends:
MathMLPresentationElement
This interface represents MathML Presentation elements that may contain arbitarily many child elements.
IDL Definition
interface MathMLPresentationContainer: MathMLPresentationElement {
readonly attribute MathMLDocumentFragment arguments;
MathMLElement getArgument(in unsigned long index);
MathMLElement insertArgument(in MathMLElement newArgument, in unsigned long index);
MathMLElement setArgument(in MathMLElement newArgument, in unsigned long index);
void deleteArgument(in unsigned long index);
MathMLElement removeArgument(in unsigned long index);
};
Attributes
arguments of type
MathMLDocumentFragment, readonlyThis attribute accesses the child MathMLElements of
this element, as a MathMLDocumentFragment.
Methods
getArgument
This method returns the index-th child
element of this element.
Parameters
unsigned long | index |
The one-based index of the argument to be retrieved. |
Return value
MathMLElement |
A |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of child elements.
insertArgument
This method inserts newArgument before
the current index-th child argument of this element. If index
is 0, newArgument is appended as the last argument.
Parameters
MathMLElement | newArgument |
A |
unsigned long | index |
The index of the position in the list
of arguments before which |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newArgument represents
an element that cannot be an argument of this element.
INDEX_SIZE_ERR
Raised if index is greater
than the number of child arguments.
setArgument
This method sets newArgument as the
index-th child element of this element. If there is already an
element at position index, it is replaced by newArgument.
Parameters
MathMLElement | newArgument |
A |
unsigned long | index |
The index of the argument that is to
be set to |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newArgument represents
an element that cannot be an argument of this element.
INDEX_SIZE_ERR
Raised if index is greater
than one more than the number of child elements.
deleteArgument
This method deletes the index-th child
MathMLElement of this element.
Parameters
unsigned long | index |
The one-based index of the argument to be deleted. |
Return value
void |
None. |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of child elements.
removeArgument
This method removes the indexth
child element of this element and returns it to the caller.
Parameters
unsigned long | index |
The one-based index of the argument to be removed. |
Return value
MathMLElement |
A |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of child elements.
Extends:
MathMLPresentationContainer
This interface extends the MathMLElement interface for
the MathML style element mstyle.
While the mstyle element may contain any
attributes allowable on any MathML presentation element, only
attributes specific to the mstyle
element are included in the interface below. Other attributes should be
accessed using the methods on the base Element class, particularly
the Element::getAttribute and Element::setAttribute
methods, or even the Node::attributes attribute to access all of
them at once. Not only does this obviate a lengthy list below, but it seems
likely that most implementations will find this a considerably more useful
interface to a MathMLStyleElement.
IDL Definition
interface MathMLStyleElement: MathMLPresentationContainer {
attribute DOMString scriptlevel;
attribute DOMString displaystyle;
attribute DOMString scriptsizemultiplier;
attribute DOMString scriptminsize;
attribute DOMString color;
attribute DOMString background;
};
Attributes
scriptlevel of type
DOMString
A string of the form `+/- unsigned
integer'; represents the scriptlevel
attribute for the mstyle element, if specified. See
also the discussion of this attribute.
displaystyle of type
DOMString
Either true or false;
a string representing the displaystyle attribute for the
mstyle element, if specified. See also the discussion
of this attribute.
scriptsizemultiplier of type
DOMString
A string of the form `number';
represents the scriptsizemultiplier attribute for the
mstyle element, if specified. See also the discussion
of this attribute.
scriptminsize of type
DOMString
A string of the form `number
v-unit'; represents the
scriptminsize attribute for the
mstyle element, if specified. See also the discussion
of this attribute.
color of type
DOMString
A string representation of a color; represents the
color attribute for the mstyle
element, if specified. See also the discussion of this attribute.
background of type
DOMString
A string representation of a color or the string
transparent; represents the
background attribute for the
mstyle element, if specified. See also the discussion
of this attribute.
Extends:
MathMLPresentationContainer
This interface extends the MathMLElement interface for
the MathML spacing adjustment element
mpadded.
IDL Definition
interface MathMLPaddedElement: MathMLPresentationContainer {
attribute DOMString width;
attribute DOMString lspace;
attribute DOMString height;
attribute DOMString depth;
};
Attributes
width of type
DOMString
A string representing the total width of the
mpadded element, if specified. See also the discussion
of this attribute.
lspace of type
DOMString
A string representing the lspace attribute -
the additional space to the left - of the mpadded
element, if specified. See also the discussion of this
attribute.
height of type
DOMString
A string representing the height above the
baseline of the mpadded element, if specified. See
also the discussion of this attribute.
depth of type
DOMString
A string representing the depth beneath the
baseline of the mpadded element, if specified. See
also the discussion of this attribute.
Extends:
MathMLPresentationContainer
This interface extends the
MathMLPresentationContainer interface for the MathML
fenced content element mfenced.
IDL Definition
interface MathMLFencedElement: MathMLPresentationContainer {
attribute DOMString open;
attribute DOMString close;
attribute DOMString separators;
};
Attributes
open of type
DOMString
A string representing the opening-fence for the
mfenced element, if specified; this is the element's
open attribute.
close of type
DOMString
A string representing the opening-fence for the
mfenced element, if specified; this is the element's
close attribute.
separators of type
DOMString
A string representing any separating characters inside the
mfenced element, if specified; this is the element's
separators attribute.
Extends:
MathMLPresentationContainer
This interface supports the menclose
element Section 3.3.9 [Enclose Content Inside Notation
(menclose)].
IDL Definition
interface MathMLEncloseElement: MathMLPresentationContainer {
attribute DOMString notation;
};
Attributes
notation of type
DOMString
A string giving a name for the notation enclosing
the element's contents. Represents the notation attribute
of the menclose. Allowed values are
longdiv,
actuarial,
radical.
Extends:
MathMLPresentationContainer
This interface extends the
MathMLPresentationContainer interface for the MathML
enlivening expression element maction.
IDL Definition
interface MathMLActionElement: MathMLPresentationContainer {
attribute DOMString actiontype;
attribute DOMString selection;
};
Attributes
actiontype of type
DOMString
A string specifying the action. Possible values include
toggle,
statusline,
tooltip,
highlight, and
menu.
selection of type
DOMString
A string specifying an integer that selects the current subject of the action.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML fraction element mfrac.
IDL Definition
interface MathMLFractionElement: MathMLPresentationElement {
attribute DOMString linethickness;
attribute MathMLElement numerator;
attribute MathMLElement denominator;
};
Attributes
linethickness of type
DOMString
A string representing the linethickness
attribute of the mfrac, if specified.
numerator of type
MathMLElement
The first child MathMLElement of the
MathMLFractionElement; represents the numerator of the represented
fraction.
denominator of type
MathMLElement
The second child MathMLElement of the
MathMLFractionElement; represents the denominator of the
represented fraction.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML radical and square root elements
mroot and msqrt.
IDL Definition
interface MathMLRadicalElement: MathMLPresentationElement {
attribute MathMLElement radicand;
attribute MathMLElement index;
};
Attributes
radicand of type
MathMLElement
The first child MathMLElement of the
MathMLRadicalElement; represents the base of the
represented radical.
index of type
MathMLElement
The second child MathMLElement of the
MathMLRadicalElement; represents the index of the
represented radical. This must be null for
msqrt elements.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML subscript, superscript and
subscript-superscript pair elements
msub, msup, and
msubsup.
IDL Definition
interface MathMLScriptElement: MathMLPresentationElement {
attribute DOMString subscriptshift;
attribute DOMString superscriptshift;
attribute MathMLElement base;
attribute MathMLElement subscript;
attribute MathMLElement superscript;
};
Attributes
subscriptshift of type
DOMString
A string representing the minimum amount to shift the baseline of
the subscript down, if specified; this is the element's
subscriptshift attribute. This must return null
for an msup.
superscriptshift of type
DOMString
A string representing the minimum amount to shift the baseline of
the superscript up, if specified; this is the element's
superscriptshift attribute. This must return
null for a msub.
base of type
MathMLElement
A MathMLElement representing the base of
the script. This is the first child of the element.
subscript of type
MathMLElement
A MathMLElement representing the subscript
of the script. This is the second child of a msub
or msubsup; retrieval must return null
for an msup.
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised when the element is
a msup.
superscript of type
MathMLElement
A MathMLElement representing the
superscript of the script. This is the second child of a
msup or the third child of a
msubsup; retrieval must return null for an
msub.
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised when the element is
a msub.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML underscript, overscript and
overscript-underscript pair elements
munder, mover and
munderover.
IDL Definition
interface MathMLUnderOverElement: MathMLPresentationElement {
attribute DOMString accentunder;
attribute DOMString accent;
attribute MathMLElement base;
attribute MathMLElement underscript;
attribute MathMLElement overscript;
};
Attributes
accentunder of type
DOMString
Either true or false if
present; a string controlling whether underscript is drawn as an
`accent' or as a `limit', if specified; this is the
element's accentunder attribute. This must return
null for an mover.
accent of type
DOMString
Either true or false if
present; a string controlling whether overscript is drawn as an
`accent' or as a `limit', if specified; this is the
element's accent attribute. This must return
null for an munder.
base of type
MathMLElement
A MathMLElement representing the base of
the script. This is the first child of the element.
underscript of type
MathMLElement
A MathMLElement representing the
underscript of the script. This is the second child of a
munder or munderover;
retrieval must return null for an mover.
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised when the element is a
mover.
overscript of type
MathMLElement
A MathMLElement representing the
overscript of the script. This is the second child of a
mover or the third child of a
munderover; retrieval must return null for an
munder.
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised when the element is a
munder.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML multiscripts (including prescripts or
tensors) element mmultiscripts.
IDL Definition
interface MathMLMultiScriptsElement: MathMLPresentationElement {
attribute DOMString subscriptshift;
attribute DOMString superscriptshift;
attribute MathMLElement base;
readonly attribute MathMLDocumentFragment prescripts;
readonly attribute MathMLDocumentFragment scripts;
readonly attribute unsigned long numprescriptcolumns;
readonly attribute unsigned long numscriptcolumns;
MathMLElement getPreSubScript(in unsigned long colIndex);
MathMLElement getSubScript(in unsigned long colIndex);
MathMLElement getPreSuperScript(in unsigned long colIndex);
MathMLElement getSuperScript(in unsigned long colIndex);
MathMLElement insertPreSubScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement setPreSubScriptAt(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement insertSubScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement setSubScriptAt(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement insertPreSuperScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement setPreSuperScriptAt(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement insertSuperScriptBefore(in unsigned long colIndex, in MathMLElement newScript);
MathMLElement setSuperScriptAt(in unsigned long colIndex, in MathMLElement newScript);
};
Attributes
subscriptshift of type
DOMString
A string representing the minimum amount to shift the baseline of
the subscripts down, if specified; this is the element's
subscriptshift attribute.
superscriptshift of type
DOMString
A string representing the minimum amount to shift the baseline of
the superscripts up, if specified; this is the element's
superscriptshift attribute.
base of type
MathMLElement
A MathMLElement representing the base of
the script. This is the first child of the element.
prescripts of type
MathMLDocumentFragment, readonlyA NodeList representing the prescripts of
the script, which appear in the order described by the expression
(prescript presuperscript)*. This is the same as traversing
the contents of the NodeList returned by
Node::childNodes() from the Node following the
<mprescripts/> (if present) to the end of the
list.
scripts of type
MathMLDocumentFragment, readonlyA MathMLDocumentFragment representing the scripts of the
script, which appear in the order described by the expression (script
superscript)*. This is the same as traversing the contents of the
NodeList returned by Node::childNodes() from the first
Node up to and including the Node preceding the
<mprescripts/> (if present).
numprescriptcolumns of type
unsigned long, readonlyThe number of script/subscript columns preceding (to the left of)
the base. Should always be half of
getprescripts().length()
numscriptcolumns of type
unsigned long, readonlyThe number of script/subscript columns following (to the right
of) the base. Should always be half of
getscripts().length()
Methods
getPreSubScript
A convenience method to retrieve pre-subscript children of the element, referenced by column index .
Parameters
unsigned long | colIndex |
Column index of prescript (where 1 represents the leftmost prescript column). |
Return value
MathMLElement |
Returns the |
This method raises no exceptions.
getSubScript
A convenience method to retrieve subscript children of the element, referenced by column index.
Parameters
unsigned long | colIndex |
Column index of script (where 1 represents the leftmost script column, the first to the right of the base). |
Return value
MathMLElement |
Returns the |
This method raises no exceptions.
getPreSuperScript
A convenience method to retrieve pre-superscript children of the element, referenced by column index .
Parameters
unsigned long | colIndex |
Column index of pre-superscript (where 1 represents the leftmost prescript column). |
Return value
MathMLElement |
Returns the |
This method raises no exceptions.
getSuperScript
A convenience method to retrieve superscript children of the element, referenced by column index .
Parameters
unsigned long | colIndex |
Column index of script (where 1 represents the leftmost script column, the first to the right of the base) |
Return value
MathMLElement |
Returns the |
This method raises no exceptions.
insertPreSubScriptBefore
A convenience method to insert a pre-subscript before the position referenced by column index. If
colIndex is 0, the new pre-subscript is appended
as the last pre-subscript of the
mmultiscripts element; if colIndex is 1, a new pre-subscript is prepended at the far left. Note that inserting a
new pre-subscript will cause the insertion of an empty
pre-superscript in the same column.
Parameters
unsigned long | colIndex |
Column index of pre-subscript (where 1 represents the leftmost prescript column). |
MathMLElement | newScript |
A |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a pre-subscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than the number of pre-scripts of the element.
setPreSubScriptAt
A convenience method to set the pre-subscript child at the position referenced by colIndex.
If there is currently a pre-subscript at this position, it is
replaced by newScript.
Parameters
unsigned long | colIndex |
Column index of pre-subscript (where 1 represents the leftmost prescript column). |
MathMLElement | newScript |
|
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a pre-subscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than one more than the number of pre-scripts of the element.
insertSubScriptBefore
A convenience method to insert a subscript before the position referenced by column index. If
colIndex is 0, the new subscript is appended
as the last subscript of the mmultiscripts element; if colIndex is 1, a new subscript is prepended
at the far left. Note that inserting a new subscript will
cause the insertion of an empty superscript in the same column.
Parameters
unsigned long | colIndex |
Column index of subscript, where 1 represents the leftmost script column (the first to the right of the base). |
MathMLElement | newScript |
A |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a subscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than the number of scripts of the element.
setSubScriptAt
A convenience method to set the subscript child at the position referenced by colIndex.
If there is currently a subscript at this position, it is
replaced by newScript.
Parameters
unsigned long | colIndex |
Column index of subscript, where 1 represents the leftmost script column (the first to the right of the base). |
MathMLElement | newScript |
|
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a subscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than one more than the number of scripts of the element.
insertPreSuperScriptBefore
A convenience method to insert a pre-superscript before the position referenced by column index. If
colIndex is 0, the new pre-superscript is appended
as the last pre-superscript of the
mmultiscripts element; if colIndex is 1, a new pre-superscript is prepended at the far left. Note that inserting a
new pre-superscript will cause the insertion of an empty
pre-subscript in the same column.
Parameters
unsigned long | colIndex |
Column index of pre-superscript (where 1 represents the leftmost prescript column). |
MathMLElement | newScript |
A |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a pre-superscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than the number of pre-scripts of the element.
setPreSuperScriptAt
A convenience method to set the pre-superscript child at the position referenced by colIndex.
If there is currently a pre-superscript at this position, it is
replaced by newScript.
Parameters
unsigned long | colIndex |
Column index of pre-superscript (where 1 represents the leftmost prescript column). |
MathMLElement | newScript |
|
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a pre-superscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than one more than the number of pre-scripts of the element.
insertSuperScriptBefore
A convenience method to insert a superscript before the position referenced by column index. If
colIndex is 0, the new superscript is appended
as the last superscript of the mmultiscripts element; if colIndex is 1, a new superscript is prepended
at the far left. Note that inserting a new superscript will
cause the insertion of an empty subscript in the same column.
Parameters
unsigned long | colIndex |
Column index of superscript, where 1 represents the leftmost script column (the first to the right of the base). |
MathMLElement | newScript |
A |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a superscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than the number of scripts of the element.
setSuperScriptAt
A convenience method to set the superscript child at the position referenced by colIndex.
If there is currently a superscript at this position, it is
replaced by newScript.
Parameters
unsigned long | colIndex |
Column index of superscript, where 1 represents the leftmost script column (the first to the right of the base). |
MathMLElement | newScript |
|
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newScript represents
an element that cannot be a superscript.
INDEX_SIZE_ERR
Raised if colIndex is greater
than one more than the number of scripts of the element.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement
interface for the MathML table
or matrix element mtable.
IDL Definition
interface MathMLTableElement: MathMLPresentationElement {
attribute DOMString align;
attribute DOMString rowalign;
attribute DOMString columnalign;
attribute DOMString groupalign;
attribute DOMString alignmentscope;
attribute DOMString columnwidth;
attribute DOMString width;
attribute DOMString rowspacing;
attribute DOMString columnspacing;
attribute DOMString rowlines;
attribute DOMString columnlines;
attribute DOMString frame;
attribute DOMString framespacing;
attribute DOMString equalrows;
attribute DOMString equalcolumns;
attribute DOMString displaystyle;
attribute DOMString side;
attribute DOMString minlabelspacing;
readonly attribute MathMLDocumentFragment rows;
MathMLTableRowElement insertEmptyRow(in long index);
MathMLLabeledRowElement insertEmptyLabeledRow(in long index);
MathMLTableRowElement getRow(in unsigned long index);
MathMLTableRowElement insertRow(in long index, in MathMLTableRowElement newRow);
MathMLTableRowElement setRow(in long index, in MathMLTableRowElement newRow);
void deleteRow(in unsigned long index);
MathMLTableRowElement removeRow(in long index);
};
Attributes
align of type
DOMString
A string representing the vertical alignment of the table with
the adjacent text. Allowed values are
(top |
bottom |
center |
baseline |
axis)[rownumber],
where rownumber is between 1 and n (for a table with
n rows) or -1 and -n.
rowalign of type
DOMString
A string representing the alignment of entries in each
row, consisting of a space-separated sequence of alignment
specifiers, each of which can have the following values:
top,
bottom,
center,
baseline, or
axis.
columnalign of type
DOMString
A string representing the alignment of entries in each
column, consisting of a space-separated sequence of alignment
specifiers, each of which can have the following values:
left,
center, or
right.
groupalign of type
DOMString
A string specifying how the alignment groups within the cells
of each row are to be aligned with the corresponding items above or below them
in the same column. The string consists of a sequence of braced group
alignment lists. Each group alignment list is a space-separated
sequence, each of which can have the following values:
left,
right,
center, or
decimalpoint.
alignmentscope of type
DOMString
A string consisting of the values true or
false indicating, for each column, whether it can be
used as an alignment scope.
columnwidth of type
DOMString
A string consisting of a space-separated sequence of
specifiers, each of which can have one of the following forms:
auto,
number h-unit,
namedspace, or
fit. (A value of the form namedspace is one
of veryverythinmathspace, verythinmathspace,
thinmathspace, mediummathspace,
thickmathspace, verythickmathspace, or
veryverythickmathspace. This represents the element's
columnwidth attribute.
width of type
DOMString
A string that is either of the form
number h-unit or is the string auto.
This represents the element's width attribute.
rowspacing of type
DOMString
A string consisting of a space-separated sequence of
specifiers of the form number v-unit
representing the space to be added between rows.
columnspacing of type
DOMString
A string consisting of a space-separated sequence of
specifiers of the form number h-unit
representing the space to be added between columns.
rowlines of type
DOMString
A string specifying whether and what kind of lines should be
added between each row. The string consists of a
space-separated sequence of specifiers, each of which
can have the following values:
none,
solid, or
dashed.
columnlines of type
DOMString
A string specifying whether and what kind of lines should be
added between each column. The string consists of a
space-separated sequence of specifiers, each of which
can have the following values:
none,
solid, or
dashed.
frame of type
DOMString
A string specifying a frame around the table. Allowed
values are (none | solid | dashed).
framespacing of type
DOMString
A string of the form number h-unit number v-unit specifying the spacing between table and its frame.
equalrows of type
DOMString
A string with the values true or
false.
equalcolumns of type
DOMString
A string with the values true or
false.
displaystyle of type
DOMString
A string with the values true or
false.
side of type
DOMString
A string with the values left,
right, leftoverlap, or
rightoverlap.
minlabelspacing of type
DOMString
A string of the form number h-unit, specifying
the minimum space between a label and the adjacent entry in the labeled row.
rows of type
MathMLDocumentFragment, readonlyA MathMLDocumentFragment consisting
of MathMLTableRowElements and MathMLLabeledRowElements
representing the rows of the table. This is a live object.
Methods
insertEmptyRow
A convenience method to insert a new (empty)
row (mtr) in the table before the current indexth row. If index is less than 0, the new row is inserted
before the -indexth row counting up from the current last row; if
index is equal to the current number of rows, the new row is
appended as the last row.
Parameters
long | index |
Position before which to insert the new row, where 0 represents the first row. Negative numbers are used to count backwards from the last row. |
Return value
MathMLTableRowElement |
Returns the |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the current number of rows of this mtable
element or less than minus this number.
insertEmptyLabeledRow
A convenience method to insert a new (empty)
labeled row (mlabeledtr) in the table before the
current indexth row. If index is less than 0, the new row
is inserted before the -indexth row counting up from the current
last row; if index is equal to the current number of rows, the new
row is appended as the last row.
Parameters
long | index |
Position before which to insert the new row, where 0 represents the first row. Negative numbers are used to count backwards from the last row. |
Return value
MathMLLabeledRowElement |
Returns the |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the current number of rows of this mtable
element or less than minus this number.
getRow
A convenience method to retrieve the indexth row
from the table. If index is less than 0, the -indexth row
from the bottom of the table is retrieved. (So, for instance, if index is -2, the next-to-last row is retrieved.) If index is not
a valid value (i.e. is greater than or equal to the number of rows, or is
less than minus the number of rows), a null MathMLTableRowElement is
returned.
Parameters
unsigned long | index |
Index of the row to be returned, where 0 represents the first row. Negative numbers are used to count backwards from the last row. |
Return value
MathMLTableRowElement |
Returns the |
This method raises no exceptions.
insertRow
A convenience method to insert the new row or
labeled row (mtr or mlabeledtr) represented by newRow in the table before the current indexth row. If index is equal to the current number of rows,
newRow is appended as the last row in the table. If index
is less than 0, the new row is inserted before the -indexth row
from the bottom of the table. (So, for instance, if index is -2,
the new row is inserted before the next-to-last current row.)
Parameters
long | index |
Index before which to insert |
MathMLTableRowElement | newRow |
A |
Return value
MathMLTableRowElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newRow is not a
MathMLTableRowElement or MathMLLabeledRowElement.
INDEX_SIZE_ERR
Raised if index is greater
than the current number of rows or less than minus the current number of
rows of this mtable element.
setRow
A method to set the value of the row in the
table at the specified index to the mtr or
mlabeledtr represented by newRow. If index is less than 0, the -indexth row counting up from the
last is replaced by newRow; if index is one more than the
current number of rows, the new row is appended as the last row in the
table.
Parameters
long | index |
Index of the row to be set to |
MathMLTableRowElement | newRow |
A |
Return value
MathMLTableRowElement |
Returns the |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if newRow is not a
MathMLTableRowElement or MathMLLabeledRowElement.
INDEX_SIZE_ERR
Raised if index is greater
than the current number of rows of this mtable
element or less than minus this number.
deleteRow
A convenience method to delete the row of the
table at the specified index. If index is less than 0, the -indexth row from the bottom of the table is deleted. (So, for
instance, if index is -2, the next-to-last row is deleted.)
Parameters
unsigned long | index |
Index of row to be deleted, where 0 represents the first row. |
Return value
void |
None. |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than or equal to the current number of rows of this
mtable element or less than minus this number.
removeRow
A convenience method to delete the row of the
table at the specified index and return it to the caller. If index
is less than 0, the -indexth row from the bottom of the table is
deleted. (So, for instance, if index is -2, the next-to-last
row is deleted.)
Parameters
long | index |
Index of row to be removed, where 0 represents the first row. |
Return value
MathMLTableRowElement |
A |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than or equal to the number of rows of this mtable
element or less than minus this number.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement
interface for the MathML table or matrix row element mtr.
IDL Definition
interface MathMLTableRowElement: MathMLPresentationElement {
attribute DOMString rowalign;
attribute DOMString columnalign;
attribute DOMString groupalign;
readonly attribute MathMLDocumentFragment cells;
MathMLTableCellElement insertEmptyCell(in unsigned long index);
MathMLTableCellElement insertCell(in MathMLTableCellElement newCell, in unsigned long index);
MathMLTableCellElement setCell(in MathMLTableCellElement newCell, in unsigned long index);
void deleteCell(in unsigned long index);
};
Attributes
rowalign of type
DOMString
A string representing an override of the row alignment specified in
the containing mtable. Allowed values are
top,
bottom,
center,
baseline, and
axis.
columnalign of type
DOMString
A string representing an override of the column alignment specified in
the containing mtable. Allowed values are
left,
center, and
right.
groupalign of type
DOMString
[To be changed?]
cells of type
MathMLDocumentFragment, readonlyA MathMLDocumentFragment consisting of the cells of the
row. Note that this does not include the label if this is a
MathMLLabeledRowElement!
Methods
insertEmptyCell
A convenience method to insert a new (empty) cell in the row.
Parameters
unsigned long | index |
Index of the cell before which the new
cell is to be inserted, where the first cell is numbered 0. If |
Return value
MathMLTableCellElement |
Returns the |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the current number of cells of this mtr
element.
insertCell
A convenience method to insert a new cell in the row.
Parameters
MathMLTableCellElement | newCell |
A |
unsigned long | index |
Index of the cell before which the new
cell is to be inserted, where the first cell is numbered 0. If |
Return value
MathMLTableCellElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the current number of cells of this mtr
element.
setCell
A convenience method to set the value of a cell
in the row to newCell. If index is equal to the current number
of cells, newCell is appended as the last cell in the row.
Parameters
MathMLTableCellElement | newCell |
A |
unsigned long | index |
Index of the cell that is to be
replaced by the new cell, where the first cell is numbered 0. Note
that the index will differ from the index of the corresponding |
Return value
MathMLTableCellElement |
The |
This method raises no exceptions.
deleteCell
A convenience method to delete a cell in the row.
Parameters
unsigned long | index |
Index of cell to be deleted. Note that the
count will differ from the |
Return value
void |
None. |
This method raises no exceptions.
Extends:
MathMLTableRowElement
This interface extends the MathMLTableRowElement
interface to represent the mlabeledtr element
Section 3.5.3 [Labeled Row in Table or Matrix
(mlabeledtr)]. Note that the presence of a label
causes the indexth child node to differ from the indexth
cell!
IDL Definition
interface MathMLLabeledRowElement: MathMLTableRowElement {
attribute MathMLElement label;
};
Attributes
label of type
MathMLElement
A MathMLElement representing the
label of this row. Note that retrieving this should have the same effect as
a call to Node::getfirstChild(), while setting it should have the same effect
as Node::replaceChild(Node::getfirstChild()).
Exceptions on Setting
NO_MODIFICATION_ALLOWED_ERR
Raised if this MathMLElement or the
new MathMLElement is read-only.
Extends:
MathMLPresentationContainer
This interface extends the MathMLPresentationContainer
interface for the MathML table or matrix cell element mtd.
IDL Definition
interface MathMLTableCellElement: MathMLPresentationContainer {
attribute DOMString rowspan;
attribute DOMString columnspan;
attribute DOMString rowalign;
attribute DOMString columnalign;
attribute DOMString groupalign;
readonly attribute boolean hasaligngroups;
readonly attribute DOMString cellindex;
};
Attributes
rowspan of type
DOMString
A string representing a positive integer that specifies the number of rows spanned by this cell. The default is 1.
columnspan of type
DOMString
A string representing a positive integer that specifies the number of columns spanned by this cell. The default is 1.
rowalign of type
DOMString
A string specifying an override of the inherited vertical
alignment of this cell within the table row. Allowed values are
top,
bottom,
center,
baseline, and
axis.
columnalign of type
DOMString
A string specifying an override of the inherited horizontal
alignment of this cell within the table column. Allowed values are
left,
center, and
right.
groupalign of type
DOMString
A string specifying how the alignment groups within the cell are
to be aligned with those in cells above or below this cell. The string
consists of a space-separated sequence of specifiers, each of which
can have the following values:
left,
right,
center, or
decimalpoint.
hasaligngroups of type
boolean, readonlyA string with the values true or
false indicating whether the cell contains align groups.
cellindex of type
DOMString, readonlyA string representing the integer index (1-based?) of the cell in its containing row. [What about spanning cells? How do these affect this value?]
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML group -alignment element <maligngroup/>.
IDL Definition
interface MathMLAlignGroupElement: MathMLPresentationElement {
attribute DOMString groupalign;
};
Attributes
groupalign of type
DOMString
A string specifying how the alignment group is to be aligned with
other alignment groups above or below it. Allowed values are
left,
right,
center, or
decimalpoint.
Extends:
MathMLPresentationElement
This interface extends the MathMLPresentationElement interface for
the MathML alignment mark element
<malignmark/>.
IDL Definition
interface MathMLAlignMarkElement: MathMLPresentationElement {
attribute DOMString edge;
};
Attributes
edge of type
DOMString
A string specifying alignment on the right edge of the preceding
element or the left edge of the following element. Allowed values are
left and
right.
Extends:
MathMLElement
This interface is provided to serve as a base interface for various MathML Content interfaces. It contains no new attributes or methods at this time; however, it is felt that the distinction between Presentation and Content MathML entities should be indicated in the MathMLElement heirarchy. In particular, future versions of the MathML DOM may add functionality on this interface; it may also serve as an aid to implementors.
IDL Definition
interface MathMLContentElement: MathMLElement {
};
Extends:
MathMLContentElement
This interface represents the MathML Content
token elements: ci, cn and
csymbol. These elements may contain MathML Presentation
elements, Text nodes, or a combination of both. Thus the getArgument
and insertArgument methods have been provided to deal with this
distinction between these elements and other MathML Content elements.
IDL Definition
interface MathMLContentToken: MathMLContentElement {
readonly attribute MathMLDocumentFragment arguments;
Node getArgument(in unsigned long index);
Node insertArgument(in unsigned long index, in Node newArgument);
Node setArgument(in unsigned long index, in Node newArgument);
void deleteArgument(in unsigned long index);
Node removeArgument(in unsigned long index);
};
Attributes
arguments of type
MathMLDocumentFragment, readonlyThe arguments of this element, returned as a MathMLDocumentFragment.
Note that this is not necessarily the same as Node::childNodes, particularly
in the case of the cn element. The reason is that the sep
elements that are used to separate the arguments of a cn are
not returned.
Methods
getArgument
A convenience method to retrieve the child
argument at the position referenced by index. Note that this is
not necessarily the same as the indexth child Node
of this Element; in particular, sep
elements will not be counted.
Parameters
unsigned long | index |
Position of desired argument in the list of arguments. The first argument is numbered 1. |
Return value
Node |
The |
This method raises no exceptions.
insertArgument
A convenience method to insert newArgument
before the current indexth argument child of this element.
If index is 0, newArgument is appended as the last argument.
Parameters
unsigned long | index |
Position before which |
Node | newArgument |
|
Return value
Node |
The |
This method raises no exceptions.
setArgument
A convenience method to set an argument child at the position
referenced by index. If there is currently an argument at this
position, it is replaced by newArgument.
Parameters
unsigned long | index |
Position of the argument that is to be
set to |
Node | newArgument |
|
Return value
Node |
The |
This method raises no exceptions.
deleteArgument
A convenience method to delete the argument child
located at the position referenced by index.
Parameters
unsigned long | index |
Position of the argument to be deleted from the list of arguments. The first argument is numbered 1. |
Return value
void |
None. |
This method raises no exceptions.
removeArgument
A convenience method to delete the argument child
located at the position referenced by index, and to return it to
the caller.
Parameters
unsigned long | index |
Position of the argument to be deleted from the list of arguments. The first argument is numbered 1. |
Return value
Node |
A |
This method raises no exceptions.
Extends:
MathMLContentToken
The cn element is used to specify actual
numeric constants.
IDL Definition
interface MathMLcnElement: MathMLContentToken {
attribute DOMString type;
attribute DOMString base;
readonly attribute unsigned long nargs;
attribute DOMString definitionURL;
attribute DOMString encoding;
};
Attributes
type of type
DOMString
Values include, but are not restricted to,
center,
real,
integer,
rational,
complex-cartesian,
complex-polar, and
constant.
base of type
DOMString
A string representing an integer between 2 and 36; the base of the numerical representation.
nargs of type
unsigned long, readonlyThe number of sep-separated arguments.
definitionURL of type
DOMString
A URL pointing to an alternative definition
encoding of type
DOMString
A description of the syntax used in
definitionURL.
Extends:
MathMLContentToken
The ci element is used to specify a symbolic
name.
IDL Definition
interface MathMLciElement: MathMLContentToken {
attribute DOMString type;
};
Attributes
type of type
DOMString
Values include
integer,
rational,
real,
float,
complex,
complex-polar,
complex-cartesian,
constant,
any of the MathML content container types
(vector,
matrix,
set,
list etc.)
or their types.
Extends:
MathMLContentToken
This interface represents the csymbol
element.
IDL Definition
interface MathMLcsymbolElement: MathMLContentToken {
attribute DOMString definitionURL;
attribute DOMString encoding;
};
Attributes
definitionURL of type
DOMString
A URI pointing to a definition for this symbol element.
encoding of type
DOMString
A string describing the syntax in which the definition
located at definitionURL is given.
We have added interfaces for content elements that are containers, i.e. elements that may contain child elements corresponding to arguments, bound variables, conditions, or lower or upper limits.
Extends:
MathMLContentElement
This interface supports the MathML Content elements that may
contain child Content elements. They include: apply,
reln (deprecated), fn,
lambda, condition,
declare, semantics,
annotation, annotation-xml,
interval, set,
list, vector,
matrix, matrixrow,
lowlimit, uplimit,
bvar, degree,
set, list, and
logbase.
IDL Definition
interface MathMLContentContainer: MathMLContentElement {
readonly attribute unsigned long nBoundVariables;
readonly attribute MathMLDocumentFragment nArguments;
attribute MathMLconditionElement condition;
attribute MathMLElement lowLimit;
attribute MathMLElement upLimit;
attribute MathMLElement opDegree;
MathMLElement getArgument(in unsigned long index);
MathMLElement insertArgument(in MathMLElement newArgument, in unsigned long index);
MathMLElement setArgument(in MathMLElement newArgument, in unsigned long index);
void deleteArgument(in unsigned long index);
MathMLElement removeArgument(in unsigned long index);
MathMLbvarElement getBoundVariable(in unsigned long index);
MathMLbvarElement insertBoundVariable(in MathMLbvarElement newBVar, in unsigned long index);
MathMLbvarElement setBoundVariable(in MathMLbvarElement newBVar, in unsigned long index);
void deleteBoundVariable(in unsigned long index);
MathMLbvarElement removeBoundVariable(in unsigned long index);
};
Attributes
nBoundVariables of type
unsigned long, readonlyThe number of bvar
child elements of this element.
nArguments of type
MathMLDocumentFragment, readonlyThe number of child elements of this element
which represent arguments of the element, as opposed to qualifiers. Thus it
does not contain elements representing bound variables, conditions, separators, degrees,
or upper or lower limits (bvar,
condition, sep,
degree, lowlimit,
or uplimit).
condition of type
MathMLconditionElement
This attribute represents the condition child
element of this node. See Section 4.2.3.2 [Operators taking Qualifiers].
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised if this element does not permit a child
condition element. In particular, raised if
this element is not a apply,
set, or list.
lowLimit of type
MathMLElement
This attribute represents the lowlimit
child element of this node (if any). This expresses, for instance, the lower limit of
integration if this is an apply element whose first
child is a int. See Section 4.2.3.2 [Operators taking Qualifiers].
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised if this element does not permit a child
lowlimit element. In particular, raised if
this element is not an apply element whose first child
is an int, sum,
product, or limit element.
upLimit of type
MathMLElement
This attribute represents the uplimit
child element of this node (if any). This expresses, for instance, the upper limit of
integration if this is an apply element whose first
child is a int. See Section 4.2.3.2 [Operators taking Qualifiers].
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised if this element does not permit a child
uplimit element. In particular, raised if
this element is not an apply element whose first child
is an int, sum,
or product element.
opDegree of type
MathMLElement
This attribute represents the degree child
element of this node. This expresses, for instance, the degree of differentiation
if this element is a bvar child of an
apply element whose first child is a diff
or partialdiff. See Section 4.2.3.2 [Operators taking Qualifiers].
Exceptions on Setting
HIERARCHY_REQUEST_ERR
Raised if this element does not permit a child
degree element. In particular, raised if
this element is not a bvar or apply.
Methods
getArgument
This method returns only the child elements that are arguments of
this element. This frequently differs from the value of
Node::childNodes().item(index), as elements
representing bound variables, conditions, separators, degrees,
and upper or lower limits are not returned (bvar,
condition, sep,
degree, lowlimit,
uplimit).
Parameters
unsigned long | index |
The one-based index of the argument to be retrieved. |
Return value
MathMLElement |
A |
This method raises no exceptions.
insertArgument
This method inserts newArgument before the
current indexth argument of this element. If index is 0,
newArgument is appended as the last argument. This frequently
differs from setting the node at
Node::childNodes().item(index), as elements representing bound
variables, conditions, separators, degrees, and upper or lower limits are
not counted (bvar,
condition, sep,
degree, lowlimit,
uplimit).
Parameters
MathMLElement | newArgument |
The |
unsigned long | index |
The one-based index of the position before
which |
Return value
MathMLElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if this element does not permit a child
degree element. In particular, raised if
this element is not a bvar or apply.
setArgument
This method sets newArgument as the
indexth argument of this element. If there is currently an
indexth argument, it is replaced by newArgument.
This frequently differs from setting the node at
Node::childNodes().item(index), as elements representing bound
variables, conditions, separators, degrees, and upper or lower limits are
not counted (bvar,
condition, sep,
degree, lowlimit,
uplimit).
Parameters
MathMLElement | newArgument |
The |
unsigned long | index |
The one-based index of the position in
the argument list into which |
Return value
MathMLElement |
The new |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if this element does not permit a child
degree element. In particular, raised if
this element is not a bvar or apply.
deleteArgument
This method deletes the indexth
child element that is an argument of this element. Note that child elements
which are qualifier elements are not counted in determining the
indexth argument.
Parameters
unsigned long | index |
The one-based index of the argument to be deleted. |
Return value
void |
None. |
This method raises no exceptions.
removeArgument
This method deletes the indexth
child element that is an argument of this element, and returns it to the caller.
Note that child elements that are qualifier elements are not counted in
determining the indexth argument.
Parameters
unsigned long | index |
The one-based index of the argument to be removed. |
Return value
MathMLElement |
A |
This method raises no exceptions.
getBoundVariable
This method retrieves the indexth
MathMLbvarElement child of the MathMLElement. Note that
only bvar child elements are counted in determining
the indexth bound variable.
Parameters
unsigned long | index |
The one-based index into the bound variable
children of this element of the |
Return value
MathMLbvarElement |
The |
This method raises no exceptions.
insertBoundVariable
This method inserts a MathMLbvarElement
as a child node before the current indexth bound variable child
of this MathMLElement. If index is 0, newBVar
is appended as the last bound variable child. This has the effect of adding
a bound variable to the expression this element represents. Note that the
new bound variable is inserted as the index-th
bvar child node, not necessarily as the indexth child node.
The point of the method is to allow insertion of bound variables without
requiring the caller to calculate the exact order of child qualifier
elements.
Parameters
MathMLbvarElement | newBVar |
A |
unsigned long | index |
The one-based index into the bound variable
children of this element before which |
Return value
MathMLbvarElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if this element does not permit child
bvar elements.
setBoundVariable
This method sets the indexth bound
variable child of this MathMLElement to newBVar. This
has the effect of setting a bound variable in the expression this element
represents. Note that the new bound variable is inserted as the index-th bvar child node, not necessarily
as the indexth child node. The point of the method is to allow
insertion of bound variables without requiring the caller to calculate the
exact order of child qualifier elements. If there is already a
bvar at the index-th position, it is
replaced by newBVar.
Parameters
MathMLbvarElement | newBVar |
The new |
unsigned long | index |
The one-based index into the bound variable
children of this element at which |
Return value
MathMLbvarElement |
The |
Exceptions
HIERARCHY_REQUEST_ERR
Raised if this element does not permit child
bvar elements.
deleteBoundVariable
This method deletes the index-th
MathMLbvarElement child of the MathMLElement. This has the
effect of removing this bound variable from the list of qualifiers
affecting the element this represents.
Parameters
unsigned long | index |
The one-based index into the bound variable
children of this element of the |
Return value
void |
None. |
This method raises no exceptions.
removeBoundVariable
This method removes the index-th
MathMLbvarElement child of the MathMLElement and returns
it to the caller. This has the effect of removing this bound variable from
the list of qualifiers affecting the element this represents.
Parameters
unsigned long | index |
The one-based index into the bound variable
children of this element of the |
Return value
MathMLbvarElement |
The |
This method raises no exceptions.
Extends:
MathMLContentContainer
The apply element allows a function or
operator to be applied to its arguments.
IDL Definition
interface MathMLapplyElement: MathMLContentContainer {
attribute MathMLElement operator;
};
Attributes
operator of type
MathMLElement
The MathML element representing the function or operator that is applied to the list of arguments.
Extends:
MathMLContentContainer
The fn element makes explicit the fact that
a more general MathML object is intended to be used in the same manner as if it
were a pre-defined function such as sin or
plus.
IDL Definition
interface MathMLfnElement: MathMLContentContainer {
attribute DOMString definitionURL;
attribute DOMString encoding;
};
Attributes
definitionURL of type
DOMString
A URL pointing to a definition for this function-type element. Note that there is no stipulation about the form this definition may take!
encoding of type
DOMString
A string describing the syntax in which the definition
located at definitionURL is given.
Extends:
MathMLContentContainer
The lambda element is used to construct a
user-defined function from an expression and one or more free variables.
IDL Definition
interface MathMLlambdaElement: MathMLContentContainer {
attribute MathMLElement expression;
};
Attributes
expression of type
MathMLElement
The MathMLElement representing the expression.
This is included only as a convenience; getting it should give the same
result as MathMLContentContainer::getArgument(1).
Extends:
MathMLContentContainer
The set element is the container element
that represents a set of elements. The elements of a set can be defined either
by explicitly listing the elements, or by using the
bvar and condition elements.
IDL Definition
interface MathMLsetElement: MathMLContentContainer {
readonly attribute boolean isExplicit;
attribute DOMString type;
};
Attributes
isExplicit of type
boolean, readonlyThis is true if the set is specified by giving the list of its elements explicitly.
type of type
DOMString
The type attribute of
the represented element. Predefined values are norml
and multiset. See
Section 4.4.6 [Theory of Sets] and Section 4.3 [Content Element Attributes].
Extends:
MathMLContentContainer
The list element is the container element
which represents a list of elements. Elements can be defined either by
explicitly listing the elements, or by using the bvar
and condition elements.
IDL Definition
interface MathMLlistElement: MathMLContentContainer {
readonly attribute boolean isExplicit;
attribute DOMString ordering;
};
Attributes
isExplicit of type
boolean, readonlyThis is true if the list is specified by giving its elements explicitly.
ordering of type
DOMString
The order attribute of
the represented element. Predefined values are numeric
and lexicographic. See
Section 4.4.6 [Theory of Sets] and Section 4.3 [Content Element Attributes].
Extends:
MathMLContentContainer
This interface represents the MathML bound variable
element bvar. The interface currently
provides no functionality beyond that of MathMLContentContainer,
but is useful for defining the type of bound variable access functions.
IDL Definition
interface MathMLbvarElement: MathMLContentContainer {
};
Extends:
MathMLContentElement
This interface supports all of the empty built-in
operator, relation, function, and constant and symbol elements that have
the definitionURL and encoding
attributes in addition to the standard set of attributes. The elements
supported in order of their appearance in Section 4.4 [The Content Markup Elements] are:
inverse,
compose,
ident,
quotient,
exp,
factorial,
divide,
max,
min,
minus,
plus,
power,
rem,
times,
root,
gcd,
and,
or,
xor,
not,
implies,
forall,
exists,
abs,
conjugate,
eq,
neq,
gt,
lt,
geq,
leq,
ln,
log,
int,
diff,
partialdiff,
union,
intersect,
in,
notin,
subset,
prsubset,
notsubset,
notprsubset,
setdiff,
sum,
product,
limit,
tendsto,
sin,
cos,
tan,
sec,
csc,
cot,
sinh,
cosh,
tanh,
sech,
csch,
coth,
arcsin,
arccos,
arctan,
mean,
sdev,
variance,
median,
mode,
moment,
determinant,
transpose,
integers,
reals,
rationals,
naturalnumbers,
complexes,
primes,
exponentiale,
imaginaryi,
notanumber,
true,
false,
emptyset,
pi,
eulergamma, and
infinity.
IDL Definition
interface MathMLpredefinedSymbol: MathMLContentElement {
attribute DOMString definitionURL;
attribute DOMString encoding;
attribute DOMString arity;
readonly attribute DOMString symbolName;
};
Attributes
definitionURL of type
DOMString
A string that provides an override to the default semantics, or provides a more specific definition
encoding of type
DOMString
A string describing the syntax in which the definition
located at definitionURL is given.
arity of type
DOMString
A string representing the number of arguments. Values include
0, 1, ... and variable.
symbolName of type
DOMString, readonlyA string giving the name of the MathML element represented.
This is a convenience attribute only; accessing it should be synonymous with
accessing the Element::tagName attribute.
Extends:
MathMLContentElement
The interval element is used to represent
simple mathematical intervals on the real number line. It contains either two
child elements that evaluate to real numbers or one child element that is a
condition for defining membership in the interval.
IDL Definition
interface MathMLintervalElement: MathMLContentElement {
attribute DOMString closure;
attribute MathMLcnElement start;
attribute MathMLcnElement end;
};
Attributes
closure of type
DOMString
A string with value open,
closed,
open-closed or
closed-open.
The default value is closed.
start of type
MathMLcnElement
A MathMLcnElement representing the real number defining
the start of the interval. If end has not already been
set, it becomes the same as start until set otherwise.
end of type
MathMLcnElement
A MathMLcnElement representing the real number defining
the end of the interval. If start has not
already been set, it becomes the same as end until set otherwise.
Extends:
MathMLContentElement
The condition element is used to place a
condition on one or more free variables or identifiers.
IDL Definition
interface MathMLconditionElement: MathMLContentElement {
attribute MathMLapplyElement condition;
};
Attributes
condition of type
MathMLapplyElement
A MathMLapplyElement that represents the condition.
Extends:
MathMLContentElement
The declare construct has two primary roles.
The first is to change or set the default attribute values for a specific
mathematical object. The second is to establish an association between a
`name' and an object.
IDL Definition
interface MathMLdeclareElement: MathMLContentElement {
attribute DOMString type;
attribute unsigned long nargs;
attribute DOMString occurrence;
attribute DOMString definitionURL;
attribute DOMString encoding;
attribute MathMLciElement identifier;
attribute MathMLElement constructor;
};
Attributes
type of type
DOMString
A string indicating the type of the identifier. It must be compatible
with the type of the constructor, if a constructor is
present. The type is inferred from the constructor if present,
otherwise it must be specified.
nargs of type
unsigned long
If the identifier is a function, this attribute
specifies the number of arguments the function takes. This represents the
declare element's nargs attribute;
see Section 4.4.2.8 [Declare (declare)].
occurrence of type
DOMString
A string with the values prefix,
infix, postfix, or
function-model.
definitionURL of type
DOMString
A URL specifying the detailed semantics of the element.
encoding of type
DOMString
A description of the syntax used in
definitionURL.
identifier of type
MathMLciElement
A MathMLciElement representing the name being declared.
constructor of type
MathMLElement
An optional MathMLElement
providing an initial value for the object being declared.
Extends:
MathMLContentElement
vector is the container element for a
vector.
IDL Definition
interface MathMLvectorElement: MathMLContentElement {
readonly attribute unsigned long ncomponents;
MathMLContentElement getComponent(in unsigned long index);
MathMLContentElement insertComponent(in MathMLContentElement newComponent, in unsigned long index);
MathMLContentElement setComponent(in MathMLContentElement newComponent, in unsigned long index);
deleteComponent(in unsigned long index);
MathMLContentElement removeComponent(in unsigned long index);
};
Attributes
ncomponents of type
unsigned long, readonlyThe number of components in the vector.
Methods
getComponent
A convenience method to retrieve a component.
Parameters
unsigned long | index |
Position of the component in the list of components. The first element is numbered 1. |
Return value
MathMLContentElement |
The |
This method raises no exceptions.
insertComponent
A convenience method to insert a new component
in the vector before the current indexth component. If index is 0 or is one more than the number of components currently in the
vector, newComponent is appended as the last component of the
vector.
Parameters
MathMLContentElement | newComponent |
A |
unsigned long | index |
Position of the component in the list of components. The first component is numbered 1. |
Return value
MathMLContentElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than one more than the current number of components of this
vector element.
setComponent
A convenience method to set the indexth
component of the vector to newComponent. If index is one
more than the current number of components, newComponent is
appended as the last component.
Parameters
MathMLContentElement | newComponent |
A |
unsigned long | index |
Position of the component in the list of components. The first element is numbered 1. |
Return value
MathMLContentElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than one more than the current number of components of this
vector element.
deleteComponent
A convenience method to delete an element. The deletion changes the indices of the following components.
Parameters
unsigned long | index |
Position of the component in the vector. The position of the first component is 1 |
Return value
|
None |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the current number of components of this vector
element.
removeComponent
A convenience method to remove a component from
a vector and return it to the caller. If index is greater than the number of
components or is 0, a null MathMLContentElement is returned.
Parameters
unsigned long | index |
Position of the component in the list of components. The first element is numbered 1. |
Return value
MathMLContentElement |
The |
This method raises no exceptions.
Extends:
MathMLContentElement
The matrix element is the container element
for matrixrow elements.
IDL Definition
interface MathMLmatrixElement: MathMLContentElement {
readonly attribute unsigned long nrows;
readonly attribute unsigned long ncols;
readonly attribute MathMLDocumentFragment rows;
MathMLmatrixrowElement getRow(in unsigned long index);
MathMLmatrixrowElement insertRow(in MathMLmatrixrowElement newRow, in unsigned long index);
MathMLmatrixrowElement setRow(in MathMLmatrixrowElement newRow, in unsigned long index);
deleteRow(in unsigned long index);
removeRow(in unsigned long index);
};
Attributes
nrows of type
unsigned long, readonlyThe number of rows in the represented matrix.
ncols of type
unsigned long, readonlyThe number of columns in the represented matrix.
rows of type
MathMLDocumentFragment, readonlyThe rows of the matrix, returned as a
MathMLDocumentFragment consisting of MathMLmatrixrowElements.
Methods
getRow
A convenience method to retrieve a specified row.
Parameters
unsigned long | index |
Position of the row in the list of rows. The first row is numbered 1. |
Return value
MathMLmatrixrowElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of rows in the matrix.
insertRow
A convenience method to insert a row before
the row that is currently the indexth row of this
matrix. If index is 0, newRow is appended as the
last row of the matrix.
Parameters
MathMLmatrixrowElement | newRow |
|
unsigned long | index |
Unsigned integer giving the row position
before which |
Return value
MathMLmatrixrowElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than one more than the number of rows in the matrix.
HIERARCHY_REQUEST_ERR
Raised if the number of cells in
newRow doesn't match the number of columns in the matrix.
setRow
A convenience method to set the value of
the indexth child matrixrow element of
this element. If there is already a row at the specified index, it is
replaced by newRow.
Parameters
MathMLmatrixrowElement | newRow |
|
unsigned long | index |
Unsigned integer giving the row
which is to be set to |
Return value
MathMLmatrixrowElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of rows in the matrix.
HIERARCHY_REQUEST_ERR
Raised if the number of cells in
newRow doesn't match the number of columns in the matrix.
deleteRow
A convenience method to delete a row. The deletion changes the indices of the following rows.
Parameters
unsigned long | index |
Position of the row to be deleted in the list of rows |
Return value
|
None |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of rows in the matrix.
removeRow
A convenience method to remove a row and return it to the caller. The deletion changes the indices of the following rows.
Parameters
unsigned long | index |
Position of the row to be removed in the list of rows. The first row is numbered 1. |
Return value
|
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of rows in the matrix.
Extends:
MathMLContentElement
The matrixrow element is the container
element for the elements of a matrix.
IDL Definition
interface MathMLmatrixrowElement: MathMLContentElement {
readonly attribute unsigned long nEntries;
MathMLContentElement getEntry(in unsigned long index);
MathMLContentElement insertEntry(in MathMLContentElement newEntry, in unsigned long index);
MathMLContentElement setEntry(in MathMLContentElement newEntry, in unsigned long index);
deleteEntry(in unsigned long index);
MathMLContentElement removeEntry(in unsigned long index);
};
Attributes
nEntries of type
unsigned long, readonlyThe number of entries in the row.
Methods
getEntry
A convenience method to retrieve the contents of an entry by index.
Parameters
unsigned long | index |
Position of the entry in the row. The first entry is numbered 1. |
Return value
MathMLContentElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of entries in the row.
insertEntry
A convenience method to insert an entry before the
current indexth entry of the row. If index is 0, newEntry is appended as the last entry. Note that this method increases
the size of the matrixrow.
Parameters
MathMLContentElement | newEntry |
The |
unsigned long | index |
The index before which |
Return value
MathMLContentElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of entries in the row.
setEntry
A convenience method to set the contents of the
entry at position index in the row to newEntry. If there is
already a entry at the specified index, it is replaced by the new
entry.
Parameters
MathMLContentElement | newEntry |
The |
unsigned long | index |
The index of the entry that is to be
set equal to |
Return value
MathMLContentElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than one more than the number of elements in the row.
deleteEntry
A convenience method to delete an entry. The deletion changes the indices of the following entries.
Parameters
unsigned long | index |
Position of the entry to be deleted in the row. The first entry is numbered 1. |
Return value
|
None |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of entries in the row.
removeEntry
A convenience method to remove an entry from the row and return the removed entry to the caller.
Parameters
unsigned long | index |
Position of the entry to be removed from the row. The first entry is numbered 1. |
Return value
MathMLContentElement |
The |
Exceptions
INDEX_SIZE_ERR
Raised if index is greater
than the number of entries in the row.
Overview: Mathematical Markup Language (MathML) Version 2.0
Previous: D Operator Dictionary (Non-normative)
Next: F Glossary (Non-normative)