封装JXL的小工具(二)
?编译Schema:
xjc jxl.xsd -p jxl.jaxb
生成N多文件:
生成的Java文件全部放在jxl.jaxb包下。
?
?
然后对Excel类编辑:
?
使用:
?
?
String xml = "FOP.XML";String xsl = "FOP.XSL";JAXBExcel helper = new JAXBExcel(new StreamSource(new File(xml)), new StreamSource(new File(xsl)));File f = new File("C:/a.xls");OutputStream os = new FileOutputStream(f);helper.process(os);os.close();?其中FOP.xml FOP.xsl文件见附件:
?