(self)
| 709 | self.xml('<my:a xmlns:my="qux" b="c"/>')) |
| 710 | |
| 711 | def test_5027_1(self): |
| 712 | # The xml prefix (as in xml:lang below) is reserved and bound by |
| 713 | # definition to http://www.w3.org/XML/1998/namespace. XMLGenerator had |
| 714 | # a bug whereby a KeyError is raised because this namespace is missing |
| 715 | # from a dictionary. |
| 716 | # |
| 717 | # This test demonstrates the bug by parsing a document. |
| 718 | test_xml = StringIO( |
| 719 | '<?xml version="1.0"?>' |
| 720 | '<a:g1 xmlns:a="http://example.com/ns">' |
| 721 | '<a:g2 xml:lang="en">Hello</a:g2>' |
| 722 | '</a:g1>') |
| 723 | |
| 724 | parser = make_parser() |
| 725 | parser.setFeature(feature_namespaces, True) |
| 726 | result = self.ioclass() |
| 727 | gen = XMLGenerator(result) |
| 728 | parser.setContentHandler(gen) |
| 729 | parser.parse(test_xml) |
| 730 | |
| 731 | self.assertEqual(result.getvalue(), |
| 732 | self.xml( |
| 733 | '<a:g1 xmlns:a="http://example.com/ns">' |
| 734 | '<a:g2 xml:lang="en">Hello</a:g2>' |
| 735 | '</a:g1>')) |
| 736 | |
| 737 | def test_5027_2(self): |
| 738 | # The xml prefix (as in xml:lang below) is reserved and bound by |
nothing calls this directly
no test coverage detected