aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark A. Hershberger2004-12-01 04:45:08 +0000
committerMark A. Hershberger2004-12-01 04:45:08 +0000
commitae0261106903fdd8e1aefe92549d4d88e521e6e6 (patch)
tree9f4b49adff90719bead58aa6fe85caa12fc171af
parent034a48f4d34a43f7599b71369c561227767304f9 (diff)
downloademacs-ae0261106903fdd8e1aefe92549d4d88e521e6e6.tar.gz
emacs-ae0261106903fdd8e1aefe92549d4d88e521e6e6.zip
2004-11-30 Mark A. Hershberger <mah@everybody.org>
* xml.el (xml-substitute-special): Fix validity error messages to actually show the unexpandable entity. Added validity error if & isn't followed by an entity. (xml-parse-tag): Concatnate any string following the a <![CDATA[]]> section to the parsed CDATA.
-rw-r--r--lisp/xml.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/xml.el b/lisp/xml.el
index b0d5d45f98d..ec048a440bd 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -371,7 +371,9 @@ Returns one of:
371 (let ((pos (match-end 0))) 371 (let ((pos (match-end 0)))
372 (unless (search-forward "]]>" nil t) 372 (unless (search-forward "]]>" nil t)
373 (error "XML: (Not Well Formed) CDATA section does not end anywhere in the document")) 373 (error "XML: (Not Well Formed) CDATA section does not end anywhere in the document"))
374 (buffer-substring pos (match-beginning 0)))) 374 (concat
375 (buffer-substring pos (match-beginning 0))
376 (xml-parse-string))))
375 ;; DTD for the document 377 ;; DTD for the document
376 ((looking-at "<!DOCTYPE") 378 ((looking-at "<!DOCTYPE")
377 (let ((dtd (xml-parse-dtd parse-ns))) 379 (let ((dtd (xml-parse-dtd parse-ns)))
@@ -703,7 +705,7 @@ This follows the rule [28] in the XML specifications."
703 705
704 (let ((point 0) 706 (let ((point 0)
705 children end-point) 707 children end-point)
706 (while (string-match "&\\([^;]+\\);" string point) 708 (while (string-match "&\\([^;]*\\);" string point)
707 (setq end-point (match-end 0)) 709 (setq end-point (match-end 0))
708 (let* ((this-part (match-string 1 string)) 710 (let* ((this-part (match-string 1 string))
709 (prev-part (substring string point (match-beginning 0))) 711 (prev-part (substring string point (match-beginning 0)))
@@ -721,10 +723,12 @@ This follows the rule [28] in the XML specifications."
721 (if c (string c)))) 723 (if c (string c))))
722 (entity 724 (entity
723 (cdr entity)) 725 (cdr entity))
726 ((eq (length this-part) 0)
727 (error "XML: (Validity) No entity given"))
724 (t 728 (t
725 (if xml-validating-parser 729 (if xml-validating-parser
726 (error "XML: (Validity) Undefined entity `%s'" 730 (error "XML: (Validity) Undefined entity `%s'"
727 (match-string 1 this-part))))))) 731 this-part))))))
728 732
729 (cond ((null children) 733 (cond ((null children)
730 ;; FIXME: If we have an entity that expands into XML, this won't work. 734 ;; FIXME: If we have an entity that expands into XML, this won't work.