Commits

Walter Dörwald committed fc38d41

Whether an attribute is allowed has to be checked via their XML name
in the HTMLParser.

Fix a regression: "namespace"=>"xmlns".

  • Participants
  • Parent commits e87a0ff

Comments (0)

Files changed (1)

 			else: # ; found
 				if part[0] != "#": # named entity
 					name = part[:pos]
-					if name in html.namespace.charrefsByName:
-						node.append(html.namespace.charrefsByName[name](), part[pos+1:])
-					elif name in xsc.namespace.charrefsByName:
-						node.append(xsc.namespace.charrefsByName[name](), part[pos+1:])
+					if name in html.xmlns.charrefsByName:
+						node.append(html.xmlns.charrefsByName[name](), part[pos+1:])
+					elif name in xsc.xmlns.charrefsByName:
+						node.append(xsc.xmlns.charrefsByName[name](), part[pos+1:])
 					else:
 						node.append("&", part)
 				else: # numeric entity
 		for (attrname, attrvalue) in attrs:
 			attrname = attrname.lower()
 			element = html.xmlns.elementsByName[name]
-			if element.isallowedattr(attrname):
+			if attrname in element.Attrs._handlersByXMLName:
 				newattrs[attrname] = attrvalue
 			else:
 				errors.warn(errors.IllegalAttrError(element.Attrs, attrname))