| 589 | self.property_depth_map = {} |
| 590 | |
| 591 | def _normalize_attributes(self, kv): |
| 592 | k = kv[0].lower() |
| 593 | v = k in ('rel', 'type') and kv[1].lower() or kv[1] |
| 594 | # the sgml parser doesn't handle entities in attributes, nor |
| 595 | # does it pass the attribute values through as unicode, while |
| 596 | # strict xml parsers do -- account for this difference |
| 597 | if isinstance(self, _LooseFeedParser): |
| 598 | v = v.replace('&', '&') |
| 599 | if not isinstance(v, unicode): |
| 600 | v = v.decode('utf-8') |
| 601 | return (k, v) |
| 602 | |
| 603 | def unknown_starttag(self, tag, attrs): |
| 604 | # increment depth counter |