From 63b446bce0c9d3e31dca2f09c4d91227233151af Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 2 Dec 2004 07:48:25 +0000 Subject: [PATCH] Skip parameter entity declarations. --- lisp/ChangeLog | 2 ++ lisp/xml.el | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6f3b0205bbf..50cbc41d107 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,8 @@ isn't followed by an entity. (xml-parse-tag): Concatnate any string following the a section to the parsed CDATA. + (xml-parse-dtd): Skip parameter entity declarations and use of + parameter entities. 2004-12-01 Luc Teirlinck diff --git a/lisp/xml.el b/lisp/xml.el index 550ade8ab8f..aba84d33230 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -179,7 +179,7 @@ If PARSE-NS is non-nil, then QNAMES are expanded." xml))) -(let* ((start-chars (concat ":[:alpha:]_")) +(let* ((start-chars (concat "[:alpha:]:_")) (name-chars (concat "-[:digit:]." start-chars)) ;;[3] S ::= (#x20 | #x9 | #xD | #xA)+ (whitespace "[ \t\n\r]")) @@ -652,6 +652,22 @@ This follows the rule [28] in the XML specifications." (xml-parse-fragment xml-validating-parser parse-ns)))))))) + ;; skip parameter entity declarations + ((or (looking-at (concat "")) + (looking-at (concat ""))) + (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")))))) -- 2.11.4.GIT