/* * SXML: sample program to print XML file * $Id: sxmlprint.c,v 1.2 2007/08/31 09:57:49 kouichi Exp $ */ #include #include #include #include #include "sxml.h" int main(argc, argv) int argc; char * argv[]; { int fd; if (argc == 1) { fprintf(stderr, "usage: %s \n", argv[0]); exit(64); } fd = open(argv[1], O_RDONLY, 0400); if (fd != -1) { sxml_node_t * root; root = sxml_parse_file(fd); if (root != NULL) { sxml_print_tree(root, stdout); sxml_delete_node(root); } close(fd); } return 0; }