Package org.jboss.elemento.mathml
Overview
This package enables creation of MathML elements for rendering mathematical notation in web applications. MathML elements are
created using factory methods in the MathML class and follow the same fluent builder pattern
as HTML elements in Elemento's core package.
Creating MathML Elements
Use the static methods in MathML to create MathML elements:
import static org.jboss.elemento.mathml.MathML.*;
// Create a MathML element
MathMLElement element = mathml()
.add(mi().text("x"))
.add(mo().text("="))
.add(mn().text("42"))
.element();
Builder API
The package provides two main builder types:
MathMLElementBuilder- for simple MathML elementsMathMLContainerMethods- for container elements that can hold children
All builders support common operations through method interfaces like MathMLElementStyleMethods
for style manipulation and standard builder methods for element configuration.
Element Creation
The MathML class provides factory methods for creating MathML elements:
MathML.mathml()- create the root<math>elementMathML.mathMLElement(String, Class)- create any MathML element by tag nameMathML.mathMLContainer(String, Class)- create a container MathML elementMathML.wrapMathMLElement(MathMLElement)- wrap an existing MathML elementMathML.wrapMathMLContainer(MathMLElement)- wrap an existing MathML container
MathML Namespace
All MathML elements are created in the MathML namespace (http://www.w3.org/1998/Math/MathML). The
MathMLElement class defines this namespace constant and provides access to common MathML
properties like className, dataset, displaystyle, style, and tabIndex.
- See Also:
-
ClassDescriptionMathMLContainerMethods<E extends MathMLElement>Builder for container-like SVG elements.All the MAthML DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface.MathMLElementBuilder<E extends MathMLElement>Builder for simple SVG elements.Provides methods and default implementations for modifying MathML elements.