| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

xml_save_file

#include "sflxmll.h"
int
xml_save_file (
    XML_ITEM   *item,
    const char *filename)

Synopsis

Saves an XML tree to the specified file. Returns XML_NOERROR or XML_FILEERROR.

Source Code - (sflxmll.c)

{
    FILE
        *xmlfile;                       /*  XML output stream                */
    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 XML_FILEERROR;           /*  No permission to write file      */

    /*  Write XML file header                                                */
    fprintf (xmlfile, "<?xml version=\"1.0\"?>\n");

    /*  Output XML root                                                      */
    count = xml_save_file_item (xmlfile, item, 0);

    /*  Output a final carriage return  */
    fprintf (xmlfile, "\n");

    file close (xmlfile);
    return XML_NOERROR;
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation