Name
cx:mathml-to-svg — Draws diagrams with mathml-to-svg.
Synopsis
This step uses JEuclid to convert MathML to SVG.
Input port | Primary | Sequence | Content types |
---|---|---|---|
source | ✔ | xml |
Output port | Primary | Sequence | Content types |
---|---|---|---|
result | ✔ |
Option name | Type | Default value |
---|---|---|
parameters | map(xs:QName, item()*)? | () |
<p:import href="https://xmlcalabash.com/ext/library/diagramming.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:input port="source" content-types="xml"/>
| <p:output port="result"/>
| <p:option name="parameters" as="map(xs:QName, item()*)?"/>
5 |</p:declare-step>
Description
The cx:mathml-to-svg
step uses
JEuclid to convert
MathML to SVG.
The actual implementation used is version 3.1.14 of a modern fork of JEuclid that supports recent versions of Java and the underlying Batik libraries.
Example
The equation rendered in Figure 1, “Example MathML converted to SVG” is one of the more interesting (looking) examples from the Mozilla MathML torture test.
Correct rendering of Figure 1, “Example MathML converted to SVG” relies on support for SVG in your user agent. If your user agent also supports MathML, it can render the equation directly, as (possibly) shown in Figure 2, “Example MathML”.
Dependencies
This step is included in the XML Calabash application. If you are getting XML Calabash from Maven, you will also need to include the extension dependency:
com.xmlcalabash:diagramming:3.0.0-alpha23
The following third-party dependencies will also be included transitively:
net.sourceforge.plantuml:plantuml:1.2025.0
de.rototor.jeuclid:jeuclid-core:3.1.14
ditaa0.9.jar
, included in the XML Calabash extension because it’s not available through Maven.