Mercurial > emacs
comparison lisp/xml.el @ 62752:d0f8033496b1
2005-05-26 Mark A. Hershberger <mah@everybody.org>
* xml.el (xml-substitute-special): Don't die for undefined xml
entities.
author | Mark A. Hershberger <mah@everybody.org> |
---|---|
date | Thu, 26 May 2005 14:35:47 +0000 |
parents | e696b8c143a0 |
children | 3609dc754369 01137c1fdbe9 |
comparison
equal
deleted
inserted
replaced
62751:16493952e648 | 62752:d0f8033496b1 |
---|---|
81 ;;******************************************************************* | 81 ;;******************************************************************* |
82 ;;** | 82 ;;** |
83 ;;** Macros to parse the list | 83 ;;** Macros to parse the list |
84 ;;** | 84 ;;** |
85 ;;******************************************************************* | 85 ;;******************************************************************* |
86 | |
87 (defconst xml-undefined-entity "?" | |
88 "What to substitute for undefined entities") | |
86 | 89 |
87 (defvar xml-entity-alist | 90 (defvar xml-entity-alist |
88 '(("lt" . "<") | 91 '(("lt" . "<") |
89 ("gt" . ">") | 92 ("gt" . ">") |
90 ("apos" . "'") | 93 ("apos" . "'") |
743 (entity | 746 (entity |
744 (cdr entity)) | 747 (cdr entity)) |
745 ((eq (length this-part) 0) | 748 ((eq (length this-part) 0) |
746 (error "XML: (Not Well-Formed) No entity given")) | 749 (error "XML: (Not Well-Formed) No entity given")) |
747 (t | 750 (t |
748 (when xml-validating-parser | 751 (if xml-validating-parser |
749 (error "XML: (Validity) Undefined entity `%s'" | 752 (error "XML: (Validity) Undefined entity `%s'" |
750 this-part)))))) | 753 this-part) |
754 xml-undefined-entity))))) | |
751 | 755 |
752 (cond ((null children) | 756 (cond ((null children) |
753 ;; FIXME: If we have an entity that expands into XML, this won't work. | 757 ;; FIXME: If we have an entity that expands into XML, this won't work. |
754 (setq children | 758 (setq children |
755 (concat prev-part expansion))) | 759 (concat prev-part expansion))) |