private static final String STRUCTURE_TREE_SEQUENCE_NAME = "structure-tree-sequence";
private FOLoader foLoader;
+ private boolean keepEmptyTags = true;
@Test
public void testCompleteDocument() throws Exception {
@Test
public void testRemoveBlocks() throws Exception {
+ keepEmptyTags = false;
compare("<fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">\n"
+ " <fo:layout-master-set>\n"
+ " <fo:simple-page-master master-name=\"simple\">\n"
+ " <fo:block/>"
+ " <fo:block><fo:block/></fo:block>\n"
+ " <fo:block>a</fo:block>\n"
+ + " <fo:block><fo:leader/></fo:block>\n"
+ + " <fo:block>a<fo:leader/></fo:block>\n"
+ " </fo:flow>\n"
+ " </fo:page-sequence>\n"
+ "</fo:root>\n",
+ "<fo:block>\n"
+ "<marked-content/>\n"
+ "</fo:block>\n"
+ + "<fo:block>\n"
+ + "<marked-content/>\n"
+ + "</fo:block>\n"
+ "</fo:flow>\n"
+ "</structure-tree>\n"
+ "</structure-tree-sequence>\n");
return actualStructureTree;
}
- private static void createStructureTreeFromDocument(InputStream foInputStream,
+ private void createStructureTreeFromDocument(InputStream foInputStream,
Result result) throws Exception {
TransformerHandler tHandler = createTransformerHandler(result);
startStructureTreeSequence(tHandler);
});
}
- private static FOUserAgent createFOUserAgent(FODocumentParser documentParser) {
+ private FOUserAgent createFOUserAgent(FODocumentParser documentParser) {
FOUserAgent userAgent = documentParser.createFOUserAgent();
userAgent.setAccessibility(true);
- userAgent.setKeepEmptyTags(false);
+ userAgent.setKeepEmptyTags(keepEmptyTags);
return userAgent;
}