summaryrefslogtreecommitdiff
path: root/test/automated/xml-parse-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/automated/xml-parse-tests.el')
-rw-r--r--test/automated/xml-parse-tests.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/automated/xml-parse-tests.el b/test/automated/xml-parse-tests.el
index 8322a8c6ff9..ec3d7ca3065 100644
--- a/test/automated/xml-parse-tests.el
+++ b/test/automated/xml-parse-tests.el
@@ -33,15 +33,26 @@
'(;; General entity substitution
("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY ent \"AbC\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" .
((foo ((a . "b")) (bar nil "AbC;"))))
+ ("<?xml version=\"1.0\"?><foo>&amp;amp;&#38;apos;&apos;&lt;&gt;&quot;</foo>" .
+ ((foo () "&amp;&apos;'<>\"")))
;; Parameter entity substitution
("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY % pent \"AbC\"><!ENTITY ent \"%pent;\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" .
((foo ((a . "b")) (bar nil "AbC;"))))
;; Tricky parameter entity substitution (like XML spec Appendix D)
("<?xml version='1.0'?><!DOCTYPE foo [ <!ENTITY % xx '&#37;zz;'><!ENTITY % zz '&#60;!ENTITY ent \"b\" >' > %xx; ]><foo>A&ent;C</foo>" .
- ((foo nil "AbC")))
+ ((foo () "AbC")))
;; Bug#7172
("<?xml version=\"1.0\"?><!DOCTYPE foo [ <!ELEMENT EXAM_PLE EMPTY> ]><foo></foo>" .
- ((foo nil))))
+ ((foo ())))
+ ;; Entities referencing entities, in character data
+ ("<!DOCTYPE foo [ <!ENTITY b \"B\"><!ENTITY abc \"a&b;c\">]><foo>&abc;</foo>" .
+ ((foo () "aBc")))
+ ;; Entities referencing entities, in attribute values
+ ("<!DOCTYPE foo [ <!ENTITY b \"B\"><!ENTITY abc \"a&b;c\">]><foo a=\"-&abc;-\">1</foo>" .
+ ((foo ((a . "-aBc-")) "1")))
+ ;; Character references must be treated as character data
+ ("<foo>AT&amp;T;</foo>" . ((foo () "AT&T;")))
+ ("<foo>&#38;amp;</foo>" . ((foo () "&amp;"))))
"Alist of XML strings and their expected parse trees.")
(ert-deftest xml-parse-tests ()