2.0

2.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 74.4 KB File ID: #7709

MathML import/export

by Michael Weitzel

 

23 May 2005 (Updated 01 Sep 2006)

Java class library and MATLAB scripts for MathML import/export.

| Watch this File

File Information
Description

A small Java class library with three supporting MATLAB scripts for importing Content-MathML declarations (values, vectors, matrices and function handles (aka lambda expressions)) into the MATLAB workspace. The library supports exporting MATLAB data into Content- and Presentation-MathML.

% Initialize the Java Classpath for the MathML parser and check the installation
> MathMLInit;

% Import all contents of the GZIP-compressed MathML file test1.xml.gz into a
% cell array 'mml_defs':
> mml_defs = MathMLImport('test1.xml.gz');

% Import all MathML declarations of which name matches a regular expression
> mml_defs = MathMLImport('test2.xml', '[Mm]onkey[0-9A-Z]');

% Import all MathML declarations of a MathML file into the current workspace
> MathMLImport('test3.xml');

% Export variable A into the GZIP-compressed Content-MathML file test.xml.gz
> MathMLExport('test.xml.gz', 'c', 'A');

% Export variables A and B into the Presentation-MathML file test1.xml
> MathMLExport('test1.xml', 'p', 'A', 'B');

% Export variable A and B into the Content-MathML file test2.xml with embedded
% Presentation-MathML:
> MathMLExport('test2.xml', 'cp', 'A', 'B');

% Export variable A, B and C into the Presentation-MathML file test3.xml with
% embedded Content-MathML:
> MathMLExport('test3.xml', 'pc', 'A', 'B', 'C');

For Java source codes and more information see http://www.simtec.mb.uni-siegen.de/~weitzel/mathml.php

MATLAB release MATLAB 7 (R14)
Other requirements J2SE 5.0 (Java 1.5.x) runtime environment or newer. Alternatively (Java 1.4.x) Xerces DOM-L3 JARs from http://xml.apache.org/.
Tags for This File  
Everyone's Tags
contentmathml, data, data export, data import, export, import, java, mathml, utilities
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
12 Dec 2006 Richard Stephens

The idea is good and it works successfully for a small subset of MathML. The installation instructions are incomplete (e.g. it does not mention editing file MathMLInit.m to enter the pathname for the .jar file).
Once installed it imports very few functions for example <exp/> and <exponentiale/> are not supported according to the error messages.

Updates
30 Aug 2005

Updates & Corrections

01 Sep 2006

Minor bugfixes, stricter parsing, support for boolean operators

Contact us