+2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
+
+ * xml.c (parse_region): If a document contains only comments,
+ return that, too.
+
2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
* xml.c (make_dom): Return comments, too.
if (doc != NULL)
{
- node = xmlDocGetRootElement (doc);
- if (node != NULL)
- result = make_dom (node);
+ xmlNode *n = doc->children->next;
+ Lisp_Object r = Qnil;
+
+ while (n) {
+ if (r != Qnil)
+ result = Fcons (r, result);
+ r = make_dom (n);
+ n = n->next;
+ }
+
+ if (result == Qnil)
+ result = r;
+ else
+ result = Fnreverse (Fcons (r, result));
+
xmlFreeDoc (doc);
xmlCleanupParser ();
}