APPROVE COMMIT
Thanks very much, David. I've committed this.
2005-10-01 Steve Youngs <steve(a)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(a)ed.ac.uk>
Index: xml.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/net-utils/xml.el,v
retrieving revision 1.2
diff -u -p -r1.2 xml.el
--- xml.el 3 Dec 2003 01:35:17 -0000 1.2
+++ xml.el 30 Sep 2005 22:45:45 -0000
@@ -1,5 +1,8 @@
;;; 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(a)gnat.com>
@@ -169,8 +172,8 @@ and returned as the first element of the
(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)
@@ -225,7 +228,7 @@ Returns one of:
(if (looking-at "/>")
(progn
(forward-char 2)
- (nreverse (cons '("") children)))
+ (nreverse children))
;; is this a valid start tag ?
(if (eq (char-after) ?>)
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| I am Dyslexic of Borg. |
| Fusistance is retile. Your arse will be laminated. |
|------------------------------------<steve(a)sxemacs.org>---|
Show replies by date