;;; xml.el --- XML parser
-;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
;; Author: Emmanuel Briot <briot@gnat.com>
;; Maintainer: Mark A. Hershberger <mah@everybody.org>
(cond
((null result)
;; Not looking at an xml start tag.
- (forward-char 1))
+ (unless (eobp)
+ (forward-char 1)))
((and xml (not xml-sub-parser))
;; Translation of rule [1] of XML specifications
(error "XML: (Not Well-Formed) Only one root tag allowed"))
;; skip comments
((looking-at "<!--")
(search-forward "-->")
- nil)
+ (skip-syntax-forward " ")
+ (unless (eobp)
+ (xml-parse-tag parse-dtd xml-ns)))
;; end tag
((looking-at "</")
'())
(replace-regexp-in-string "\\s-\\{2,\\}" " " string)
(let ((expansion (xml-substitute-special string)))
(unless (stringp expansion)
- ; We say this is the constraint. It is acctually that
+ ; We say this is the constraint. It is actually that neither
; external entities nor "<" can be in an attribute value.
(error "XML: (Not Well-Formed) Entities in attributes cannot expand into elements"))
(push (cons name expansion) attlist)))
;;*******************************************************************
(defun xml-substitute-special (string)
- "Return STRING, after subsituting entity references."
+ "Return STRING, after substituting entity references."
;; This originally made repeated passes through the string from the
;; beginning, which isn't correct, since then either "&amp;" or
;; "&amp;" won't DTRT.