From 68b55626839a8a0ea9e750fff546e201d144f96c Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 18 Jul 2018 19:04:36 -0400 Subject: Preserve XML namespaces when they are introduced inside an XML document, not just the ones introduced at the top level. [bug=1718787] --- bs4/testing.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bs4/testing.py') diff --git a/bs4/testing.py b/bs4/testing.py index 9d42702..641663c 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -624,6 +624,17 @@ class XMLTreeBuilderSmokeTest(object): self.assertEqual( soup.encode("utf-8"), markup) + def test_nested_namespaces(self): + doc = """ + + + + + +""" + soup = BeautifulSoup(doc, "lxml-xml") + self.assertEqual(doc, soup.encode()) + def test_formatter_processes_script_tag_for_xml_documents(self): doc = """