Class MathMLSerializer

java.lang.Object
net.sourceforge.jeuclid.MathMLSerializer

@ThreadSafe public final class MathMLSerializer extends 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 Details

    • serializeDocument

      public static String serializeDocument(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

      public static String serializeDocument(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