Index: Lib/sgmllib.py =================================================================== RCS file: /projects/cvsroot/python/dist/src/Lib/sgmllib.py,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** sgmllib.py 1998/04/16 21:04:26 1.14 --- sgmllib.py 1998/05/28 22:48:53 1.15 *************** *** 20,31 **** '/([a-zA-Z][^<>]*)?|' '![^<>]*)?') ! entityref = re.compile('&([a-zA-Z][a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('&#([0-9]+)[^0-9]') starttagopen = re.compile('<[>a-zA-Z]') shorttagopen = re.compile('<[a-zA-Z][a-zA-Z0-9]*/') shorttag = re.compile('<([a-zA-Z][a-zA-Z0-9]*)/([^/]*)/') endtagopen = re.compile('a-zA-Z]') endbracket = re.compile('[<>]') special = re.compile(']*>') --- 20,33 ---- '/([a-zA-Z][^<>]*)?|' '![^<>]*)?') ! entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('&#([0-9]+)[^0-9]') starttagopen = re.compile('<[>a-zA-Z]') shorttagopen = re.compile('<[a-zA-Z][a-zA-Z0-9]*/') shorttag = re.compile('<([a-zA-Z][a-zA-Z0-9]*)/([^/]*)/') + piopen = re.compile('<\?') + piclose = re.compile('>') endtagopen = re.compile('a-zA-Z]') endbracket = re.compile('[<>]') special = re.compile(']*>') *************** *** 33,39 **** commentclose = re.compile('--[%s]*>' % string.whitespace) tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*') attrfind = re.compile( ! '[ \t\n\r]+([a-zA-Z_][-.a-zA-Z_0-9]*)' + ('([%s]*=[%s]*' % (string.whitespace, string.whitespace)) + r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?') --- 35,41 ---- commentclose = re.compile('--[%s]*>' % string.whitespace) tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*') attrfind = re.compile( ! '[%s]+([a-zA-Z_][-.a-zA-Z_0-9]*)' % string.whitespace + ('([%s]*=[%s]*' % (string.whitespace, string.whitespace)) + r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?') *************** *** 127,132 **** --- 129,143 ---- if k < 0: break i = i+k continue + if piopen.match(rawdata, i): + if self.literal: + self.handle_data(rawdata[i]) + i = i+1 + continue + k = self.parse_pi(i) + if k < 0: break + i = i+k + continue match = special.match(rawdata, i) if match: if self.literal: *************** *** 184,189 **** --- 195,213 ---- j = match.end(0) return j-i + # Internal -- parse processing instr, return length or -1 if not terminated + def parse_pi(self, i): + rawdata = self.rawdata + if rawdata[i:i+2] <> '