aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark A. Hershberger2004-12-02 07:48:25 +0000
committerMark A. Hershberger2004-12-02 07:48:25 +0000
commit63b446bce0c9d3e31dca2f09c4d91227233151af (patch)
tree593d430f3758ed00c544e21ca39777371b6c9bf5
parent27720433ac57a33a78b219107a01c20e65092814 (diff)
downloademacs-63b446bce0c9d3e31dca2f09c4d91227233151af.tar.gz
emacs-63b446bce0c9d3e31dca2f09c4d91227233151af.zip
Skip parameter entity declarations.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/xml.el18
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6f3b0205bbf..50cbc41d107 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,8 @@
7 isn't followed by an entity. 7 isn't followed by an entity.
8 (xml-parse-tag): Concatnate any string following the a 8 (xml-parse-tag): Concatnate any string following the a
9 <![CDATA[]]> section to the parsed CDATA. 9 <![CDATA[]]> section to the parsed CDATA.
10 (xml-parse-dtd): Skip parameter entity declarations and use of
11 parameter entities.
10 12
112004-12-01 Luc Teirlinck <teirllm@auburn.edu> 132004-12-01 Luc Teirlinck <teirllm@auburn.edu>
12 14
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."
179 xml))) 179 xml)))
180 180
181 181
182(let* ((start-chars (concat ":[:alpha:]_")) 182(let* ((start-chars (concat "[:alpha:]:_"))
183 (name-chars (concat "-[:digit:]." start-chars)) 183 (name-chars (concat "-[:digit:]." start-chars))
184;;[3] S ::= (#x20 | #x9 | #xD | #xA)+ 184;;[3] S ::= (#x20 | #x9 | #xD | #xA)+
185 (whitespace "[ \t\n\r]")) 185 (whitespace "[ \t\n\r]"))
@@ -652,6 +652,22 @@ This follows the rule [28] in the XML specifications."
652 (xml-parse-fragment 652 (xml-parse-fragment
653 xml-validating-parser 653 xml-validating-parser
654 parse-ns)))))))) 654 parse-ns))))))))
655 ;; skip parameter entity declarations
656 ((or (looking-at (concat "<!ENTITY[ \t\n\r]+%[ \t\n\r]+\\(" xml-name-re
657 "\\)[ \t\n\r]+SYSTEM[ \t\n\r]+"
658 "\\(\"[^\"]*\"\\|'[^']*'\\)[ \t\n\r]*>"))
659 (looking-at (concat "<!ENTITY[ \t\n\r]+"
660 "%[ \t\n\r]+"
661 "\\(" xml-name-re "\\)[ \t\n\r]+"
662 "PUBLIC[ \t\n\r]+"
663 "\\(\"[- \r\na-zA-Z0-9'()+,./:=?;!*#@$_%]*\""
664 "\\|'[- \r\na-zA-Z0-9()+,./:=?;!*#@$_%]*'\\)[ \t\n\r]+"
665 "\\(\"[^\"]+\"\\|'[^']+'\\)"
666 "[ \t\n\r]*>")))
667 (goto-char (match-end 0)))
668 ;; skip parameter entities
669 ((looking-at (concat "%" xml-name-re ";"))
670 (goto-char (match-end 0)))
655 (t 671 (t
656 (when xml-validating-parser 672 (when xml-validating-parser
657 (error "XML: (Validity) Invalid DTD item")))))) 673 (error "XML: (Validity) Invalid DTD item"))))))