/* xls2xml: Converts from Microsoft Excel files to XML. Copyright 1999 Roberto Arturo Tena Sanchez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Roberto Arturo Tena Sanchez */ #include #include /* 10 */ int new_xml_doc (void) { /* New xml doc */ *parameters->p_xml_doc = xmlNewDoc ((unsigned char *)"1.0"); test (*parameters->p_xml_doc != NULL, 10); parameters->xml_doc = *parameters->p_xml_doc; /* Makes root */ parameters->xml_doc->root = xmlNewDocNode (parameters->xml_doc, NULL, (unsigned char *)"fil_spreadsheet", NULL); test_exitf (parameters->xml_doc->root != NULL, 10, xmlFreeDoc(parameters->xml_doc)); /* Makes defaults, root's child */ parameters->xml_tree_shortcuts.defaults = xmlNewChild (parameters->xml_doc->root, NULL, (unsigned char *)"defaults", NULL); test_exitf (parameters->xml_tree_shortcuts.defaults != NULL, 10, xmlFreeDoc (parameters->xml_doc)); /* Makes tabs state, defaults's child */ parameters->xml_tree_shortcuts.tabs_state = xmlNewChild ( parameters->xml_tree_shortcuts.defaults, NULL, (unsigned char *)"tabsstate", NULL); test_exitf (parameters->xml_tree_shortcuts.tabs_state != NULL, 10, xmlFreeDoc (parameters->xml_doc)); /* Makes sheets, root's child */ parameters->xml_tree_shortcuts.sheets = xmlNewChild ( parameters->xml_doc->root, NULL, (unsigned char *)"sheets", NULL); test_exitf (parameters->xml_tree_shortcuts.sheets != NULL, 10, xmlFreeDoc (parameters->xml_doc)); return 0; } void erase_xml_doc (xmlDocPtr xml_doc) { xmlFreeDoc (xml_doc); }