| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static Element | ensureMathMLDocument(final Document document)
Checks that the given DOM |
| private static Element | extractAnnotationElement(final Element mathmlElement, final String annotationElementLocalName, String encodingAttribute)
|
| public static String | Returns: first matching annotation, or null if not present.Extracts the first textual annotation found having the given encoding attribute from the given MathML math element, if such an annotation is found. |
| public static NodeList | Returns: DOM NodeList corresponding to the child Nodes of the first matching annotation-xml element, or null if no such annotation found.Extracts the first XML-based annotation having the given encoding attribute from the given MathML math element, if such an annotation is found. |
| public static Element | |
| public static boolean | isMathMLElement(final Node
Node to test node)Convenience method to test whether the given DOM |
| public static boolean | isMathMLElement(final Node
Node to test node, final String MathML local name to test for, such as mi or math,
or null to indicate "any name in the MathML namespace". localName)Convenience method to test whether the given DOM |
| public static Document | Returns: new MathML Document with the given structure or null if the given math element is not annotated or does not have the required annotation."Isolates" the XML annotation having the given encoding by producing a copy of the MathML element with only the given annotation contents as children. |
| public static Document | Returns: new MathML Document with the given structure or null if the given wrapper does not have the required annotation.Version of |
| private static Document | |
| private static Document | |
| public static Document | Returns: new MathML Document with the given structure or null if the given math element is not annotated."Isolates" the first <semantics/> branch of an annotation MathML element by producing a copy of the MathML element with a single child containing only the first child of the <semantics/> element. |
| public static Document | Returns: new MathML Document with the given structure or null if the given wrapper has no first branch.Version of |
| public static Document | parseMathMLDocumentString(final String mathmlDocument)
Convenience method that parses a MathML document specified as a UTF-8-encoded String. |
| public static String | serializeDocument(final Document
DOM document to serialize, must not be null document)Convenience method that serializes the given DOM Document as a String (encoded in UTF-8), indenting the results and omitting the XML declaration, which is a reasonable way of serializing a MathML document. |
| public static String | serializeDocument(final Document
DOM document to serialize, must not be null document, final SerializationSpecifier desired SerializationOptions, may be null. serializationOptions)Convenience method that serializes the given DOM Document as a String, using the
specified |
| public static String | serializeDocument(final Document
DOM document to serialize, must not be null document, final SerializationSpecifier desired SerializationOptions, may be null. serializationOptions, StylesheetManager stylesheetManager)Convenience method that serializes the given DOM Document as a String, using the
specified |
| public static String | serializeDocument(final Document
DOM document to serialize, must not be null document, final String desired encoding, null is interpreted as UTF-8. encoding)Convenience method that serializes the given DOM Document as a String, using the specified encoding, indenting the results and omitting the XML declaration, which is a reasonable way of serializing a MathML document. |
| public static String | serializeDocument(final Document
DOM document to serialize, must not be null document, final String desired encoding, null is interpreted as UTF-8. encoding, final boolean indent)Convenience method that serializes the given DOM Document as a String, using the specified encoding and indentation options and omitting the XML declaration, which is a reasonable way of serializing a MathML document. |
| public static String | serializeDocument(final Document
DOM element to serialize document, final boolean whether to indent the results or not indent, final boolean whether to omit the XML declaration or not. omitXMLDeclaration)
Deprecated
Use one of the alternative methods, including
serializeDocument(Document, SerializationSpecifier) for ultimate control.
Convenience method that serializes the given DOM Document as a String (encoded in UTF-8). |
| public static String | serializeDocument(final Document
DOM element to serialize document, final String desired encoding, null is interpreted as UTF-8. encoding, final boolean whether to indent the results or not indent, final boolean whether to omit the XML declaration or not. omitXMLDeclaration)
Deprecated
Use one of the alternative methods, including
serializeDocument(Document, SerializationSpecifier) for ultimate control.
Convenience method that serializes the given DOM Document as a String, using the specified encoding. |
| public static String | serializeElement(final Element
DOM element to serialize, must not be null. element)Convenience method that serializes the given DOM Element as a String (encoded in UTF-8), indenting the results and omitting the XML declaration, which is a reasonable way of serializing MathML. |
| public static String | serializeElement(final Element
DOM element to serialize, must not be null. element, final SerializationSpecifier SerializationSpecifier, may be null.Convenience method that serializes the given DOM Element as a String, using the given
|
| public static String | serializeElement(final Element
DOM element to serialize, must not be null. element, final SerializationSpecifier SerializationSpecifier, may be null.StylesheetManager, must not be nullConvenience method that serializes the given DOM Element as a String, using the given
|
| public static String | serializeElement(final Element
DOM element to serialize element, final String desired encoding, null is interpreted as UTF-8. encoding)Convenience method that serializes the given DOM Element as a String, using the given encoding, indenting the results and omitting the XML declaration, which is a reasonable way of serializing MathML. |
| public static String | serializeElement(final Element
DOM element to serialize element, final boolean whether to indent or not indent)Convenience method that serializes the given DOM Element as a String, indenting if specified and omitting the XML declaration which is a reasonable way of serializing MathML. |
| public static String | serializeElement(final Element
DOM element to serialize element, final boolean whether to indent the results or not indent, final boolean whether to omit the XML declaration or not. omitXMLDeclaration)
Deprecated
Use one of the alternative methods, including
serializeElement(Element, SerializationSpecifier) for ultimate control.
Convenience method that serializes the given DOM Element as a String (encoded in UTF-8). |
| public static String | serializeElement(final Element
DOM element to serialize element, final String desired encoding, null is interpreted as UTF-8. encoding, final boolean whether to indent the results or not indent, final boolean whether to omit the XML declaration or not. omitXMLDeclaration)
Deprecated
Use
serializeElement(Element, SerializationSpecifier) or
serializeElement(Element, SerializationSpecifier, StylesheetManager)
Convenience method that serializes the given DOM Element as a String, using the given parameters. |
| public static String | serializeElement(final Element
DOM element to serialize element, final String desired encoding, null is interpreted as UTF-8. encoding, final boolean whether to indent the results or not indent)Convenience method that serializes the given DOM Element as a String, using the given parameters. |
| private static String | |
| private static String | serializeNode(final Node node, final String encoding, final boolean indent, final boolean omitXMLDeclaration)
|
| private static String | serializeNode(StylesheetManager stylesheetManager, final Node node, final SerializationSpecifier serializationOptions)
|
| public static UnwrappedParallelMathMLDOM | unwrapParallelMathMLDOM(final Element mathElement)
Convenience method to unwrap at MathML DOM Object containing top-level parallel markup, as defined Section 5.3.1 of the MathML 2.0 specification. |
| ANNOTATION_LOCAL_NAME | back to summary |
|---|---|
| public static final String ANNOTATION_LOCAL_NAME | |
| ANNOTATION_XML_LOCAL_NAME | back to summary |
|---|---|
| public static final String ANNOTATION_XML_LOCAL_NAME | |
| MathMLUtilities | back to summary |
|---|---|
| public MathMLUtilities() | |
| ensureMathMLContainer | back to summary |
|---|---|
| public static void ensureMathMLContainer(final Element mathElement) | |
| ensureMathMLDocument | back to summary |
|---|---|
| public static Element ensureMathMLDocument(final Document document) Checks that the given DOM | |
| extractAnnotationElement | back to summary |
|---|---|
| private static Element extractAnnotationElement(final Element mathmlElement, final String annotationElementLocalName, String encodingAttribute) | |
| extractAnnotationString | back to summary |
|---|---|
| public static String extractAnnotationString(final Element mathElement, final String encodingAttribute) Extracts the first textual annotation found having the given encoding attribute from the given MathML math element, if such an annotation is found. This assumes the following structure:
<math>
<semantics>
...
<annotation encoding="...">text</annotation>
</semantics>
</math>
| |
| extractAnnotationXML | back to summary |
|---|---|
| public static NodeList extractAnnotationXML(final Element mathElement, final String encodingAttribute) Extracts the first XML-based annotation having the given encoding attribute from the given MathML math element, if such an annotation is found. This assumes the following structure:
<math>
<semantics>
...
<annotation-xml encoding="...">XML annotation</annotation>
</semantics>
</math>
| |
| extractFirstSemanticsBranch | back to summary |
|---|---|
| public static Element extractFirstSemanticsBranch(final Element mathElement) | |
| isMathMLElement | back to summary |
|---|---|
| public static boolean isMathMLElement(final Node node) Convenience method to test whether the given DOM
| |
| isMathMLElement | back to summary |
|---|---|
| public static boolean isMathMLElement(final Node node, final String localName) Convenience method to test whether the given DOM
| |
| isolateAnnotationXML | back to summary |
|---|---|
| public static Document isolateAnnotationXML(final Element mathElement, final String encodingAttribute) "Isolates" the XML annotation having the given encoding by producing a copy of the MathML element with only the given annotation contents as children. For example:
<math>
<semantics>
<mi>x</mi>
<annotation-xml encoding='blah'><x/></annotation-xml>
</semantics>
</math>
results in:
<math>
<x/>
</math>
| |
| isolateAnnotationXML | back to summary |
|---|---|
| public static Document isolateAnnotationXML(final UnwrappedParallelMathMLDOM unwrappedDOM, final String encodingAttribute) Version of
| |
| isolateDescendant | back to summary |
|---|---|
| private static Document isolateDescendant(final Element mathElement, final NodeList descendants) | |
| isolateDescendant | back to summary |
|---|---|
| private static Document isolateDescendant(final Element mathElement, final Element descendant) | |
| isolateFirstSemanticsBranch | back to summary |
|---|---|
| public static Document isolateFirstSemanticsBranch(final Element mathElement) "Isolates" the first <semantics/> branch of an annotation MathML element by producing a copy of the MathML element with a single child containing only the first child of the <semantics/> element. For example:
<math>
<semantics>
<mi>x</mi>
<annotation-xml encoding='blah'><x/></annotation-xml>
</semantics>
</math>
results in:
<math>
<mi>x</mi>
</math>
| |
| isolateFirstSemanticsBranch | back to summary |
|---|---|
| public static Document isolateFirstSemanticsBranch(final UnwrappedParallelMathMLDOM unwrappedDOM) Version of
| |
| parseMathMLDocumentString | back to summary |
|---|---|
| public static Document parseMathMLDocumentString(final String mathmlDocument) throws IOException, SAXException Convenience method that parses a MathML document specified as a UTF-8-encoded String. | |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document) Convenience method that serializes the given DOM Document as a String (encoded in UTF-8), indenting the results and omitting the XML declaration, which is a reasonable way of serializing a MathML document.
| |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document, final SerializationSpecifier serializationOptions) Convenience method that serializes the given DOM Document as a String, using the
specified
| |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document, final SerializationSpecifier serializationOptions, StylesheetManager stylesheetManager) Convenience method that serializes the given DOM Document as a String, using the
specified
| |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document, final String encoding) Convenience method that serializes the given DOM Document as a String, using the specified encoding, indenting the results and omitting the XML declaration, which is a reasonable way of serializing a MathML document. | |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document, final String encoding, final boolean indent) Convenience method that serializes the given DOM Document as a String, using the specified encoding and indentation options and omitting the XML declaration, which is a reasonable way of serializing a MathML document. | |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document, final boolean indent, final boolean omitXMLDeclaration)
Deprecated Use one of the alternative methods, including
Convenience method that serializes the given DOM Document as a String (encoded in UTF-8).
| |
| serializeDocument | back to summary |
|---|---|
| public static String serializeDocument(final Document document, final String encoding, final boolean indent, final boolean omitXMLDeclaration)
Deprecated Use one of the alternative methods, including
Convenience method that serializes the given DOM Document as a String, using the specified encoding.
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element) Convenience method that serializes the given DOM Element as a String (encoded in UTF-8), indenting the results and omitting the XML declaration, which is a reasonable way of serializing MathML.
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final SerializationSpecifier serializationOptions) Convenience method that serializes the given DOM Element as a String, using the given
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final SerializationSpecifier serializationOptions, StylesheetManager stylesheetManager) Convenience method that serializes the given DOM Element as a String, using the given
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final String encoding) Convenience method that serializes the given DOM Element as a String, using the given encoding, indenting the results and omitting the XML declaration, which is a reasonable way of serializing MathML. | |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final boolean indent) Convenience method that serializes the given DOM Element as a String, indenting if specified and omitting the XML declaration which is a reasonable way of serializing MathML.
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final boolean indent, final boolean omitXMLDeclaration)
Deprecated Use one of the alternative methods, including
Convenience method that serializes the given DOM Element as a String (encoded in UTF-8).
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final String encoding, final boolean indent, final boolean omitXMLDeclaration)
Deprecated Use Convenience method that serializes the given DOM Element as a String, using the given parameters.
| |
| serializeElement | back to summary |
|---|---|
| public static String serializeElement(final Element element, final String encoding, final boolean indent) Convenience method that serializes the given DOM Element as a String, using the given parameters. (This can be used in more general cases than MathML, through experienced programmers may want more control over what happens here.) | |
| serializeNode | back to summary |
|---|---|
| private static String serializeNode(final Node node, final SerializationSpecifier serializationOptions) | |
| serializeNode | back to summary |
|---|---|
| private static String serializeNode(final Node node, final String encoding, final boolean indent, final boolean omitXMLDeclaration) | |
| serializeNode | back to summary |
|---|---|
| private static String serializeNode(StylesheetManager stylesheetManager, final Node node, final SerializationSpecifier serializationOptions) | |
| unwrapParallelMathMLDOM | back to summary |
|---|---|
| public static UnwrappedParallelMathMLDOM unwrapParallelMathMLDOM(final Element mathElement) Convenience method to unwrap at MathML DOM Object containing top-level parallel markup, as defined Section 5.3.1 of the MathML 2.0 specification. If there is no parallel markup detected then null if returned.
If the given element is null or is not a MathML "math" element, then an | |