net.sourceforge.jeuclid
Class MathMLSerializer

java.lang.Object
  extended by 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: 2bab6eb875e8 $

Method Summary
static String serializeDocument(Node doc, boolean addDoctype, boolean format)
          Serialize a document back into a String.
static String serializeDocument(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 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(Node, boolean, boolean, boolean)

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


Copyright © 2002-2010 The JEuclid project. All Rights Reserved.