- Code: Select all
public class PlainTests {
static final String TEST_STRING = "<html><head>" +
"</head>" +
"<body>" +
"<ol><li>a</li><li>b</li></ol>" +
"</body>" +
"</html>";
public static void main(String[] args) throws ParserConfigurationException, Docx4JException {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage(PageSizePaper.A4, true);
XHTMLImporterImpl XHTMLImporterForContent = new XHTMLImporterImpl(wordMLPackage);
wordMLPackage.getMainDocumentPart().getContent().addAll(XHTMLImporterForContent.convert(TEST_STRING, null));
wordMLPackage.save(new File("test.docx"));
}
}
the resulting docx instead of having "1. a" shows "1 a". The "." dot is vanished. The same applies for any "list-style-type" set in "XhtmlNamespaceHandler.css"