summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/xmllib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/xmllib.py b/Lib/xmllib.py
index 4e62ae5486..bea210b6fc 100644
--- a/Lib/xmllib.py
+++ b/Lib/xmllib.py
@@ -264,6 +264,11 @@ class XMLParser:
i = k
continue
elif rawdata[i] == '&':
+ if self.literal:
+ data = rawdata[i]
+ self.handle_data(data)
+ i = i+1
+ continue
res = charref.match(rawdata, i)
if res is not None:
i = res.end(0)
@@ -292,6 +297,11 @@ class XMLParser:
self.lineno = self.lineno + string.count(res.group(0), '\n')
continue
elif rawdata[i] == ']':
+ if self.literal:
+ data = rawdata[i]
+ self.handle_data(data)
+ i = i+1
+ continue
if n-i < 3:
break
if cdataclose.match(rawdata, i):