when generating .fo files I noticed that the whitespace preserve function is not working.
- Code: Select all
// Handle empty case - want the block to be preserved!
if (n.getChildNodes().getLength()==0) {
((Element)foBlockElement).setAttribute( "white-space-treatment", "preserve");
foBlockElement.setTextContent(" ");
} else {
/*
* ...
*/
XmlUtils.treeCopy( n, foBlockElement );
}
I think it should be:
- Code: Select all
// Handle empty case - want the block to be preserved!
if (n.getChildNodes().getLength()==0) {
((Element)foBlockElement).setAttribute( "white-space-treatment", "preserve");
foBlockElement.setTextContent(" ");
} else {
/*
* ...
*/
((Element)foBlockElement).setAttribute( "white-space-treatment", "preserve");
((Element)foBlockElement).setAttribute( "white-space-collapse", "false");
XmlUtils.treeCopy( n, foBlockElement );
}
docx4j-export-FO/src/main/java/org/docx4j/convert/out/fo/XsltFOFunctions.java file ~610 line