The C library installed along with xls2xml have only one function: xls2xml:
#include <xmsfilters/xls2xml.h> |
int xls2xml
(COLEFILE *colefile, xmlDocPtr *p_xml_doc, int extract_level, int refmode);It reads the file colefile, which was generated by Microsoft Excel, and express its content in the XML tree p_xml_doc, using the reference mode refmode and extracting so much content as specified by extract_level.
The colefile must be the file "/Workbook" or "/Book" in the file system which is in the file created by Microsoft Excel. It must be open (you can use cole functions to mount such file system and then open that file).
The result is stored in a XML tree p_xml_doc. It can be manipulated with some libxml functions in order to generate an actual file or to browse through.
The extract_level can be EXTRACT_ALL or EXTRACT_NORMAL, in order to extract all the content or just the normal content.
The refmode can be one of REFMODE_A1, REFMODE_R1C1 or REFMODE_AS_IS. The first uses the most common cell reference method (the left top cell is A1), the second uses the method row/column (the left top cell is R1C1), the last uses the reference mode used in the original file.
This function returns one of the following values:
0. All went OK. |
5. Error reading from stream file, thus colefile has a faulty format. |
10. Error allocating memory, there's not enough memory. |
11. Error reading streams files, can use perror. |
15. Value readed from colefile file is unknown by now, thus cole file is more advanced or has a faulty format. |
17. colefile is a Excel file, but it's format is unknown or too old. |
18. colefile is password protected so xls2xml can't access it. |
19. Internal inconsistence between structures have been found, it's a xls2xml bug (please, report it). |