{
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "row", XmlWriter.OPEN);
for (short col = 0; col < columnCount; col++)
{
final RenderBox content = contentProducer.getContent(row, col);
if (content == null)
{
final int sectionType = contentProducer.getSectionType(row, col);
final CellBackground background = cellBackgroundProducer.getBackgroundAt
(logicalPageBox, sheetLayout, col, row, true, sectionType);
if (background == null)
{
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "empty-cell", XmlWriter.CLOSE);
continue;
}
// A empty cell with a defined background ..
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "empty-cell", createCellAttributes(background),
XmlWriter.OPEN);
writeAttributes(background.getAttributes(), background.getElementType());
xmlWriter.writeCloseTag();
continue;
}
if (content.isCommited() == false)
{
throw new InvalidReportStateException("Uncommited content encountered");
}
final TableRectangle rectangle = sheetLayout.getTableBounds
(content.getX(), content.getY(), content.getWidth(), content.getHeight(), null);
if (rectangle.isOrigin(col, row) == false)
{
// A spanned cell ..
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "spanned-cell", XmlWriter.CLOSE);
continue;
}
final int sectionType = contentProducer.getSectionType(row, col);
final CellBackground realBackground = cellBackgroundProducer.getBackgroundAt
(logicalPageBox, sheetLayout, rectangle.getX1(), rectangle.getY1(), rectangle.getColumnSpan(),
rectangle.getRowSpan(), false, sectionType);
final AttributeList attributeList;
if (realBackground != null)
{
attributeList = createCellAttributes(realBackground);
}
else
{
attributeList = new AttributeList();
}
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "row-span", String.valueOf(
rectangle.getRowSpan()));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "col-span", String.valueOf(
rectangle.getColumnSpan()));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "href",
(String) content.getStyleSheet().getStyleProperty(ElementStyleKeys.HREF_TARGET));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "href-window",
(String) content.getStyleSheet().getStyleProperty(ElementStyleKeys.HREF_WINDOW));
attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "href-title",
(String) content.getStyleSheet().getStyleProperty(ElementStyleKeys.HREF_TITLE));
// export the cell and all content ..
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "cell", attributeList, XmlWriter.OPEN);
processBoxChilds(content);
xmlWriter.writeCloseTag();
content.setFinished(true);
}
xmlWriter.writeCloseTag();
}
xmlWriter.writeCloseTag();
}