Class MathMLSerializer


  • @ThreadSafe
    public final class MathMLSerializer
    extends java.lang.Object
    Utility class to serialize DOM documents back into Strings.

    This class can be used to generate String representations for an existing DOM Tree. The functionality is not restricted to JEuclid, and can be used for other DOM trees as well. In this case, you should set the addDoctype parameter to false.

    Version:
    $Revision: 02abc0c8a7d0 $
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String serializeDocument​(org.w3c.dom.Node doc, boolean addDoctype, boolean format)
      Serialize a document back into a String.
      static java.lang.String serializeDocument​(org.w3c.dom.Node doc, boolean addDoctype, boolean format, boolean omitXMLDecl)
      Serialize a document back into a String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • serializeDocument

        public static java.lang.String serializeDocument​(org.w3c.dom.Node doc,
                                                         boolean addDoctype,
                                                         boolean format)
        Serialize a document back into a String.
        Parameters:
        doc - a DOM model of a document, or a node in a document
        addDoctype - if true, extra attributes such as docType will be set. This ensures maximum MathML compatibility. Use only with MathML DOM trees.
        format - if true, result will be nicely formatted.
        Returns:
        the document serialized to a string
        See Also:
        serializeDocument(Node, boolean, boolean, boolean)
      • serializeDocument

        public static java.lang.String serializeDocument​(org.w3c.dom.Node doc,
                                                         boolean addDoctype,
                                                         boolean format,
                                                         boolean omitXMLDecl)
        Serialize a document back into a String.
        Parameters:
        doc - a DOM model of a document.
        addDoctype - if true, extra attributes such as docType will be set. This ensures maximum MathML compatibility. Use only with MathML DOM trees.
        format - if true, result will be nicely formatted.
        omitXMLDecl - if true, there will be no XML declaration.
        Returns:
        the document serialized to a string