"MathMLExpression" (Interpreter Type)
"MathMLExpression" (Interpreter Type)
MathML input.
Details
- "MathMLExpression" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "MathMLExpression" does not require connectivity to the Wolfram Cloud.
Restriction Specifications
-
Restricted["MathMLExpression",{{choice1,…}}] one among choices Restricted["MathMLExpression",symbols] a MathML expression involving only the given symbols (All, Automatic, or an explicit list) Restricted["MathMLExpression",symbols,contexts] a MathML expression involving only the given symbols or symbols in the given contexts (All, Automatic, or an explicit list) Restricted["MathMLExpression",symbols,contexts,resultcontext] a MathML expression involving only the given symbols or symbols in the given contexts, where the new symbols are created in resultcontext
Interpretation
- "MathMLExpression" yields a representation of the MathML expression in the Wolfram Language.
Examples
Basic Examples (6)
Interpreter["MathMLExpression"]["<math><mrow><mi>sin</mi><mo>⁡</mo><mo>(</mo><mi>x</mi><mo>)</mo></mrow></math>"]Interpreter["MathMLExpression"]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Restrict to a list of choices:
Interpreter[Restricted["MathMLExpression", {{3, 4}}]]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Interpreter[Restricted["MathMLExpression", {{True, False}}]]["<math><mrow><mi>x</mi><mo>+</mo><msup><mi>ⅇ</mi><mi>y</mi></msup></mrow></math>"]By default, all symbols are allowed. Restrict to a list of allowed symbols:
Interpreter[Restricted["MathMLExpression", {Plus}]]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Interpreter[Restricted["MathMLExpression", {Plus}]]["<math><mrow><mn>2</mn><mo>*</mo><mn>2</mn></mrow></math>"]By default, new symbols are created in $Context, but a custom context can be specified:
var = Interpreter[Restricted["MathMLExpression", Automatic, Automatic, Automatic]]["<math><mrow><mn>x</mn></mrow></math>"]
Context[Evaluate[var]]var = Interpreter[Restricted["MathMLExpression", Automatic, Automatic, "mycontext`"]]["<math><mrow><mn>x</mn></mrow></math>"]
Context[Evaluate[var]]Specify contexts for the allowed and output symbols:
Global`x = 10;
Interpreter[Restricted["MathMLExpression", Automatic, {"Global`", "System`"}, "Global`"]]["<math><mrow><mn>x</mn></mrow></math>"]Prevent the creation of any new symbol:
Interpreter[Restricted["MathMLExpression", Automatic, Automatic, None]]["<math><mrow><mn>2</mn><mo>+</mo><mn>2</mn></mrow></math>"]Interpreter[Restricted["MathMLExpression", Automatic, Automatic, None]]["<math><mrow><mn>z</mn><mo>+</mo><mn>2</mn></mrow></math>"]See Also
MathMLForm Interpreter Restricted Failure
Interpreter Types: HeldMathMLExpression InactiveMathMLExpression TeXExpression HeldTeXExpression InactiveTeXExpression
Related Guides
History
Introduced in 2016 (10.4)