diff options
author | Guido van Rossum <guido@python.org> | 1998-12-08 13:25:00 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-12-08 13:25:00 (GMT) |
commit | 204b65c50ffcbe62ae3b38b4dbb82ae875fb568d (patch) | |
tree | 0839295608f5cff5b5872ec8e788055543295aa1 /Lib | |
parent | f0f3600d0bd931572df4ca66b8a4295dd2cf2b41 (diff) | |
download | cpython-204b65c50ffcbe62ae3b38b4dbb82ae875fb568d.zip cpython-204b65c50ffcbe62ae3b38b4dbb82ae875fb568d.tar.gz cpython-204b65c50ffcbe62ae3b38b4dbb82ae875fb568d.tar.bz2 |
Sjoerd patches the previous patch:
In literal mode, also don't do anything about entity and character
references, or about closing CDATA elements.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/xmllib.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/xmllib.py b/Lib/xmllib.py index 4e62ae5..bea210b 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): |