Kaydet (Commit) 204b65c5 authored tarafından Guido van Rossum's avatar Guido van Rossum

Sjoerd patches the previous patch:

In literal mode, also don't do anything about entity and character
references, or about closing CDATA elements.
üst f0f3600d
...@@ -264,6 +264,11 @@ class XMLParser: ...@@ -264,6 +264,11 @@ class XMLParser:
i = k i = k
continue continue
elif rawdata[i] == '&': elif rawdata[i] == '&':
if self.literal:
data = rawdata[i]
self.handle_data(data)
i = i+1
continue
res = charref.match(rawdata, i) res = charref.match(rawdata, i)
if res is not None: if res is not None:
i = res.end(0) i = res.end(0)
...@@ -292,6 +297,11 @@ class XMLParser: ...@@ -292,6 +297,11 @@ class XMLParser:
self.lineno = self.lineno + string.count(res.group(0), '\n') self.lineno = self.lineno + string.count(res.group(0), '\n')
continue continue
elif rawdata[i] == ']': elif rawdata[i] == ']':
if self.literal:
data = rawdata[i]
self.handle_data(data)
i = i+1
continue
if n-i < 3: if n-i < 3:
break break
if cdataclose.match(rawdata, i): if cdataclose.match(rawdata, i):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment