Class DocumentTools


  • public class DocumentTools
    extends Object
    Toolkit for Documents.
    Author:
    Martin Scharm
    • Constructor Detail

      • DocumentTools

        public DocumentTools()
    • Method Detail

      • getDoc

        public static org.jdom2.Document getDoc​(TreeDocument treeDoc)
        Extracts the document from a given TreeDocument.
        Parameters:
        treeDoc - the tree document
        Returns:
        the document
      • getSubDoc

        public static org.jdom2.Document getSubDoc​(DocumentNode node)
        Computes the document oft a subtree.
        Parameters:
        node - the node rooting the subtree
        Returns:
        the document representing the subtree
      • printSubDoc

        public static String printSubDoc​(DocumentNode node)
        Prints the sub doc.
        Parameters:
        node - the node
        Returns:
        the string
      • printPrettySubDoc

        public static String printPrettySubDoc​(DocumentNode node)
        Prints the pretty sub doc.
        Parameters:
        node - the node
        Returns:
        the string
      • transformMathML

        public static String transformMathML​(DocumentNode doc)
                                      throws TransformerException
        Transform content MathML to display MathML, e.g. to display the MathML in a browser. This operation can be very expensive.
        Parameters:
        doc - the document node rooting the MathML subtree
        Returns:
        the string
        Throws:
        TransformerException - the transformer exception