E.1.1. Miscellaneous Object Definitions

Interface MathMLCollection

This interface is included by analogy with the interface
HTMLCollection, and for the same reasons. (Specifically, it
allows access to a list of nodes either by index or by
name or id attributes. The
rationale making this desirable for the HTML DOM applies also to the MathML
DOM; particularly the presence of named hyperlink targets.) The documentation
below is essentially copied from the definition of HTMLCollection.

Attributes

length

This attribute specifies the length or size of the
list.

Methods

item

This method retrieves a node specified by
ordinal index. Nodes are numbered in tree
order (depth-first traversal order).

Parameters

index

The index of the node
to be fetched. The index
origin is 0.

Return value

The Node at the corresponding position upon success. A
value of null is returned if the index is out of
range.

This method raises no exceptions.

namedItem

This method retrieves a Node using a name. It first
searches for a Node with a matching id
attribute. If it doesn't find one, it then searches for a Node with a
matching name attribute, but only on those elements
that are allowed a name attribute.

Parameters

name

The name of the Node to be fetched.

Return value

The Node with a name or
id attribute whose value corresponds to the specified
string. Upon failure (e.g., no node with this name exists), returns
null.

All MathML element interfaces derive from this object, which
derives from the basic DOM interface Element.

Attributes

className

The class attribute of the element. See the
MathML discussion and the HTML definition of the class
attribute.

style

A string identifying the element's style
attribute.(?)

id

The element's identifier. See the MathML discussion and the HTML
definition of the id attribute.

other

Direct access to the element's other
attribute, as a string.

otherAttributes

This attribute retrieves or sets a NamedNodeList
representing the contents of the element's other
attribute. This will allow more convenient access to the name-key pairs which
this attribute is defined to contain.

Methods

getMathElement

A convenience method to retrieve child elements.

Parameters

index

Return value

The same value as a call to
Node::childNodes().item(index),but returned as a
MathMLElement instead of a Node.

This method raises no exceptions.

E.1.3. Specific Style Methods (currfontsize, etc.)

Issue (style-methods):
At the August 1999/ F2F meeting, the group agreed that the following
level 2 interface for obtaining the current values of certain style
attributes should be included. However, after careful study of the XML DOM
levels 1 and 2, we (Roger and Ron) now believe that they are not
appropriate.
These methods are considered desirable because we see the need to make
frequent calls to discover style information and the current script level
and display style. As anyone who's implemented math rendering knows,
there's a constant need for this information, and it must be obtained very
quickly. The July 1999 DOM Level 2 draft states that mechanisms for
obtaining the cascaded, computed and actual style for a specific element
are being considered. This would obviate the need for the font and color
methods.
Why do we believe now that these interfaces should not be specified here?
The primary reason is that the XML DOM, at both levels, does not include
methods for obtaining these values. If they are introduced in some later
iteration of the XML DOM, the font methods would not be necessary here. It
would then be appropriate to include the currscriptlevel and currdisplaystyle
methods in the MathML DOM. If we include the style related methods because they
are necessary for a renderer implementation, it seems equally appropriate to
include methods for returning the actual size of elements as rendered (these
are the currheight, currdepth, and currwidth methods below). This information
is also essential for rendering, and it is necessary for hit detection.
We've concluded that the XML DOM assumes a model where the renderer itself
implements methods to obtain the cascaded, computed style values, and the size
and placement of objects. The inclusion of mouse events in the level 2 DOM
without including these style, size, and placement methods emphasizes this
implied model. The parallel for MathML would be to assume that a renderer that
includes a MathML component would implement its own methods for obtaining the
current script level, display style, and other inherited computed values that
are essential for MathML rendering, and so these methods would not be specified
here.

This interface is required for implementations that perform
rendering.
Note that these methods are specified for MathMLElement. This means that
they return results for all MathML elements, including content elements.
This is to facilitate rendering of mixed markup.

DOM implementations that do not render should not have to implement the
MathMLElement2 interface. In fact, they may not have the information necessary
to implement them.

If IDL attributes are to be used only for explicit XML attributes, the above
interface should use methods for getting current (cascaded, computed, and
actual) values. They would take the following form.

Question: How does a DOM handle multiple clients? These style methods
could return different values for different clients.

Attributes

currscriptlevel

Computes and returns the current script level. This is
the cascaded, computed value for the element.

currdisplaystyle

Computes and returns the current display style.
This is the cascaded, computed value for the element.

currfontsize

Computes and returns the current font size. This is the
cascaded, computed value for the element.

currfontweight

Computes and returns the current font weight. This is the
cascaded, computed value for the element.

currfontstyle

Computes and returns the current font style. This is the
cascaded, computed value for the element.

currfontfamily

Computes and returns the current font family. This is the
cascaded, computed value for the element.

currcolor

Computes and returns the current text color.
This is the cascaded, computed value for the element.

currheight

Computes and returns the current element height,
relative to its baseline origin, as rendered.

currdepth

Computes and returns the current element depth, relative
to its baseline origin, as rendered.

currwidth

Computes and returns the current element width as
rendered.

Methods

getCurrScriptLevel

Return value

This method raises no exceptions.

getCurrDisplayStyle

Return value

This method raises no exceptions.

getCurrFontSize

Return value

This method raises no exceptions.

getCurrFontWeight

Return value

This method raises no exceptions.

getCurrFontStyle

Return value

This method raises no exceptions.

getCurrFontFamily

Return value

This method raises no exceptions.

getCurrColor

Return value

This method raises no exceptions.

E.1.4. Presentation Elements

Interface MathMLTokenElement

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 which expose only the core presentation
token attributes are directly supported by this object. These elements are:

mi

MathML identifier element

mn

MathML number element

mtext

MathML text element

Issue (methodless-interfaces): Interfaces with no Methods?
Should we provide interfaces with no methods for
<mi>, <mn>, and
<mtext>? This would provide separate objects for these
elements. Since the element name provides complete information, there is no
pressing need for such `interfaces'. Of course, extending this
argument could lead to no MathML DOM specification at all.

This interface extends the MathMLTokenElement
interface for the MathML operator
element <mo>.

Attributes

form

The form attribute (prefix,
infix or postfix) for the
<mo> element, if specified.

fence

The fence attribute
(true or false)
for the <mo> element, if specified.

separator

The separator attribute
(true or false) for the
<mo> element, if specified.

lspace

The lspace attribute (spacing to left) of
the <mo> element, if specified.

rspace

The rspace attribute (spacing to right) of the
<mo> element, if specified.

stretchy

The stretchy attribute
(true or false) for the
<mo> element, if specified.

symmetric

The symmetric attribute
(true or false) for the
<mo> element, if specified.

maxsize

The maxsize attribute for the
<mo> element, if specified.

minsize

The minsize attribute for the
<mo> element, if specified.

largeop

The largeop attribute for the
<mo> element, if specified.

moveablelimits

The moveablelimits
(true or false) attribute for the
<mo> element, if specified.

accent

The accent attribute
(true or false) for the
<mo> element, if specified.

Issue (default-values):
Level 2, Default Values, and the Operator Dictionary
In Scientific WorkPlace and Scientific Notebook, we use knowledge of
fence delimiters at certain times to aid in conversion from presentation to
content form. Knowledge of form attribute values could be used for
conversions of this type. It's conceivable that other
<mo> attributes might also give valuable clues. Some
elements have default attribute values - for example,
<mfence> has default delimiters.
Do we expect renderers and content manipulators to manage their own
operator dictionaries and to know the default values, or is it reasonable
to ask the DOM to supply the affected attribute values? It seems
unreasonable to expect all DOM implementations to use an operator
dictionary - those dealing exclusively with content form won't want
to be burdened this way.
With these considerations in mind, we propose the following optional
interface that supplies all operator attribute values, whether or not they
have appear explicitly in the markup. Note that the interface uses IDL
attributes (instead of Get methods) because the values can be supplied
explicitly.
We have specified this interface for the operator dictionary only. That is,
we expect all clients of the DOM to know the default values of attributes for
all elements.
We've used the prefix `resolved' here. Any better
suggestions?

Interface MathMLSpaceElement

This interface extends the MathMLElement interface for
the MathML space element <mspace>.
Note that this is not derived from
MathMLTokenElement, despite the fact that
<mspace> is classified as a token element, it doesn't
carry the attributes declared for MathMLTokenElement.

Attributes

width

A string of the form `numberh-unit'; represents the width
attribute for the <mspace> element, if specified.

height

A string of the form `numberv-unit'; represents the height
attribute for the <mspace> element, if specified.

depth

A string of the form `numberv-unit'; represents the depth
attribute for the <mspace> element, if specified.

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.

Attributes

scriptlevel

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

Either true or false;
a string representing the displaystyle attribute for the
<mstyle> element, if specified. See also the discussion
of this attribute.

scriptsizemultiplier

A string of the form `number';
represents the scriptsizemultiplier attribute for the
<mstyle> element, if specified. See also the discussion
of this attribute.

scriptminsize

A string of the form `numberv-unit'; represents the
scriptminsize attribute for the
<mstyle> element, if specified. See also the discussion
of this attribute.

color

A string representation of a color; represents the
color attribute for the <mstyle>
element, if specified. See also the discussion of this attribute.

background

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.

Interface MathMLFencedElement

This interface extends the MathMLElement interface for
the MathML fenced content element
<mfenced>.

Attributes

open

A string representing the opening-fence for the
<mfenced> element, if specified; this is the element's
open attribute.

close

A string representing the opening-fence for the
<mfenced> element, if specified; this is the element's
close attribute.

separators

A string representing any separating characters inside the
<mfenced> element, if specified; this is the element's
separators attribute.

Editor's note:
Nico Poppelier
(16 October 1999)
The definition of the next interface could not
be converted completely, because attribute definitions
do not have a child 'raises', which method definitions do have.
I left the exception descriptions inside the attribute
descriptions.

This interface extends the MathMLElement interface for
the MathML subscript, superscript and
subscript-superscript pair elements
<msub>, <msup>, and
<msubsup>.

Attributes

subscriptshift

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 a <msup>.

superscriptshift

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

A MathMLElement representing the base of
the script. This is the first child of the element.

subscript

A MathMLElement representing the subscript
of the script. This is the second child of a <msub>
or <msubsup>; retrieval must return null
for a <msup>. Exceptions on setting: the
DOMExceptionNOT_FOUND_ERR is raised when the element is
a <msup>.

superscript

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 a
<msub>. Exceptions on setting: the
DOMExceptionNOT_FOUND_ERR is raised when the element is
a <msub>.

This interface extends the MathMLElement interface for
the MathML underscript, overscript and
overscript-underscript pair elements
munder, mover and
munderover.

Attributes

accentunder

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 a <mover>.

accent

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 a <munder>.

base

A MathMLElement representing the base of
the script. This is the first child of the element.

underscript

A MathMLElement representing the
underscript of the script. This is the second child of a
<munder> or <munderover>;
retrieval must return null for a <mover>.
Exceptions on setting: the DOMExceptionNOT_FOUND_ERR is
raised when the element is a <mover>.

overscript

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 a <munder>. Exceptions on
setting: the DOMExceptionNOT_FOUND_ERR is raised when the
element is a <munder>.

Editor's note:
Nico Poppelier
(16 October 1999)
The definition of the next interface did not convert
due to a mismatch between the IDL definition and the informal
descriptions. I edited the HTML source by hand in order to
run the conversion.

This interface extends the MathMLElement interface for
the MathML multiscripts (including prescripts or
tensors) element <mmultiscripts>.

Attributes

subscriptshift

A string representing the minimum amount to shift the baseline of
the subscripts down, if specified; this is the element's
subscriptshift attribute.

superscriptshift

A string representing the minimum amount to shift the baseline of
the superscripts up, if specified; this is the element's
superscriptshift attribute.

base

A MathMLElement representing the base of
the script. This is the first child of the element.

prescripts

A 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

A NodeList 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

The number of script/subscript columns preceding (to the left of)
the base. Should always be half of
getprescripts().length()

numscriptcolumns

The number of script/subscript columns following (to the right
of) the base. Should always be half of
getcripts().length()

Methods

getPreSubScript

A convenience method to retrieve pre-subscript
children of the element, referenced by column index .

Returns the MathMLElement representing the
colIndex-th presubscript (to the left of the
base, counting from 0 at the far left). Note that this may be
the MathMLElement corresponding to the special element
<none/> in the case of a `missing'
presubscript (see the discussion of
<mmultiscripts>), or it may be null if
colIndex is out of range for the element.

This method raises no exceptions.

getSubScript

A convenience method to retrieve subscript
children of the element, referenced by column index.

Parameters

colIndex

Column index of script (where 0 represents the
leftmost script column, the first to the right
of the base).

Return value

Returns the MathMLElement representing the
colIndex-th subscript to the right of the
base. Note that this may be
the MathMLElement corresponding to the special element
<none/> in the case of a `missing'
subscript (see the discussion of
<mmultiscripts>), or it may be null if
colIndex is out of range for the element.

This method raises no exceptions.

getPreSuperScript

A convenience method to retrieve pre-superscript
children of the element, referenced by column index .

Returns the MathMLElement representing the
colIndex-th presuperscript (to the left of
the base, counting from 0 at the far left). Note that this may be
the MathMLElement corresponding to the special element
<none/> in the case of a `missing'
presuperscript (see the discussion of
<mmultiscripts>), or it may be null if
colIndex is out of range for the element.

This method raises no exceptions.

getSuperScript

A convenience method to retrieve superscript
children of the element, referenced by column index .

Parameters

colIndex

Column index of script (where 0 represents the
leftmost script column, the first to the right of the
base)

Return value

Returns the MathMLElement representing the
colIndex-th superscript to the right of the
base. Note that this may be
the MathMLElement corresponding to the special element
<none/> in the case of a `missing'
superscript (see the discussion of
<mmultiscripts>), or it may be null if
colIndex is out of range for the element.

This method raises no exceptions.

insertPreSubScriptAt

A convenience method to insert a pre-subscript
child at the position referenced by column index. If there is
currently a pre-subscript at this position, it is
replaced by newElement.

This interface extends the MathMLElement
interface for the MathML table
or matrix element <mtable>.

Attributes

align

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.

A string representing the alignment of entries in each
column. Allowed values are (left |
center |
right)+.

groupalign

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 has the form
( left | right | center | decimalpoint)+ .

alignmentscope

A string consisting of the values true or
false indicating, for each column, whether it can be
used as an alignment scope.

rowspacing

A string of the form ( number v-unit )+
representing the space to be added between rows.

columnspacing

A string of the form ( number h-unit )+
representing the space to be added between columns.

rowlines

A string specifying whether and what kind of lines should be
added between each row. Allowed values are (none | solid |
dashed)+.

columnlines

A string specifying whether and what kind of lines should be
added between each column. Allowed values are (none | solid |
dashed)+.

frame

A string specifying a frame around the table. Allowed
values are (none | solid | dashed).

framespacing

A string of the form number h-unit number v-unit
specifying the spacing between table and its frame.

equalrows

A string with the values true or
false.

equalcolumns

A string with the values true or
false.

displaystyle

A string with the values true or
false.

rows

A MathMLCollection consisting of the rows of the table.

Methods

insertRow

A convenience method to Insert a new (empty) row in the table at
the specified index.

Parameters

index

Index at which to insert row.

Return value

Returns the MathMLTableRowElement representing the
<mtr> being inserted.

This method raises no exceptions.

deleteRow

A convenience method to delete the row of the table at the
specified index.

The <apply> element allows a function or
operator to be applied to its arguments.

Attributes

operator

The MathML element representing the function or operator that is
applied to the list of arguments.

nargs

An integer representing the number of arguments. This does not
include the function or operator itself; note that this causes the return value
to be less than the return from Node::childNodes().length().

Methods

getArgument

A convenience method to retrieve an argument

Parameters

index

Position of the argument in the list of arguments. The first
argument is numbered 1.

Return value

The MathMLElement argument at position index.

This method raises no exceptions.

insertArgument

A convenience method to insert an argument child at the position
referenced by index. If there is currently an argument at this
position, it is replaced by arg.

Parameters

index

Position of arg in the list of arguments. The first argument
is numbered 1.

arg

The MathMLElement to be inserted as the argument.

Return value

The MathMLElement inserted. This is the new element within
the DOM.

This method raises no exceptions.

Issue (reln-deprecated):
reln has been deprecated, so we do not include an interface(?).

Interface MathMLfnElement

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>.

Attributes

body

The MathML object that is to be treated as if it were a pre-defined
function.

definitionURL

A URL pointing to a definition for this function-type element. Note
that there is no stipulation about the form this definition may take!

Issue (interval-types):
There are really two distinct objects here. Should we treat them as
different with a common abstract parent class (interval) and two derived
classes (endpointsInterval and conditionInterval)? We've chosen to have a
single element that can be transformed from one type to the other.

The <interval> element is used to represent
simple mathematical intervals on the real number line. It contains either two
child elements which evaluate to real numbers or one child element which is a
condition for defining membership in the interval.

Attributes

closure

A string with value open,
closed,
open-closed or
closed-open.
The default value is closed.

isCondition

true if this interval is defined by a
condition rather than by two real number endpoints.

condition

A MathML <condition> element in the case that
the interval is defined using a condition. Setting this attribute has the side
effect of setting isCondition to true. Getting this attribute raises an
exception if isCondition is false.

start

A MathMLcnElement representing the real number defining
the start of the interval. Setting this attribute has the side effect of
setting isCondition to false. If end has not already been
set, it becomes the same as start until set otherwise. Getting this
attribute raises an exception if isCondition is
true.

end

A MathMLcnElement representing the real number defining
the end of the interval. Setting this attribute has the side effect of setting
isCondition to false. If start has not
already been set, it becomes the same as end until set otherwise.
Getting this attribute raises an exception if isCondition is
true.

Issue (sep-interface):
There is no separate interface for sep. Each element that allows
<sep> has interface methods to access the separated
components.

Issue (condition-reln):
The 1.01 specification says that a condition contains a single
<reln> element or a single
<apply> element. Since <reln>
is being deprecated in 2.0, we have typed the body as
MathMLapplyElement. Is this OK? It may be dangerous if there are
documents that use <reln> in this context.

Interface MathMLconditionElement

The <condition> element is used to place a
condition on one or more free variables or identifiers.

Attributes

condition

A MathMLapplyElement that represents the condition.

Issue (declare-constructor):
The identifier and the constructor are IDL attributes.
However, the constructor is optional. Can we specify that an attempt
to get the constructor when it isn't present returns null, or
should it raise an exception? Should either of these be IDL attributes?

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.

Attributes

type

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.

scope

A string with values local or
global.

nargs

If the identifier is a function, this attribute specifies the number
of arguments the function takes.

occurrence

A string with the values prefix,
infix or
function-model.
[What about postfix?]

The <lambda> element is used to construct a
user-defined function from an expression and one or more free variables.

Attributes

expression

The MathMLElement representing the expression.

nvars

An integer representing the number of variables in the expression.

Methods

getVariable

A convenience method to retrieve a variable by position.

Parameters

index

Position of the variable in the list of variables. The first variable
is numbered 1.

Return value

The MathMLElement representing the variable.

This method raises no exceptions.

insertVariable

A convenience method to insert an argument at the position referenced
by index. If there is currently an argument at this position, it is
replaced by arg.

Parameters

index

Position of arg in the list of arguments. The first argument
is numbered 1.

variable

The MathMLElement to be inserted as the argument.

Return value

The MathMLElement being inserted. This is the new element
within the DOM.

This method raises no exceptions.

Issue (builtin-interface):
I propose that all built in operator, relation, and function interfaces
either derive from or be directly supported through the MathMLbuiltIn
interface. Note that the name does not end with `Element' because
this interface does not correspond to a MathML element. The alternative is to
provide an interface for every one of these elements individually.
Again, this interface supports all empty elements that have only the
additional definitionURL attribute. This includes
elements that take qualifiers.
I don't particularly like the name builtin. Any better suggestions?
QUESTION: Should we treat these as objects that own their arguments and
provide methods for accessing those arguments? Similarly for operators taking
qualifiers - we could provide access to the qualifiers. No, I suppose not. It's
the <apply> that owns the arguments.
Unless <apply> does the work of validating the
arguments (ensuring the correct number, type, and checking any other
conditions), there's no easy way to introduce this.

Interface MathMLbuiltIn

<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>

This interface supports all of the empty built-in operator, relation,
and function elements that have the definitionURL
attribute in addition to the standard set of attributes. The elements supported
in order of their appearance in 4.4 are:

A string that provides an override to the default semantics, or
provides a more specific definition

arity

A string representing the number of arguments. Values include
0, 1, ... and variable.

Issue (qualifiers):
Qualifiers have the standard attributes, so there is no real need for a
separate interface, or in fact to mention them at all in the DOM
specification. An interface that is undefined at present is included here
just as a placeholder to remind us that it would be nice to provide another
form of access and control through the MathMLapplyElement
interface.

Issue (sets):
The following interface seems unsatisfactory. The first problem is that
<set> is really two things - a condition set or an
explicit list set. Another problem is that it's not easy to express the union
of two sets as a set (although it's possible - the problem is that the union of
a condition set and a list set is only awkwardly expressed as a condition set).
The dual nature of the object makes the interface awkward.
Access to the elements of an explicit list set seems problematic. What if
another process deletes an element between the time you determine its position
and when you delete it? Perhaps the delete function should take only a
MathMLElement argument as returned by getElement - this would be the element in
the DOM, so there would be no problem of a changing index.
NOTE: I've forgotten to provide access to the bvar element(s). How many can
we have?

The <set> element is the container element
which 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.

Attributes

isConditionSet

This is true if the set is specified using a condition and false if
the set is an explicit list.

condition

A MathMLconditionElement that determines the set. Setting
this makes the set causes isConditionSet to be set to true.
Getting this if the isConditionSet is false (so the set is
an explicit list) should raise an exception?

nelements

The number of elements if the set is an explicit list. Should this
raise an exception if this is a condition set? Even if the conditions really
amount to an explicit list?

Methods

getElement

A convenience method to retrieve an element. There is no default
ordering of the elements. Inserting or deleting an element is not
guaranteed to leave the element in the i-th place unchanged
even if the action takes place at a larger index.

Parameters

index

Position of the element in the list of elements. The first element is
numbered 1.

Return value

The MathMLElement element at position index.

This method raises no exceptions.

addElement

A convenience method to insert an element. The insertion may change
the indices of any of the other elements. Since element equivalence is not easy
to determine, it seems hard to specify that inserting the same element twice
is an error.

Parameters

element

The MathMLElement to be added to the set.

Return value

The MathMLElement being added. This is the element within
the DOM.

This method raises no exceptions.

deleteElement

A convenience method to delete an element. The deletion may change
the indices of any of the other elements.

Parameters

index

Position of the element in the set

Return value

None

This method raises no exceptions.

Issue (lists):
The following interface seems unsatisfactory. The first problem is that
<list> is really two things - a condition list or an
explicit list. Another problem is that it's not easy to express the union of
two lists as a list (although it's possible - the problem is that the union of
a condition list and an explicit list set is only awkwardly expressed as a
condition list).
The dual nature of the object makes the interface awkward. Should an
exception be raised if an attempt is made to insert an element into a specified
position in a list which is given by a condition? A priori, probably not; but
allowing this would certainly seem to give rise to implementation problems!
Access to the elements of an explicit list seems problematic. What if
another process deletes an element between the time you determine its position
and when you delete it? Perhaps the delete function should take only a
MathMLElement argument as returned by getElement - this would be the element in
the DOM, so there would be no problem of a changing index.

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.

Attributes

isConditionList

This is true if the <list> is specified using
a condition and false if the <list> is an explicit list.

condition

A MathMLconditionElement that determines the
<list>. Setting this causes isConditionList to
be true. Getting this if the list is an explicit list (if
isConditionList is false) should raise an exception?

nelements

The number of elements if the <list> is an
explicit list. Should this raise an exception if this is a condition list? Even
if the conditions really amount to an explicit list?

Methods

getElement

A convenience method to retrieve an element.

Parameters

index

Position of the element in the list of elements. The first element is
numbered 1.

Return value

The MathMLElement element at position index in the
list.

This method raises no exceptions.

addElement

A convenience method to insert an element.

Parameters

index

The position in the list at which element is to be added.

element

The MathMLElement to be added to the list.

Return value

The MathMLElement being added. This is the new element
within the DOM.

This method raises no exceptions.

deleteElement

A convenience method to delete an element. The deletion may change
the indices of elements occurring after index in the list.

A convenience method to insert a row. If there is already a row at
the specified index, it is replaced.

Parameters

row

MathMLmatrixrowElement
to be inserted into the matrix.

index

Unsigned integer giving the row position at which the row is to be
inserted.

Return value

The MathMLmatrixrowElement added. This is the new element
within the DOM.

This method raises no exceptions.

deleteRow

A convenience method to delete a row. The deletion changes the
indices of the following rows.

Parameters

index

Position of the row to be deleted in the list of rows

Return value

None

This method raises no exceptions.

Issue (matrix-vector):
matrix, matrixrow, and vector
How to we convert between these elements? The specification states that
vectors are equivalent to single column or single row matrices in appropriate
contexts. What about matrixrow's? It would help tremendously to have some form
of compatibility.
Is there any requirement that the number of elements be the same for each
matrixrow of a matrix? If so, do we need exceptions to handle the cases where
there is an attempt to add incompatible rows to a matrix?

The <matrixrow> element is the container
element for the elements of a <matrix>.

Attributes

nelements

The number of elements in the row.

Methods

getElement

A convenience method to retrieve an element by index.

Parameters

index

Position of the element in the row. The first element is
numbered 1.

Return value

The MathMLElement element at index index in the
row.

This method raises no exceptions.

insertElement

A convenience method to insert an element. If there is already an
element at the specified index, it is replaced by the new element.

Parameters

element

The MathMLElement to be inserted in the row.

index

The index at which element is to be inserted in the row.

Return value

The MathMLElement created by the insertion. This is the new
element within the DOM.

This method raises no exceptions.

deleteElement

A convenience method to delete an element. The deletion changes the
indices of the following elements.

Parameters

index

Position of the element to be deleted in the row.

Return value

None

This method raises no exceptions.

Issue (computed-values):
Computed Values
In general, mixing of presentation and content elements in a single
expression is encouraged. Also, I would encourage a bias toward using content
markup as much as possible, even in presentation-only systems. This seems to
mean that we would want computed values for many common constructs. Or should
this be handled in a completely different way?