MathML and OpenMath are closely related, serving a similar purpose of conveying mathematics across different applications. The aim of this analysis is to relate MathML and OpenMath to illustrate their similarities and differences. We intend it to be application independent, highlighting the problems arising when developing programs translating MathML to OpenMath and vice versa.
As is stated in the OpenMath standard [4], OpenMath objects have the expressive power to cover all areas of computational mathematics. This is certainly not the case with MathML. However, MathML was designed to be displayed on any MathML compliant renderer. The possibility to translate between them would allow OpenMath objects to be displayed, and MathML objects have a wider semantic scope. But is a translation possible?
OpenMath and MathML have many common aspects. Some features of the standards help facilitate the translation, mainly that the structure of both standards is very similar. They both use prefix operators and are XML [10] based. They both construct their objects by applying certain rules recursively. Such similarities facilitate mapping across both standards.
Because both standards are XML based, their syntax is governed by the rules of XML syntax. In other words, the details of using tags, attributes, entity references and so on are defined in the XML language specification. By complying with the XML standard it is possible to use generic XML generators and validators. These can be programmed for the application being developed, or existing ones can be used3.1.
Finally, OpenMath has specific content dictionaries mirroring MathML's semantic scope, which permit a straightforward mapping between both recommendations. Since both standards are simply different ways of representing mathematics, designed with translation in mind, mapping one to the other is certainly possible.
We shall look at all the areas of both recommendations where differences occur and how they pose difficulties to designing a translator. It is important to understand how objects are constructed and what they represent. We will then discuss how functions and operators are applied on their arguments. There are various specific structural differences between both standards which need to be properly understood; we will attempt to explain these differences and offer a method of translation for each one. We will also discuss how MathML supports extensibility and to what extent it is possible to implement such extensibility to accept new OpenMath symbols. To finish we will give an explanation of how to handle the translation problem.
Before we start our analysis, it is important that we define a few terms related to our analysis. We also encourage the reader to have a look at the standards in order to better appreciate this analysis. MathML and OpenMath objects convey the meaning of a mathematical expression and are represented as labelled trees. An object can also be called an expression. A symbol in OpenMath is used to represent a mathematical concept. For instance plus or max are considered symbols. We call elements the words enclosed within <> such as <apply> or <OMA>. Elements enclose other XML data called their `content' between a `start tag' (sometimes called a `begin tag') and an `end tag', much like in HTML. There are also `empty elements' such as <plus/>, whose start tag ends with /> to indicate that the element has no content or end tag.