test_fdoXMLSave.c
#include "SDO.h"
#include "assert.h"
// Saving XML to a file
void test_fdoXMLSave() {
SDOFACTORY df = getDataFactory();
SDOXML xmlhlp = getXMLHelper(df);
SDOXMLDOC doc = XMLDocAlloc(xmlhlp, 0, 0, "tmp");
sdoXMLLoad(doc, "<test a=\"hello\"/>");
FILE *f = fopen("test_fdoXMLSave.tmp", "w");
fdoXMLSave(xmlhlp, doc, f);
fclose(f);
f = fopen("test_fdoXMLSave.tmp", "r");
char buffer[100];
fgets(buffer, (int) sizeof(buffer), f);
fclose(f);
assert(!strcmp("<test a=\"hello\"/>", buffer));
}