[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/xml.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/xml.el [lexbind] |
Date: |
Wed, 08 Dec 2004 19:16:52 -0500 |
Index: emacs/lisp/xml.el
diff -c emacs/lisp/xml.el:1.10.2.10 emacs/lisp/xml.el:1.10.2.11
*** emacs/lisp/xml.el:1.10.2.10 Mon Oct 25 04:19:40 2004
--- emacs/lisp/xml.el Wed Dec 8 23:36:20 2004
***************
*** 179,185 ****
xml)))
! (let* ((start-chars (concat ":[:alpha:]_"))
(name-chars (concat "-[:digit:]." start-chars))
;;[3] S ::= (#x20 | #x9 | #xD | #xA)+
(whitespace "[ \t\n\r]"))
--- 179,185 ----
xml)))
! (let* ((start-chars (concat "[:alpha:]:_"))
(name-chars (concat "-[:digit:]." start-chars))
;;[3] S ::= (#x20 | #x9 | #xD | #xA)+
(whitespace "[ \t\n\r]"))
***************
*** 371,377 ****
(let ((pos (match-end 0)))
(unless (search-forward "]]>" nil t)
(error "XML: (Not Well Formed) CDATA section does not end anywhere in
the document"))
! (buffer-substring pos (match-beginning 0))))
;; DTD for the document
((looking-at "<!DOCTYPE")
(let ((dtd (xml-parse-dtd parse-ns)))
--- 371,379 ----
(let ((pos (match-end 0)))
(unless (search-forward "]]>" nil t)
(error "XML: (Not Well Formed) CDATA section does not end anywhere in
the document"))
! (concat
! (buffer-substring pos (match-beginning 0))
! (xml-parse-string))))
;; DTD for the document
((looking-at "<!DOCTYPE")
(let ((dtd (xml-parse-dtd parse-ns)))
***************
*** 599,605 ****
(t
(if xml-validating-parser
(error "XML: (Validity) Invalid element type in the DTD"))))
!
;; rule [45]: the element declaration must be unique
(if (and (assoc element dtd)
xml-validating-parser)
--- 601,607 ----
(t
(if xml-validating-parser
(error "XML: (Validity) Invalid element type in the DTD"))))
!
;; rule [45]: the element declaration must be unique
(if (and (assoc element dtd)
xml-validating-parser)
***************
*** 650,657 ****
(xml-parse-fragment
xml-validating-parser
parse-ns))))))))
(t
! (error "XML: (Validity) Invalid DTD item")))))
(if (looking-at "\\s-*]>")
(goto-char (nth 1 (match-data)))))
(nreverse dtd)))
--- 652,676 ----
(xml-parse-fragment
xml-validating-parser
parse-ns))))))))
+ ;; skip parameter entity declarations
+ ((or (looking-at (concat "<!ENTITY[ \t\n\r]+%[ \t\n\r]+\\("
xml-name-re
+ "\\)[ \t\n\r]+SYSTEM[ \t\n\r]+"
+ "\\(\"[^\"]*\"\\|'[^']*'\\)[ \t\n\r]*>"))
+ (looking-at (concat "<!ENTITY[ \t\n\r]+"
+ "%[ \t\n\r]+"
+ "\\(" xml-name-re "\\)[ \t\n\r]+"
+ "PUBLIC[ \t\n\r]+"
+ "\\(\"[-
\r\na-zA-Z0-9'()+,./:=?;address@hidden""
+ "\\|'[-
\r\na-zA-Z0-9()+,./:=?;address@hidden'\\)[ \t\n\r]+"
+ "\\(\"[^\"]+\"\\|'[^']+'\\)"
+ "[ \t\n\r]*>")))
+ (goto-char (match-end 0)))
+ ;; skip parameter entities
+ ((looking-at (concat "%" xml-name-re ";"))
+ (goto-char (match-end 0)))
(t
! (when xml-validating-parser
! (error "XML: (Validity) Invalid DTD item"))))))
(if (looking-at "\\s-*]>")
(goto-char (nth 1 (match-data)))))
(nreverse dtd)))
***************
*** 703,709 ****
(let ((point 0)
children end-point)
! (while (string-match "&\\([^;]+\\);" string point)
(setq end-point (match-end 0))
(let* ((this-part (match-string 1 string))
(prev-part (substring string point (match-beginning 0)))
--- 722,728 ----
(let ((point 0)
children end-point)
! (while (string-match "&\\([^;]*\\);" string point)
(setq end-point (match-end 0))
(let* ((this-part (match-string 1 string))
(prev-part (substring string point (match-beginning 0)))
***************
*** 721,730 ****
(if c (string c))))
(entity
(cdr entity))
(t
! (if xml-validating-parser
(error "XML: (Validity) Undefined entity `%s'"
! (match-string 1 this-part)))))))
(cond ((null children)
;; FIXME: If we have an entity that expands into XML, this won't
work.
--- 740,751 ----
(if c (string c))))
(entity
(cdr entity))
+ ((eq (length this-part) 0)
+ (error "XML: (Not Well-Formed) No entity given"))
(t
! (when xml-validating-parser
(error "XML: (Validity) Undefined entity `%s'"
! this-part))))))
(cond ((null children)
;; FIXME: If we have an entity that expands into XML, this won't
work.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/xml.el [lexbind],
Miles Bader <=