int
main (int argc, char** argv)
{
xml_g_set_prgname(argv[0]);
if (argc < 2)
{
g_printerr ("> %s filename\n"
"\t parses the xml file and prints the pure markup tree\n"
"\t to stdout.\n", g_get_prgname ());
return 1;
} |
___ gchar *filename = 0, *options = 0;
{ int i ; for (i=1; i < argc ; i++) {
if (argv[i][0] == '-') { options = argv[i]; continue; } |
if (! filename) { filename = argv[i]; continue; } |
g_warning ("extra argument on commandline, ignored: %s", argv[i]);
} | } |
___ GError* error = 0;
___ xml_GNode* node = xml_g_markup_parse_file (0, filename, &error);
if (error)
xml_g_show_error (&error, "after parsing file:\n\t'%s'", filename);
___ GString* dump = xml_tree_dump_node_append (0, node);
if (! dump || ! dump->str) {
g_warning ("could not dump tree from internals");
return 1;
} |
xml_g_string_to_file (dump, 0);
g_string_free (dump, 1);
return 0;
____;____;____;____;
} |
|