Class DocumentTools
- java.lang.Object
-
- de.unirostock.sems.xmlutils.tools.DocumentTools
-
public class DocumentTools extends Object
Toolkit for Documents.- Author:
- Martin Scharm
-
-
Constructor Summary
Constructors Constructor Description DocumentTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.jdom2.DocumentgetDoc(TreeDocument treeDoc)Extracts the document from a given TreeDocument.static org.jdom2.DocumentgetSubDoc(DocumentNode node)Computes the document oft a subtree.static StringprintPrettySubDoc(DocumentNode node)Prints the pretty sub doc.static StringprintSubDoc(DocumentNode node)Prints the sub doc.static StringtransformMathML(DocumentNode doc)Transform content MathML to display MathML, e.g.
-
-
-
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
-
-