Removed @author tag.

Dealt with exceprions properly.
General reformatting.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@827907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ugo Cei 2009-10-21 07:15:37 +00:00
parent 3e82ec8035
commit 47086ce5bd
1 changed files with 363 additions and 369 deletions

View File

@ -74,8 +74,6 @@ import org.xml.sax.SAXException;
* <li> no mixed content: an element can't contain simple text and child element(s) together </li>
* <li> no &lt;substitutionGroup&gt; in complex type/element declaration </li>
* </ul>
*
* @author Roberto Manicardi
*/
public class XSSFExportToXml implements Comparator<String>{
@ -97,9 +95,11 @@ public class XSSFExportToXml implements Comparator<String>{
* @param os OutputStream in which will contain the output XML
* @param validate if true, validates the XML againts the XML Schema
* @throws SAXException
* @throws TransformerException
* @throws ParserConfigurationException
*/
public void exportToXML(OutputStream os, boolean validate) throws SAXException{
exportToXML(os,"UTF-8", validate);
public void exportToXML(OutputStream os, boolean validate) throws SAXException, ParserConfigurationException, TransformerException {
exportToXML(os, "UTF-8", validate);
}
private Document getEmptyDocument() throws ParserConfigurationException{
@ -118,16 +118,16 @@ public class XSSFExportToXml implements Comparator<String>{
* @param encoding the output charset encoding
* @param validate if true, validates the XML againts the XML Schema
* @throws SAXException
* @throws ParserConfigurationException
* @throws TransformerException
* @throws InvalidFormatException
*/
public void exportToXML(OutputStream os, String encoding, boolean validate) throws SAXException{
public void exportToXML(OutputStream os, String encoding, boolean validate) throws SAXException, ParserConfigurationException, TransformerException{
List<XSSFSingleXmlCell> singleXMLCells = map.getRelatedSingleXMLCell();
List<Table> tables = map.getRelatedTables();
String rootElement = map.getCtMap().getRootElement();
try{
Document doc = getEmptyDocument();
Element root = null;
@ -243,15 +243,9 @@ public class XSSFExportToXml implements Comparator<String>{
trans.transform(source, result);
}
}catch(ParserConfigurationException e) {
e.printStackTrace();
}catch(TransformerException e) {
e.printStackTrace();
}
}
/**
* Validate the generated XML against the XML Schema associated with the XSSFMap
*