invokeDeferredEvent(foNode, true);
if (foNode instanceof PageSequence) {
PageSequence pageSequence = (PageSequence) foNode;
FONode regionBefore = (FONode) pageSequence.flowMap.get("xsl-region-before");
FONode regionAfter = (FONode) pageSequence.flowMap.get("xsl-region-after");
if (regionBefore != null) {
recurseFONode(regionBefore);
}
if (regionAfter != null) {
recurseFONode(regionAfter);
}
recurseFONode( pageSequence.getMainFlow() );
} else if (foNode instanceof Table) {
Table table = (Table) foNode;
//recurse all table-columns
for (Iterator it = table.getColumns().iterator(); it.hasNext();) {
recurseFONode( (FONode) it.next() );
}
//recurse table-header
if (table.getTableHeader() != null) {
recurseFONode( table.getTableHeader() );
}
//recurse table-footer
if (table.getTableFooter() != null) {
recurseFONode( table.getTableFooter() );
}
if (foNode.getChildNodes() != null) {
for (Iterator it = foNode.getChildNodes(); it.hasNext();) {
recurseFONode( (FONode) it.next() );
}
}
} else if (foNode instanceof ListItem) {
ListItem item = (ListItem) foNode;
recurseFONode(item.getLabel());
recurseFONode(item.getBody());
} else if (foNode instanceof Footnote) {
Footnote fn = (Footnote)foNode;
recurseFONode(fn.getFootnoteCitation());
recurseFONode(fn.getFootnoteBody());
} else {
//Any other FO-Object: Simply recurse through all childNodes.
if (foNode.getChildNodes() != null) {
for (Iterator it = foNode.getChildNodes(); it.hasNext();) {
FONode fn = (FONode)it.next();
if (log.isTraceEnabled()) {
log.trace(" ChildNode for " + fn + " (" + fn.getName() + ")");
}
recurseFONode(fn);
}
}
}