summaryrefslogtreecommitdiff
path: root/lisp/xml.el
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@everybody.org>2004-12-02 07:48:25 +0000
committerMark A. Hershberger <mah@everybody.org>2004-12-02 07:48:25 +0000
commit63b446bce0c9d3e31dca2f09c4d91227233151af (patch)
tree593d430f3758ed00c544e21ca39777371b6c9bf5 /lisp/xml.el
parent27720433ac57a33a78b219107a01c20e65092814 (diff)
downloademacs-63b446bce0c9d3e31dca2f09c4d91227233151af.tar.gz
Skip parameter entity declarations.
Diffstat (limited to 'lisp/xml.el')
-rw-r--r--lisp/xml.el18
1 files changed, 17 insertions, 1 deletions
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 "<!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'()+,./:=?;!*#@$_%]*\""
+ "\\|'[- \r\na-zA-Z0-9()+,./:=?;!*#@$_%]*'\\)[ \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"))))))