001package com.hfg.xml.msofficexml.xlsx.part; 002 003 004import com.hfg.xml.XMLTag; 005import com.hfg.xml.msofficexml.OfficeOpenXMLContentType; 006import com.hfg.xml.msofficexml.OfficeXML; 007import com.hfg.xml.msofficexml.docx.RelationshipXML; 008import com.hfg.xml.msofficexml.docx.wordprocessingml.WmlXML; 009import com.hfg.xml.msofficexml.part.OfficeXMLPart; 010import com.hfg.xml.msofficexml.xlsx.Xlsx; 011import com.hfg.xml.msofficexml.xlsx.spreadsheetml.SsmlWorkbook; 012import com.hfg.xml.msofficexml.xlsx.spreadsheetml.SsmlWorkbookView; 013import com.hfg.xml.msofficexml.xlsx.spreadsheetml.SsmlXML; 014 015//------------------------------------------------------------------------------ 016/** 017 * Workbook Part of a OfficeOpenXML xlsx Excel document. 018 * 019 * @author J. Alex Taylor, hairyfatguy.com 020 */ 021//------------------------------------------------------------------------------ 022// com.hfg XML/HTML Coding Library 023// 024// This library is free software; you can redistribute it and/or 025// modify it under the terms of the GNU Lesser General Public 026// License as published by the Free Software Foundation; either 027// version 2.1 of the License, or (at your option) any later version. 028// 029// This library is distributed in the hope that it will be useful, 030// but WITHOUT ANY WARRANTY; without even the implied warranty of 031// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 032// Lesser General Public License for more details. 033// 034// You should have received a copy of the GNU Lesser General Public 035// License along with this library; if not, write to the Free Software 036// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 037// 038// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 039// jataylor@hairyfatguy.com 040//------------------------------------------------------------------------------ 041 042public class WorkbookPart extends OfficeXMLPart 043{ 044 045 //--------------------------------------------------------------------------- 046 public WorkbookPart(Xlsx inXlsx) 047 { 048 super(inXlsx); 049 setFile(SsmlXML.WORKBOOK_FILE); 050 051 // Register the content type 052 inXlsx.getContentTypesPart().addOverride(this, SsmlContentType.WORKBOOK); 053 054 XMLTag rootNode = new SsmlWorkbook(inXlsx); 055// rootNode.addXMLNamespaceDeclaration(OfficeXML.OFFICE_NAMESPACE); 056 rootNode.addXMLNamespaceDeclaration(RelationshipXML.RELATIONSHIP_NAMESPACE); 057/* 058 XMLTag bookViewsTag = new XMLTag(SsmlXML.WORKBOOK_VIEWS); 059 rootNode.addSubtag(bookViewsTag); 060 061 bookViewsTag.addSubtag(new SsmlWorkbookView(inXlsx)); 062*/ 063 064/* 065 rootNode.addXMLNamespaceDeclaration(XMLNamespace.getNamespace("ve", "http://schemas.openxmlformats.org/markup-compatibility/2006")); 066 rootNode.addXMLNamespaceDeclaration(XMLNamespace.getNamespace("m", "http://schemas.openxmlformats.org/officeDocument/2006/math")); 067 rootNode.addXMLNamespaceDeclaration(XMLNamespace.getNamespace("v", "urn:schemas-microsoft-com:vml")); 068 rootNode.addXMLNamespaceDeclaration(XMLNamespace.getNamespace("w10", "urn:schemas-microsoft-com:office:word")); 069 rootNode.addXMLNamespaceDeclaration(XMLNamespace.getNamespace("wne", "http://schemas.microsoft.com/office/word/2006/wordml")); 070*/ 071 setRootNode(rootNode); 072 } 073 074 //--------------------------------------------------------------------------- 075 @Override 076 public SsmlWorkbook getRootNode() 077 { 078 return (SsmlWorkbook) super.getRootNode(); 079 } 080}