15 #include <sys/types.h>
27 #include <libxml/parser.h>
28 #include <libxml/tree.h>
53 if (stat(path, &st) < 0)
60 if ((st.st_mode & S_IFMT) == S_IFREG)
62 xmlDoc *doc = xmlParseFile(path);
65 xmlNodePtr t = xmlDocGetRootElement(doc);
67 *sib = xmlAddNextSibling(*sib, xmlCopyNode(t, 1));
93 sib = xmlNewComment((
const xmlChar *)
wrbuf_cstr(w));
94 xmlReplaceNode(*np, sib);
117 c = xmlNewComment((
const xmlChar *)
wrbuf_cstr(w));
118 sib = xmlAddNextSibling(sib, c);
127 for (n = n->children; n; n = n->next)
129 if (n->type == XML_ELEMENT_NODE)
131 if (!strcmp((
const char *) n->name,
"include"))
133 xmlChar *src = xmlGetProp(n, (xmlChar *)
"src");