use of org.jdom.filter.ContentFilter in project vcell by virtualcell.
the class CellQuanVCTranslator method fixMathMLBug.
// temporary method.
private void fixMathMLBug(Element math) {
ArrayList<Element> l = new ArrayList<Element>();
@SuppressWarnings("unchecked") Iterator<Element> walker = new JDOMTreeWalker(math, new ContentFilter(ContentFilter.ELEMENT));
while (walker.hasNext()) l.add(walker.next());
Element temp;
for (int i = 0; i < l.size(); i++) {
temp = l.get(i);
if (temp.getName().equals(MathMLTags.CONSTANT)) {
@SuppressWarnings("unchecked") ArrayList<Attribute> atts = new ArrayList<Attribute>(temp.getAttributes());
org.jdom.Attribute att;
for (int j = 0; j < atts.size(); j++) {
att = atts.get(j);
temp.removeAttribute(att.getName(), mathns);
}
temp.removeNamespaceDeclaration(mathns);
}
}
}
Aggregations