mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474)
This commit is contained in:
parent
d4b9edd505
commit
6a412c94b6
3 changed files with 15 additions and 0 deletions
|
@ -3899,6 +3899,14 @@ class C14NTest(unittest.TestCase):
|
|||
#self.assertEqual(c14n_roundtrip("<doc xmlns:x='http://example.com/x' xmlns='http://example.com/default'><b y:a1='1' xmlns='http://example.com/default' a3='3' xmlns:y='http://example.com/y' y:a2='2'/></doc>"),
|
||||
#'<doc xmlns:x="http://example.com/x"><b xmlns:y="http://example.com/y" a3="3" y:a1="1" y:a2="2"></b></doc>')
|
||||
|
||||
# Namespace issues
|
||||
xml = '<X xmlns="http://nps/a"><Y targets="abc,xyz"></Y></X>'
|
||||
self.assertEqual(c14n_roundtrip(xml), xml)
|
||||
xml = '<X xmlns="http://nps/a"><Y xmlns="http://nsp/b" targets="abc,xyz"></Y></X>'
|
||||
self.assertEqual(c14n_roundtrip(xml), xml)
|
||||
xml = '<X xmlns="http://nps/a"><Y xmlns:b="http://nsp/b" b:targets="abc,xyz"></Y></X>'
|
||||
self.assertEqual(c14n_roundtrip(xml), xml)
|
||||
|
||||
def test_c14n_exclusion(self):
|
||||
xml = textwrap.dedent("""\
|
||||
<root xmlns:x="http://example.com/x">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue