aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml.c
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <[email protected]>2011-09-10 20:14:50 +0200
committerLars Magne Ingebrigtsen <[email protected]>2011-09-10 20:14:50 +0200
commit3134906c9184b5b525d1b2f3251dcbd0c3c6ab71 (patch)
treed6468c226060dfb76e9429175e7d6f8d04100e2f /src/xml.c
parent8d903f4e5d492df1c153ba3d53c19fac9e9ec3f2 (diff)
* xml.c (parse_region): Make the parsing work for non-comment-starting XML files again.
Fixes: debbugs:9144
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/xml.c b/src/xml.c
index 8b485e7364..f0422875f7 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -124,6 +124,8 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html
if (doc != NULL)
{
+ /* If the document is just comments, then this should get us the
+ nodes anyway. */
xmlNode *n = doc->children->next;
Lisp_Object r = Qnil;
@@ -134,9 +136,13 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html
n = n->next;
}
- if (NILP (result))
- result = r;
- else
+ if (NILP (result)) {
+ /* The document isn't just comments, so get the tree the
+ proper way. */
+ xmlNode *node = xmlDocGetRootElement (doc);
+ if (node != NULL)
+ result = make_dom (node);
+ } else
result = Fcons (intern ("top"),
Fcons (Qnil, Fnreverse (Fcons (r, result))));