X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ab1dc14b220747e527d507d40905a24ba5c692d9..bfc58a84b276919f675b0c65e84ea97238833033:/lisp/xml.el diff --git a/lisp/xml.el b/lisp/xml.el index d395f75ec0..a3d34670bf 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -1,6 +1,6 @@ ;;; xml.el --- XML parser -;; Copyright (C) 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 2000-2013 Free Software Foundation, Inc. ;; Author: Emmanuel Briot ;; Maintainer: Mark A. Hershberger @@ -200,7 +200,7 @@ See also `xml-get-attribute-or-nil'." ;; [68] EntityRef ::= '&' Name ';' (defconst xml-entity-ref (concat "&" xml-name-re ";")) -(defconst xml-entity-or-char-ref-re (concat "&\\(?:#\\(x\\)?\\([0-9]+\\)\\|\\(" +(defconst xml-entity-or-char-ref-re (concat "&\\(?:#\\(x\\)?\\([0-9a-fA-F]+\\)\\|\\(" xml-name-re "\\)\\);")) ;; [69] PEReference ::= '%' Name ';' @@ -611,7 +611,7 @@ references." xml-validating-parser (error "XML: (Validity) Invalid character reference `%s'" (match-string 0))) - (replace-match (or (string val) xml-undefined-entity) t t)) + (replace-match (if val (string val) xml-undefined-entity) t t)) ;; For an entity reference, search again from the start of ;; the replaced text, since the replacement can contain ;; entity or character references, or markup. @@ -620,7 +620,7 @@ references." (and (null val) xml-validating-parser (error "XML: (Validity) Undefined entity `%s'" ref)) - (replace-match (cdr val) t t) + (replace-match (or (cdr val) xml-undefined-entity) t t) (goto-char (match-beginning 0))) ;; Check for XML bombs. (and xml-entity-expansion-limit