#include "gdome_xslt.h"
+#define OUTPUT_FILE "../../test_files/output.xml"
+#define CORRECT_OUTPUT_FILE "../../test_files/output.xml.correct"
+
GdomeDocument* loadDocument(GdomeDOMImplementation *domimpl, char *uri)
{
GdomeDocument *doc;
return doc;
}
+/* // old version: use gdome serialization
int saveDocument(GdomeDOMImplementation *domimpl, GdomeDocument* doc, char *uri)
{
GdomeException exc;
return 1;
}
+*/
+ /* new version, use libxslt serialization */
+int saveDocument(char* fname, GdomeDocument* result, xsltStylesheetPtr style) {
+ return saveResultToFilename(fname, result, style, 0);
+}
int main(void)
{
+ int bytes;
GdomeDOMImplementation *domimpl;
GdomeDocument *input;
GdomeDocument *style;
output = applyStylesheet(input, style_libxslt, params);
- if (!(saveDocument(domimpl, output, "../../test_files/output.xml"))) return 1;
+/* if (!(saveDocument(domimpl, output, "../../test_files/output.xml"))) return 1; */
+ bytes = saveDocument("../../test_files/output.xml", output, style_libxslt);
xsltFreeStylesheet(style_libxslt);
gdome_di_freeDoc (domimpl, input, &exc);
gdome_di_freeDoc (domimpl, output, &exc);
gdome_di_unref (domimpl, &exc);
- printf("The test was successful iff ../../test_files/output.xml.correct is\n");
- printf("equal to ../../test_files/output.xml\n");
+ printf("The test was successful iff %s is equal to %s\n",
+ OUTPUT_FILE,
+ CORRECT_OUTPUT_FILE);
return 0;
}