371 |
(let ((pos (match-end 0))) |
(let ((pos (match-end 0))) |
372 |
(unless (search-forward "]]>" nil t) |
(unless (search-forward "]]>" nil t) |
373 |
(error "XML: (Not Well Formed) CDATA section does not end anywhere in the document")) |
(error "XML: (Not Well Formed) CDATA section does not end anywhere in the document")) |
374 |
(buffer-substring pos (match-beginning 0)))) |
(concat |
375 |
|
(buffer-substring pos (match-beginning 0)) |
376 |
|
(xml-parse-string)))) |
377 |
;; DTD for the document |
;; DTD for the document |
378 |
((looking-at "<!DOCTYPE") |
((looking-at "<!DOCTYPE") |
379 |
(let ((dtd (xml-parse-dtd parse-ns))) |
(let ((dtd (xml-parse-dtd parse-ns))) |
705 |
|
|
706 |
(let ((point 0) |
(let ((point 0) |
707 |
children end-point) |
children end-point) |
708 |
(while (string-match "&\\([^;]+\\);" string point) |
(while (string-match "&\\([^;]*\\);" string point) |
709 |
(setq end-point (match-end 0)) |
(setq end-point (match-end 0)) |
710 |
(let* ((this-part (match-string 1 string)) |
(let* ((this-part (match-string 1 string)) |
711 |
(prev-part (substring string point (match-beginning 0))) |
(prev-part (substring string point (match-beginning 0))) |
723 |
(if c (string c)))) |
(if c (string c)))) |
724 |
(entity |
(entity |
725 |
(cdr entity)) |
(cdr entity)) |
726 |
|
((eq (length this-part) 0) |
727 |
|
(error "XML: (Validity) No entity given")) |
728 |
(t |
(t |
729 |
(if xml-validating-parser |
(if xml-validating-parser |
730 |
(error "XML: (Validity) Undefined entity `%s'" |
(error "XML: (Validity) Undefined entity `%s'" |
731 |
(match-string 1 this-part))))))) |
this-part)))))) |
732 |
|
|
733 |
(cond ((null children) |
(cond ((null children) |
734 |
;; FIXME: If we have an entity that expands into XML, this won't work. |
;; FIXME: If we have an entity that expands into XML, this won't work. |