Simple demonstration of how to use some of the utilities within SnuggleTeX to up-convert
some raw MathML extracted from ASCIIMathML.
(You can do the same with the raw MathML produced by SnuggleTeX as well; you just have to
call a MathMLUpConverter#upConvertSnuggleTeXMathML(Document, UpConversionOptions)) instead of the
method for SnuggleTeX. When using SnuggleTeX normally, all of this can be invoked during
the snuggling process by adding a UpConvertingPostProcessor to the List returned
by DOMOutputOptions#getDOMPostProcessors().)
Running Notes
You will need the following in your ClassPath:
- snuggletex-core.jar
- snuggletex-upconversion.jar
- saxon9.jar, saxon9-dom.jar (These are required as the conversion process uses XSLT 2.0)
If you're already using XSLT 1.0 in your application and
don't want your
existing XSLT to run using SAXON (which is hard to justify, IMO, as SAXON is superior to other
XSLT processors in most respects) then you might find that SAXON becomes your JAXP default
processor, which you can override as you require as it is invoked here explicitly, rather than
using
TransformerFactory#newInstance().