2
Copyright (c) 2000 Paul T. Miller
3
License: LGPL ( http://www.gnu.org/copyleft/lgpl.html )
4
Modified from original sample/testread.cpp in xmlio distribution
5
to be suitable for use in the benchmarking system included with
14
static void sDocHandler(XML::Element &elem, void *userData)
16
// found a Document - make a new one
17
Document *doc = new Document(elem.GetAttribute("name"));
21
Document::ObjectList::const_iterator it;
22
for (it = doc->begin(); it != doc->end(); ++it)
24
const Object *obj = (*it);
29
int main(int argc, char **argv)
31
XML::FileInputStream file(argv[1]);
32
XML::Input input(file);
34
// set up initial handler for Document
35
XML::Handler handlers[] = {
36
XML::Handler("Document", sDocHandler),
41
input.Process(handlers, NULL);
43
catch (const XML::ParseException &e)
45
fprintf(stderr, "ERROR: %s (line %d, column %d)\n", e.What(), e.GetLine(), e.GetColumn());