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:
parent
3e82ec8035
commit
47086ce5bd
@ -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 mixed content: an element can't contain simple text and child element(s) together </li>
|
||||||
* <li> no <substitutionGroup> in complex type/element declaration </li>
|
* <li> no <substitutionGroup> in complex type/element declaration </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
|
||||||
* @author Roberto Manicardi
|
|
||||||
*/
|
*/
|
||||||
public class XSSFExportToXml implements Comparator<String>{
|
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 os OutputStream in which will contain the output XML
|
||||||
* @param validate if true, validates the XML againts the XML Schema
|
* @param validate if true, validates the XML againts the XML Schema
|
||||||
* @throws SAXException
|
* @throws SAXException
|
||||||
|
* @throws TransformerException
|
||||||
|
* @throws ParserConfigurationException
|
||||||
*/
|
*/
|
||||||
public void exportToXML(OutputStream os, boolean validate) throws SAXException{
|
public void exportToXML(OutputStream os, boolean validate) throws SAXException, ParserConfigurationException, TransformerException {
|
||||||
exportToXML(os,"UTF-8", validate);
|
exportToXML(os, "UTF-8", validate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Document getEmptyDocument() throws ParserConfigurationException{
|
private Document getEmptyDocument() throws ParserConfigurationException{
|
||||||
@ -118,16 +118,16 @@ public class XSSFExportToXml implements Comparator<String>{
|
|||||||
* @param encoding the output charset encoding
|
* @param encoding the output charset encoding
|
||||||
* @param validate if true, validates the XML againts the XML Schema
|
* @param validate if true, validates the XML againts the XML Schema
|
||||||
* @throws SAXException
|
* @throws SAXException
|
||||||
|
* @throws ParserConfigurationException
|
||||||
|
* @throws TransformerException
|
||||||
* @throws InvalidFormatException
|
* @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<XSSFSingleXmlCell> singleXMLCells = map.getRelatedSingleXMLCell();
|
||||||
List<Table> tables = map.getRelatedTables();
|
List<Table> tables = map.getRelatedTables();
|
||||||
|
|
||||||
String rootElement = map.getCtMap().getRootElement();
|
String rootElement = map.getCtMap().getRootElement();
|
||||||
|
|
||||||
try{
|
|
||||||
|
|
||||||
Document doc = getEmptyDocument();
|
Document doc = getEmptyDocument();
|
||||||
|
|
||||||
Element root = null;
|
Element root = null;
|
||||||
@ -243,15 +243,9 @@ public class XSSFExportToXml implements Comparator<String>{
|
|||||||
trans.transform(source, result);
|
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
|
* Validate the generated XML against the XML Schema associated with the XSSFMap
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user