// Path: src/main/java/org/docx4j/convert/out/fo/renderers/AbstractFORenderer.java
// public abstract class AbstractFORenderer implements FORenderer {
// 	
// 	protected static Logger log = LoggerFactory.getLogger(AbstractFORenderer.class);
// 	
// 	// TODO this needs to be rethought in an architectural sense,
// 	// since PictWriter is here altering the behaviour of 
// 	// downstream renderer, and we don't want that!
// 	public boolean TEXTBOX_POSTPROCESSING_REQUIRED = false;
// 	
// 	static Templates xslt_POSTPROCESSING;			
// 	static {
// 		try {
// 			Source xsltSource = new StreamSource(
// 						org.docx4j.utils.ResourceUtils.getResource(
// 								"org/docx4j/convert/out/fo/renderers/AbstractFORenderer_POSTPROCESSING.xslt"));
// 			xslt_POSTPROCESSING = XmlUtils.getTransformerTemplate(xsltSource);
// 		} catch (IOException e) {
// 			e.printStackTrace();
// 		} catch (TransformerConfigurationException e) {
// 			e.printStackTrace();
// 		}
// 		
// 	}	
// 	
// 
// }


import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.Map;
import org.docx4j.XmlUtils;
import org.docx4j.convert.out.FORenderer;
import org.docx4j.convert.out.FOSettings;
import org.docx4j.convert.out.common.AbstractWmlConversionContext;
import org.docx4j.convert.out.common.ConversionSectionWrapper;
import org.docx4j.convert.out.fo.renderers.AbstractFORenderer;
import org.docx4j.model.structure.PageDimensions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
						
		              </fo:table-cell>
		            </fo:table-row>
		          </fo:table-body>	
		          */
				Element tbody = doc.createElementNS(XSL_FO, "table-body");
				ret.appendChild(tbody);
				Element trow = doc.createElementNS(XSL_FO, "table-row");
				tbody.appendChild(trow);

				// Cell 1 is the text box
				Element tc1 = doc.createElementNS(XSL_FO, "table-cell");
				trow.appendChild(tc1);
				Element block = doc.createElementNS(XSL_FO, "block");


				setBorders(block); // for now, solid borders, so we can see the text box
				tc1.appendChild(block);
				XmlUtils.treeCopy(childNodes, block);

				// Cell 2 is the p content proper (which we don't have)
				Element tc2 = doc.createElementNS(XSL_FO, "table-cell");
				trow.appendChild(tc2);
//					tc2.appendChild(
//							doc.createComment("CONTENT GOES HERE"));
				Element placeholder = doc.createElementNS(XSL_FO, "block");
				placeholder.setTextContent("#TEXTBOX#"); // magic string
				tc2.appendChild(placeholder);

				// TODO here the architecture needs further thought
// Path: src/main/java/org/docx4j/convert/out/fo/renderers/AbstractFORenderer.java
// public abstract class AbstractFORenderer implements FORenderer {
// 	
// 	protected static Logger log = LoggerFactory.getLogger(AbstractFORenderer.class);
// 	
// 	// TODO this needs to be rethought in an architectural sense,
// 	// since PictWriter is here altering the behaviour of 
// 	// downstream renderer, and we don't want that!
// 	public boolean TEXTBOX_POSTPROCESSING_REQUIRED = false;
// 	
// 	static Templates xslt_POSTPROCESSING;			
// 	static {
// 		try {
// 			Source xsltSource = new StreamSource(
// 						org.docx4j.utils.ResourceUtils.getResource(
// 								"org/docx4j/convert/out/fo/renderers/AbstractFORenderer_POSTPROCESSING.xslt"));
// 			xslt_POSTPROCESSING = XmlUtils.getTransformerTemplate(xsltSource);
// 		} catch (IOException e) {
// 			e.printStackTrace();
// 		} catch (TransformerConfigurationException e) {
// 			e.printStackTrace();
// 		}
// 		
// 	}	
// 	
// 
// }


// Path: src/main/java/org/docx4j/convert/out/fo/FOPictWriterFloatAvoided.java
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.Map;
import org.docx4j.XmlUtils;
import org.docx4j.convert.out.FORenderer;
import org.docx4j.convert.out.FOSettings;
import org.docx4j.convert.out.common.AbstractWmlConversionContext;
import org.docx4j.convert.out.common.ConversionSectionWrapper;
import org.docx4j.convert.out.fo.renderers.AbstractFORenderer;
import org.docx4j.model.structure.PageDimensions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

						
		              </fo:table-cell>
		            </fo:table-row>
		          </fo:table-body>	
		          */
				Element tbody = doc.createElementNS(XSL_FO, "table-body");
				ret.appendChild(tbody);
				Element trow = doc.createElementNS(XSL_FO, "table-row");
				tbody.appendChild(trow);

				// Cell 1 is the text box
				Element tc1 = doc.createElementNS(XSL_FO, "table-cell");
				trow.appendChild(tc1);
				Element block = doc.createElementNS(XSL_FO, "block");


				setBorders(block); // for now, solid borders, so we can see the text box
				tc1.appendChild(block);
				XmlUtils.treeCopy(childNodes, block);

				// Cell 2 is the p content proper (which we don't have)
				Element tc2 = doc.createElementNS(XSL_FO, "table-cell");
				trow.appendChild(tc2);
//					tc2.appendChild(
//							doc.createComment("CONTENT GOES HERE"));
				Element placeholder = doc.createElementNS(XSL_FO, "block");
				placeholder.setTextContent("#TEXTBOX#"); // magic string
				tc2.appendChild(placeholder);

				// TODO here the architecture needs further thought
				if (foRenderer instanceof AbstractFORenderer) {