The Wayback Machine - https://web.archive.org/web/20110225010921/http://www.mathworks.com:80/matlabcentral/fileexchange/7709-mathml-importexport

2.0

2.0 | 1 rating Rate this file 10 downloads (last 30 days) File Size: 74.36 KB File ID: #7709

MathML import/export

by Michael Weitzel

 

23 May 2005 (Updated 01 Sep 2006)

No BSD License  

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

Download Now | 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/.
Zip File Content  
Other Files MathMLIO-0.2/MathMLIO.jar,
MathMLIO-0.2/MathMLIO_src.zip,
MathMLIO-0.2/LICENSE,
MathMLIO-0.2/README,
MathMLIO-0.2/MathMLExport.m,
MathMLIO-0.2/MathMLImport.m,
MathMLIO-0.2/MathMLInit.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
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.

Please login to add a comment or rating.
Updates
30 Aug 2005

Updates & Corrections

01 Sep 2006

Minor bugfixes, stricter parsing, support for boolean operators

Tag Activity for this File
Tag Applied By Date/Time
data import Michael Weitzel 22 Oct 2008 07:49:06
data export Michael Weitzel 22 Oct 2008 07:49:06
mathml Michael Weitzel 22 Oct 2008 07:49:06
java Michael Weitzel 22 Oct 2008 07:49:06
contentmathml Michael Weitzel 22 Oct 2008 07:49:06
export Michael Weitzel 22 Oct 2008 07:49:06
import Michael Weitzel 22 Oct 2008 07:49:06
data Michael Weitzel 22 Oct 2008 07:49:06
utilities Michael Weitzel 22 Oct 2008 07:49:06

Contact us at files@mathworks.com