A Beginner's Guide to MathML
We're going to approach MathML one aspect at a time, but it's nice to know what we're aiming for in the end so we'll start by having a look at a simple example:
Boxes such as the one below show what the MathML examples above should look like.
There's not too much to say here except to note that the root element in MathML is the <math> element. It must always be present and enclose the entire MathML content. Whether you need to include the 'xmlns' definition depends on how you are using MathML (see the last section on Using MathML). I will neglect the <math> tag in examples for the sake of brevity.
If this is your first encounter with MathML, perhaps coming from a Latex background or similar, then the example may seem somewhat verbose for such a simple equation. This is primarily due to the fact that XML is designed to be absolutley unambiguous in its meaning. While giving you complete control over any expression, regardless of its rarity or complexity, this also makes simple expressions more cumbersome.
Using a text editor which auto-completes XML tags for you will definitely make life easier.