|
| iMatix home page | << | < | > | >> |
SFLVersion 2.10 |
#include "sflxmll.h"
int
xml_save (
XML_ITEM *item,
const char *filename)
Saves an XML tree to the specified file. Returns the number of items saved, or -1 if there was an error.
{
FILE
*xmlfile; /* XML output stream */
XML_ITEM
*child;
int
count; /* How many symbols did we save? */
ASSERT (item);
ASSERT (filename);
init_charmaps (); /* Initialise character maps */
if ((xmlfile = file open (filename, 'w')) == NULL)
return (-1); /* No permission to write file */
/* Write XML file header */
fprintf (xmlfile, "<?XML VERSION=\"1.0\"?>\n");
/* Output children of XML root */
count = 0;
FORCHILDREN (child, item)
count += xml_save_item (xmlfile, child);
file close (xmlfile);
return (count);
}
| | << | < | > | >> |
|