hi,all:
i want to create a Mathematical expression,below is my code
package org;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import org.docx4j.math.CTOMath;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
public class TestMathFormula
{
private static org.docx4j.wml.ObjectFactory factory = new org.docx4j.wml.ObjectFactory();
public static void insertSubSuper(String key,MainDocumentPart documentPart,WordprocessingMLPackage wordMLPackage)throws Exception
{
String xpath = "//w:r[w:t[contains(text(),'"+key+"')]]";
List<Object> list = documentPart.getJAXBNodesViaXPath(xpath, false);
for(int i=0;i<list.size();i++)
{
org.docx4j.wml.R r = (org.docx4j.wml.R) list.get(i);
org.docx4j.wml.P parent = (org.docx4j.wml.P) r.getParent();
org.docx4j.wml.RPr rpr=r.getRPr();
int index =parent.getContent().indexOf(r);
System.out.println(index);
parent.getContent().remove(r); ...