Open gallyamb opened 1 year ago
In ODT processing the scripts preprocessing is done within flushCharacters
method, FYI
Just created a test case for odt, and it works as expected xdocreport-freemarker-odt-reference.odt xdocreport-freemarker-odt-test-case.odt
I summon for someone with expertise in this project!
Is it ok to move scripts preprocessing in Docx into flushCharacters
method just like in ODT? Or you see some pitfalls?
Issue
I've tried to use custom before element https://github.com/opensagres/xdocreport/blob/dcb1377e8004ba3a30a0bd42d8c8bb013eee6d64/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/preprocessor/sax/TransformedBufferedDocumentContentHandler.java#L399 and custom after element https://github.com/opensagres/xdocreport/blob/dcb1377e8004ba3a30a0bd42d8c8bb013eee6d64/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/preprocessor/sax/TransformedBufferedDocumentContentHandler.java#L494 to enclose paragraph, that is part of unordered list, so that item in list will became conditional But, unfortunately, DocxBufferedDocument#processScriptBeforeAfter is called while DocxBufferedDocument#onEndEndElement called, i.e. when BufferedDocument#getCurrentElement already returns the parent of my paragraph, but not my paragraph itself
How to reproduce
I've created a test case xdocreport-freemarker-test-case.docx And reference document, that I want to get as a result of processing test case's template xdocreport-freemarker-reference.docx
Questions
processScriptBeforeAfter
intentionally called aftercurrentElement
"clearing"