be.ugent.caagt.jmathtex.mathml
Class MathMLParser
java.lang.Object
be.ugent.caagt.jmathtex.mathml.MathMLParser
public class MathMLParser
extends java.lang.Object
Provides various static methods for parsing MathML input from a file to a
TeXFormula
.
JDOM is used for parsing. For each "parse" method found here, there's a
corresponding "build" method in the class
org.jdom.input.SaxBuilder
.
For more information, see
http://jdom.org
.
protected static TeXFormula | createSpace(String[] attr)
|
protected static Color | getColor(String s)
|
protected static List | getFormulaList(List l, be.ugent.caagt.jmathtex.mathml.Environment env)
|
protected static Object | getUnicodeMapping(char unicode)
|
static TeXFormula | parse(File file, boolean validate) - Parses a MathML input file identified by a
File .
|
static TeXFormula | parse(InputStream stream, String uri, boolean validate) - Parses MathML input from the specified
InputStream and URI base.
|
static TeXFormula | parse(InputStream stream, boolean validate) - Parses MathML input from the specified
InputStream .
|
static TeXFormula | parse(Reader reader, String uri, boolean validate) - Parses MathML input from the specified
Reader and URI base.
|
static TeXFormula | parse(Reader reader, boolean validate) - Parses MathML input from the specified
Reader .
|
static TeXFormula | parse(String uri, boolean validate) - Parses a MathML input file identified by the specified URI.
|
static TeXFormula | parse(URL url, boolean validate) - Parses a MathML input file identified by the specified URL.
|
getFormulaList
protected static List getFormulaList(List l,
be.ugent.caagt.jmathtex.mathml.Environment env)
throws MathMLException
getUnicodeMapping
protected static Object getUnicodeMapping(char unicode)
parse
public static TeXFormula parse(File file,
boolean validate)
throws MathMLException,
IOException
Parses a MathML input file identified by a File
.
file
- identifies the file to read fromvalidate
- whether the input file should be validated first
parse
public static TeXFormula parse(InputStream stream,
String uri,
boolean validate)
throws MathMLException,
IOException
Parses MathML input from the specified InputStream
and URI base.
stream
- the stream to read fromuri
- base for resolving relative URI'svalidate
- whether the input file should be validated first
parse
public static TeXFormula parse(InputStream stream,
boolean validate)
throws MathMLException,
IOException
Parses MathML input from the specified InputStream
.
stream
- the stream to read fromvalidate
- whether the input file should be validated first
parse
public static TeXFormula parse(Reader reader,
String uri,
boolean validate)
throws MathMLException,
IOException
Parses MathML input from the specified Reader
and URI base.
reader
- the Reader
to read fromuri
- base for resolving relative URI'svalidate
- whether the input file should be validated first
parse
public static TeXFormula parse(Reader reader,
boolean validate)
throws MathMLException,
IOException
Parses MathML input from the specified Reader
.
reader
- the Reader
to read fromvalidate
- whether the input file should be validated first
parse
public static TeXFormula parse(String uri,
boolean validate)
throws MathMLException,
IOException
Parses a MathML input file identified by the specified URI.
uri
- identifies the file to read fromvalidate
- whether the input file should be validated first
parse
public static TeXFormula parse(URL url,
boolean validate)
throws MathMLException,
IOException
Parses a MathML input file identified by the specified URL.
url
- identifies the file to read fromvalidate
- whether the input file should be validated first