public class MathMLUpConverter
extends java.lang.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.
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
ASCIIMATH_INPUT_ANNOTATION_NAME |
static java.lang.String |
BRACKETED_PRESENTATION_MATHML_ANNOTATION_NAME |
static java.lang.String |
CONTENT_FAILURES_ANNOTATION_NAME |
static java.lang.String |
CONTENT_MATHML_ANNOTATION_NAME |
static java.lang.String |
LATEX_ANNOTATION_NAME |
static java.lang.String |
MAXIMA_ANNOTATION_NAME |
static java.lang.String |
MAXIMA_FAILURES_ANNOTATION_NAME |
static java.lang.String |
SNUGGLETEX_ANNOTATION_NAME |
| 构造器和说明 |
|---|
MathMLUpConverter()
Creates a new up-converter using a simple internal cache, hard-coded to use Saxon for
XSLT 2.0 support.
|
MathMLUpConverter(uk.ac.ed.ph.snuggletex.utilities.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(uk.ac.ed.ph.snuggletex.utilities.StylesheetManager stylesheetManager)
Creates a new up-converter using the given
StylesheetManager for managing XSLT
stylesheets and stuff. |
MathMLUpConverter(uk.ac.ed.ph.snuggletex.utilities.TransformerFactoryChooser transformerFactoryChooser,
uk.ac.ed.ph.snuggletex.utilities.StylesheetCache stylesheetCache)
Creates a new up-converter using the given
TransformerFactoryChooser and
StylesheetCache to cache internal XSLT stylesheets. |
| 限定符和类型 | 方法和说明 |
|---|---|
org.w3c.dom.Document |
upConvertASCIIMathML(org.w3c.dom.Document asciiMathMLDocument,
UpConversionOptions upConversionOptions)
Up-converts the ASCIIMathML output represented by the given
Document. |
org.w3c.dom.Document |
upConvertASCIIMathML(java.lang.String rawASCIIMathML,
UpConversionOptions upConversionOptions)
Convenience version of
upConvertASCIIMathML(Document, UpConversionOptions) that
takes the raw ASCIIMathML as a String. |
org.w3c.dom.Document |
upConvertSnuggleTeXMathML(org.w3c.dom.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 java.lang.String SNUGGLETEX_ANNOTATION_NAME
public static final java.lang.String LATEX_ANNOTATION_NAME
public static final java.lang.String BRACKETED_PRESENTATION_MATHML_ANNOTATION_NAME
public static final java.lang.String CONTENT_MATHML_ANNOTATION_NAME
public static final java.lang.String CONTENT_FAILURES_ANNOTATION_NAME
public static final java.lang.String MAXIMA_ANNOTATION_NAME
public static final java.lang.String MAXIMA_FAILURES_ANNOTATION_NAME
public static final java.lang.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(uk.ac.ed.ph.snuggletex.utilities.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(uk.ac.ed.ph.snuggletex.utilities.TransformerFactoryChooser transformerFactoryChooser,
uk.ac.ed.ph.snuggletex.utilities.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(uk.ac.ed.ph.snuggletex.utilities.StylesheetManager stylesheetManager)
StylesheetManager for managing XSLT
stylesheets and stuff.public org.w3c.dom.Document upConvertSnuggleTeXMathML(org.w3c.dom.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 org.w3c.dom.Document upConvertASCIIMathML(org.w3c.dom.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 org.w3c.dom.Document upConvertASCIIMathML(java.lang.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.