summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2012-08-16 10:26:57 -0400
committerLeonard Richardson <leonardr@segfault.org>2012-08-16 10:26:57 -0400
commitf125bdd8f8370223329d1736c1f21224622e0b50 (patch)
treefb76c396fea1b5a19495239fed51c941522f7b0a /bs4/testing.py
parentdc93ed59b82a0be368796a16f8f57b0a62f9a944 (diff)
Use namespace prefixes for namespaced attribute names, instead of
the fully-qualified names given by the lxml parser. [bug=1037597]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index 4fec24b..30e74f4 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -490,6 +490,11 @@ class XMLTreeBuilderSmokeTest(object):
soup = self.soup(markup)
self.assertEqual(unicode(soup.p), markup)
+ def test_namespaced_attributes(self):
+ markup = '<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><bar xsi:schemaLocation="http://www.example.com"/></foo>'
+ soup = self.soup(markup)
+ self.assertEqual(unicode(soup.foo), markup)
+
class HTML5TreeBuilderSmokeTest(HTMLTreeBuilderSmokeTest):
"""Smoke test for a tree builder that supports HTML5."""