if (child == null) {
return;
}
LayoutModule module = context.getLayoutModule();
FormInstance formInstance = (FormInstance) instance;
FormatInstance childInstance =
context.getFormatInstance(
child, instance.getIndex());
// If the page contained an XFForm element
if (formInstance.getPreambleBuffer(false) != null ||
formInstance.getContentBuffer(false) != null ||
formInstance.getPostambleBuffer(false) != null) {
// Write out the form and contained layouts
FormAttributes attributes = factory.createFormAttributes();
attributes.setForm(form);
module.writeOpenForm(attributes);
OutputBuffer buffer =
formInstance.getPreambleBuffer(false);
if (buffer != null) {
module.writeFormPreamble(buffer);
}
context.renderFormat(childInstance);
buffer = formInstance.getPostambleBuffer(false);
if (buffer != null) {
module.writeFormPostamble(buffer);
}
module.writeCloseForm(attributes);