MathML.h File Reference

Detailed Description

Utilities for reading and writing MathML to/from text strings.

Author:
Ben Bornstein
Include dependency graph for MathML.h:
This graph shows which files directly or indirectly include this file:

Functions

ASTNode_t * readMathMLFromString (const char *xml)
 Reads the MathML from the given XML string, constructs a corresponding abstract syntax tree, and returns a pointer to the root of the tree.
char * writeMathMLToString (const ASTNode_t *node)
 Writes the given ASTNode (and its children) to a string as MathML, and returns the string.

Function Documentation

ASTNode_t* readMathMLFromString ( const char *  xml)

Reads the MathML from the given XML string, constructs a corresponding abstract syntax tree, and returns a pointer to the root of the tree.

Parameters:
xmla string containing a full MathML expression
Returns:
the root of an AST corresponding to the given mathematical expression, otherwise NULL is returned if the given string is NULL or invalid.

Reads the MathML from the given XML string, constructs a corresponding abstract syntax tree, and returns a pointer to the root of the tree.

The content given as the string xml should be a complete, self-contained MathML formula, enclosed by <math xmlns="http://www.w3.org/1998/Math/MathML"> and </math> tags.

Parameters:
xmlthe MathML to be converted, stored in a character string.
Returns:
an ASTnode (the root of the AST representing the mathematical formula in the given XML string), otherwise NULL is returned if the given string is NULL or invalid.
char* writeMathMLToString ( const ASTNode_t *  node)

Writes the given ASTNode (and its children) to a string as MathML, and returns the string.

Parameters:
nodethe root of an AST to write out to the stream.
Returns:
a string containing the written-out MathML representation of the given AST.
Note:
The string is owned by the caller and should be freed (with free()) when no longer needed. NULL is returned if the given argument is NULL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines