Extracting data from xml spreadsheet for JSP
Hi,
Currently i am developing a web application where user can upload a MS excel file, then the application will extract data needed and store into database. But facing problems where those excel files may content massive images that make the file size too large to be upload on to the web. Now i try to export those excel files into xml spreadsheet, to get only text data. Need helps on how toextract data from xml spreadsheet. Which API needed?
Thanks
[480 byte] By [
dennisleea] at [2007-10-3 10:30:17]

Or, you could work directly with the xls file itself using Jexcel, or the HSSF package from the Apache Organisations POI project.Must admit however that I do agree, csv could be the way to go.
Without getting into too much detail, a DTD defines the elements that can appear in an xml file, the order they can appear in, which elements can be nested within which other elements, what each element can contain, etc, etc. In short, a DTD defines the structure of the xml file and Microsoft defined a DTD for the xml files that are output by Excel.
This is not taken from an xml file produced by Excel but DTDs look a llittle like this very basic example.
<!DOCTYPE note [
><!ELEMENT note (to,from,heading,body)>
<!ELEMENT to(#PCDATA)>
<!ELEMENT from(#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body(#PCDATA)>
]>
If you open the one produced for you by Excel in Wordpad or another simple text editor, you may see something like this in there.
However, if you are going to use a parser to access the file for you do not worry about getting to grips with DTDs for a short, simple project.