public class MathMLUpConverter extends Object
UpConvertingPostProcessor to the List returned by
DOMOutputOptions.getDOMPostProcessors().
Document to
UpConversionUtilities.extractUpConversionFailures(Document), to get a List
of UpConversionFailure Objects that can be inspected further.
StylesheetCache to integrate with your own caching mechanism.
| Modifier and Type | Field and Description |
|---|---|
static String |
ASCIIMATH_INPUT_ANNOTATION_NAME |
static String |
BRACKETED_PRESENTATION_MATHML_ANNOTATION_NAME |
static String |
CONTENT_FAILURES_ANNOTATION_NAME |
static String |
CONTENT_MATHML_ANNOTATION_NAME |
static String |
LATEX_ANNOTATION_NAME |
static String |
MAXIMA_ANNOTATION_NAME |
static String |
MAXIMA_FAILURES_ANNOTATION_NAME |
static String |
SNUGGLETEX_ANNOTATION_NAME |
| Constructor and Description |
|---|
MathMLUpConverter()
Creates a new up-converter using a simple internal cache, hard-coded to use Saxon for
XSLT 2.0 support.
|
MathMLUpConverter(StylesheetCache stylesheetCache)
Creates a new up-converter using the given
StylesheetCache to cache internal XSLT
stylesheets, hard-coded to use Saxon for XSLT 2.0 support. |
MathMLUpConverter(StylesheetManager stylesheetManager)
Creates a new up-converter using the given
StylesheetManager for managing XSLT
stylesheets and stuff. |
MathMLUpConverter(TransformerFactoryChooser transformerFactoryChooser,
StylesheetCache stylesheetCache)
Creates a new up-converter using the given
TransformerFactoryChooser and
StylesheetCache to cache internal XSLT stylesheets. |
| Modifier and Type | Method and Description |
|---|---|
Document |
upConvertASCIIMathML(Document asciiMathMLDocument,
UpConversionOptions upConversionOptions)
Up-converts the ASCIIMathML output represented by the given
Document. |
Document |
upConvertASCIIMathML(String rawASCIIMathML,
UpConversionOptions upConversionOptions)
Convenience version of
upConvertASCIIMathML(Document, UpConversionOptions) that
takes the raw ASCIIMathML as a String. |
Document |
upConvertSnuggleTeXMathML(Document document,
UpConversionOptions upConversionOptions)
Up-converts the SnuggleTeX XHTML output Document (assumed to contain islands of MathML),
creating a new result
Document. |
public static final String SNUGGLETEX_ANNOTATION_NAME
public static final String LATEX_ANNOTATION_NAME
public static final String BRACKETED_PRESENTATION_MATHML_ANNOTATION_NAME
public static final String CONTENT_MATHML_ANNOTATION_NAME
public static final String CONTENT_FAILURES_ANNOTATION_NAME
public static final String MAXIMA_ANNOTATION_NAME
public static final String MAXIMA_FAILURES_ANNOTATION_NAME
public static final String ASCIIMATH_INPUT_ANNOTATION_NAME
public MathMLUpConverter()
Use this constructor if you don't use XSLT yourself. In this case, you'll want your instance of this class to be reused as much as possible to get the benefits of caching.
public MathMLUpConverter(StylesheetCache stylesheetCache)
StylesheetCache to cache internal XSLT
stylesheets, hard-coded to use Saxon for XSLT 2.0 support.
Use this constructor if you do your own XSLT caching that you want to integrate in, or if the default doesn't do what you want.
public MathMLUpConverter(TransformerFactoryChooser transformerFactoryChooser, StylesheetCache stylesheetCache)
TransformerFactoryChooser and
StylesheetCache to cache internal XSLT stylesheets.
Use this constructor if you do your own XSLT caching that you want to integrate in, or if the default doesn't do what you want and/or if you want to override the choice of Saxon for XSLT 2.0 support (which is currently a bad idea!)
transformerFactoryChooser - TransformerFactoryChooser to use, which must not
be null.stylesheetCache - StylesheetCache to use, which may be null to avoid caching.public MathMLUpConverter(StylesheetManager stylesheetManager)
StylesheetManager for managing XSLT
stylesheets and stuff.public Document upConvertSnuggleTeXMathML(Document document, UpConversionOptions upConversionOptions)
Document.document - DOM Document, assumed to have been generated by
SnuggleSession.buildDOMSubtree() or similar.upConversionOptions - UpConversionOptions to use, or null to
use defaults.public Document upConvertASCIIMathML(Document asciiMathMLDocument, UpConversionOptions upConversionOptions)
Document. This
would normally consist of a single MathML element, but can be arbitrary XML containing
MathML islands.asciiMathMLDocument - DOM Document, assumed to have been generated by
ASCIIMathMLupConversionOptions - UpConversionOptions to use, or null to
use defaults.public Document upConvertASCIIMathML(String rawASCIIMathML, UpConversionOptions upConversionOptions)
upConvertASCIIMathML(Document, UpConversionOptions) that
takes the raw ASCIIMathML as a String. You would normally extract this from ASCIIMathML
using some of our JavaScript helper functions.rawASCIIMathML - ASCIIMathML output stringupConversionOptions - UpConversionOptions to use, or null to
use defaults.Copyright © 2008–2026 The University of Edinburgh. All rights reserved.