poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Manicardi <roberto.manica...@gmail.com>
Subject Re: XSSFExportToXML help trying to export xlsx to xml
Date Sun, 18 Oct 2009 22:31:05 GMT
Hi,

Il giorno 16/ott/09, alle ore 18:59, Dhaval Parekh ha scritto:

> Thanks for the reply.
>
> I just have to convert a xlsx to xml.
> I do not have any custom mappings defined.

the error is reported because you have to load first the XLSX with the  
XXSFWorkbook object and then retrive the MapInfo object loaded in it.  
You can find an example on how to use the code here:

http://svn.apache.org/repos/asf/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java


Cheers,
Roberto

>
> This is what I am doing at the moment and its throwing an exception
> java.io.IOException: error: Illegal XML character: 0x3
> org.apache.xmlbeans.impl.piccolo.io.IllegalCharException:
> Illegal XML character: 0x3 at
> (UTF8XMLDecoder.java:196)
>
> My code is below
>
> File inputfile = new File("test.xlsx");
> FileInputStream inp = new FileInputStream(inputfile);
> MapInfo info = new MapInfo();
>
>
> info.readFrom(inp);
> //this is where its throwing an error above
>
>
> XSSFMap xmap = info.getXSSFMapById(0);
> CTMap ctMap = null;
> XSSFExportToXml ex = new XSSFExportToXml(xmap);
> OutputStream writer = new FileOutputStream("outxml.txt");			
> ex.exportToXML(writer ,false);
>
> Thanks a lot for your help
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

-- 
Roberto Manicardi
= 
= 
= 
========================================================================
http://www.jugroma.it
http://roma.javaday.it
JUG Roma Coordinator


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message