I am getting a similar error when I am trying to add a table to the contents of the mainDocumentPart at a specific index, using below code
wordMLPackage.getMainDocumentPart().getContent().add(5, tbl);
However, it is working perfectly fine if I add it directly to the mainDocumentPart
wordMLPackage.getMainDocumentPart().addObject(tbl);
Getting error while generating the output file using
Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);
Code to create table is
Tbl tbl = Context.getWmlObjectFactory().createTbl();
// // ///////////////////
String strTblPr = "<w:tblPr " + Namespaces.W_NAMESPACE_DECLARATION + ...