Commits

Anonymous committed 7b67cdd

2005-10-01 Steve Youngs <steve@sxemacs.org>

* xml.el (xml-parse-region):
* xml.el (xml-parse-tag):
Fix bug where an empty element written as <foo/> incorrectly has a
list of children.
From: David Aspinall <David.Aspinall@ed.ac.uk>

Comments (0)

Files changed (2)

+2005-10-01  Steve Youngs  <steve@sxemacs.org>
+
+	* xml.el (xml-parse-region):
+	* xml.el (xml-parse-tag):
+	Fix bug where an empty element written as <foo/> incorrectly has a
+	list of children.
+	From: David Aspinall <David.Aspinall@ed.ac.uk>
+
 2005-05-01  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.46 released.
 ;;; xml.el --- XML parser
 
+;;; !!! This version has been modified from the version distributed with
+;;; XEmacs to fix a bug parsing empty elements, for Proof General.  !!!
+
 ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
 ;; Author: Emmanuel Briot  <briot@gnat.com>
 		(error "XML files can have only one toplevel tag")))
 	  (goto-char end)))
       (if parse-dtd
-	  (cons dtd (reverse xml))
-	(reverse xml)))))
+	  (cons dtd (nreverse xml))
+	(nreverse xml)))))
 
 
 (defun xml-parse-tag (end &optional parse-dtd)
       (if (looking-at "/>")
 	  (progn
 	    (forward-char 2)
-	    (nreverse (cons '("") children)))
+	    (nreverse children))
 
 	;; is this a valid start tag ?
 	(if (eq (char-after) ?>)