2005-05-26 Mark A. Hershberger <mah@everybody.org>
authorMark A. Hershberger <mah@everybody.org>
Thu, 26 May 2005 14:35:47 +0000 (14:35 +0000)
committerMark A. Hershberger <mah@everybody.org>
Thu, 26 May 2005 14:35:47 +0000 (14:35 +0000)
* xml.el (xml-substitute-special): Don't die for undefined xml
entities.

lisp/ChangeLog
lisp/xml.el

index 852de36..dbd80ea 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-26  Mark A. Hershberger  <mah@everybody.org>
+
+       * xml.el (xml-substitute-special): Don't die for undefined xml
+       entities.
+
 2005-05-26  Lute Kamstra  <lute@gnu.org>
 
        * arc-mode.el (archive-mode):
index daf5689..f9527a2 100644 (file)
@@ -84,6 +84,9 @@
 ;;**
 ;;*******************************************************************
 
+(defconst xml-undefined-entity "?"
+  "What to substitute for undefined entities")
+
 (defvar xml-entity-alist
   '(("lt"   . "<")
     ("gt"   . ">")
@@ -745,9 +748,10 @@ This follows the rule [28] in the XML specifications."
                    ((eq (length this-part) 0)
                     (error "XML: (Not Well-Formed) No entity given"))
                    (t
-                    (when xml-validating-parser
+                    (if xml-validating-parser
                         (error "XML: (Validity) Undefined entity `%s'"
-                               this-part))))))
+                               this-part)
+                      xml-undefined-entity)))))
 
        (cond ((null children)
               ;; FIXME: If we have an entity that expands into XML, this won't work.