Source

net-utils / xml.el

Diff from to

File xml.el

 ;;; 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>
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 		(error "XML files can have only one toplevel tag")))
 	  (goto-char end)))
       (if parse-dtd
-	  (cons dtd (nreverse xml))
-	(nreverse xml)))))
+	  (cons dtd (reverse xml))
+	(reverse xml)))))
 
+(eval-when-compile (defvar pos))
 
 (defun xml-parse-tag (end &optional parse-dtd)
   "Parse the tag that is just in front of point.
       (if (looking-at "/>")
 	  (progn
 	    (forward-char 2)
-	    (nreverse children))
+	    (nreverse (cons '("") children)))
 
 	;; is this a valid start tag ?
 	(if (eq (char-after) ?>)