I am trying to convert HTML table to word based on the XHTMLImportFragment.java example provided. However, when I try to do that, I am getting the following error:
- Code: Select all
Exception in thread "main" java.lang.ClassCastException: org.docx4j.org.xhtmlrenderer.newtable.TableSectionBox cannot be cast to org.docx4j.org.xhtmlrenderer.newtable.TableBox
at org.docx4j.convert.in.xhtml.Importer.traverse(Importer.java:463)
at org.docx4j.convert.in.xhtml.Importer.traverse(Importer.java:746)
at org.docx4j.convert.in.xhtml.Importer.traverse(Importer.java:746)
at org.docx4j.convert.in.xhtml.Importer.convert(Importer.java:382)
at org.docx4j.samples.XHTMLImportFragment.main(XHTMLImportFragment.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
This is the sample table that I am trying to import into word
"<table ...