### 2.7.4 Translating an expression to MathML

The mathml command translates expressions to MathML.

- mathml takes expr, an expression.
- mathml(expr) returns the result of evaluating expr written in MathML.

##### Remark.

mathml is a legacy export command; a more complete translation to MathML is provided by the export_mathml command (see Section 2.7.7). The latter is useful if you need quality rendering of giac/Xcas output for your web pages.

#### Example

mathml(1/4+1/4)

<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <math mode="display" xmlns="http://www.w3.org/1998/Math/MathML"> <mfrac><mrow><mn>1</mn></mrow><mrow><mn>2</mn></mrow></mfrac> </math><br/> </body> </html>

This is the number 1/2 in MathML form, along with enough information to make it a complete HTML document.