math:mfenced (in formatting mode) — Represents an expression enclosed by fences and separated by operators.
<xsl:template match="math:mfenced" mode="formatting"> <xsl:param name="x"/> <xsl:param name="y"/> <xsl:param name="baseline" select="0"/> ... </xsl:template>
mfenced
is an element that can be replaced by a mrow
composed of two or more mo
elements and its children. For example
Example 5. mfenced: original code
<mfenced open="[" close="]" separators=";|"> <mn>1</mn> <mn>2</mn> <mn>3</mn> </mfenced>
can be replaced by:
Example 6. mfenced: replacement code
<mrow> <mo fence="true">[</mo> <mn>1</mn> <mo separator="true">;</mo> <mn>2</mn> <mo separator="true">|</mo> <mn>3</mn> <mo fence="true">]</mo> </mrow>
This example will render like that, with:
We can see in this example the three optionnal arguments of mfenced
:
open
Determines the opening fence of the expression. The default value is ( .
close
Determines the closing fence of the expression. The default value is ) .
separators
Determines a sequence of one character separator that will be used to separate each children of mfenced
.
The default value is
,
. If there are not enoough separators to separate each child, the last one is
repeated.
The formatting mode will transform the mfenced
element into an mrow
as mentionned
above, and finally call the formatting mode of the mrow
on it. First, all attributes are retrieved and
spaces in separators
atribute are deleted. A mrow
node is created containing the
opening and the closing mo
and a composition of children and separators. This composition is done
calling the mfencedCompose
template. This template takes two arguments: the child nodes and the
separators
string attribute without space.
Finally, the formatting mode of the newly created mrow
is called to compute and annotate it.