int
main (int argc, char** argv)
{
xml_g_set_prgname(argv[0]);
if (argc < 2)
{
g_printerr ("> %s filename\n"
"\t creates two files filename.txt and filename.txt.xml\n"
"\t where one contains the textarray and the other has\n"
"\t the infos stored in the xml markup tree\n"
"\t - the numbers in this representation are the offsets\n"
"\t of start/end into the text array where the markup\n"
"\t span starts/ends there\n"
"\t SEE ALSO: xml-to-text xml-to-tree programs\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]);
} | } |
___ xml_GNode* node; GError* error = 0;
node = xml_g_markup_parse_file (0, argv[1], &error);
if (error)
xml_g_show_error (&error, "after parsing file:\n\t'%s'", filename);
___ gchar* file = g_strconcat (filename, ".txt", 0);
xml_tree_node_to_text_file (node, file);
g_free (file);
file = g_strconcat (filename, ".txt.xml", 0);
xml_tree_dump_to_file (node, file);
g_free (file);
return 0;
____;____;____;
} |
|