org.activemath.webapp.exercises.tools
Class JDOMUtility
java.lang.Object
org.activemath.webapp.exercises.tools.JDOMUtility
public class JDOMUtility
- extends Object
|
Field Summary |
static org.jdom.output.XMLOutputter |
outputter
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
outputter
public static org.jdom.output.XMLOutputter outputter
JDOMUtility
public JDOMUtility()
Element2string
public static String Element2string(org.jdom.Element element)
throws Exception
- Throws:
Exception
JdomContent2string
public static String JdomContent2string(List content)
throws Exception
- Throws:
Exception
build
public static org.jdom.Element build(String content)
throws Exception
- Throws:
Exception
string2jdom
public static org.jdom.Element string2jdom(String content)
throws Exception
- Throws:
Exception
string2jdomContent
public static Collection string2jdomContent(String content)
throws Exception
- Throws:
Exception
areElementsEquivalent
public static boolean areElementsEquivalent(org.jdom.Element element1,
org.jdom.Element element2)
isSyntacticallyEqual
public static boolean isSyntacticallyEqual(org.jdom.Element a,
org.jdom.Element b)
- author: Alberto Gonzales
Compare two elements syntactically.
This is done by recursively matching all subelements and attributes
defined in OpenMath. Extra elements or attributes are ignored.
If any of the elements is null, the result is "false".
OM errors are treated specially: if the head symbol matches, they are
considered equivalent regardless of the rest. This allows to match an
error class ignoring the accompanying context information.
- Parameters:
a - first element.b - second element.
- Returns:
- true if equal, false otherwise.
extractFormula
public static List extractFormula(String text)