public XmlNode BuildNode()
{
if (Forms.Count != 0)
{
XmlNode nodeForms = Node.SelectSingleNode("office:forms", this.Document.NamespaceManager);
if (nodeForms == null)
{
nodeForms = this.Document.CreateNode("forms","office");
}
foreach (ODFForm f in Forms)
{
nodeForms.AppendChild(f.Node);
}
Node.AppendChild(nodeForms);
}
foreach( Column column in this.ColumnCollection)
this.Node.AppendChild(column.Node);
if (this.RowHeader != null)
this.Node.AppendChild(this.RowHeader.Node);
foreach (Row row in this.Rows)
{
//check for nested tables
foreach(Cell cell in row.Cells)
{
foreach(IContent iContent in cell.Content)
{
if (iContent is Table)
{
Table table = iContent as Table;
table.BuildNode();
}
}
}
//now, append the row node
this.Node.AppendChild(row.Node);
}
return this.Node;
}