From 09c9ca430e49449cc39cbeb7556230cb62df9b19 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 13 Feb 2011 19:40:29 -0500 Subject: Added tests for namespaced doctypes. --- beautifulsoup/element.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'beautifulsoup/element.py') diff --git a/beautifulsoup/element.py b/beautifulsoup/element.py index b2e0e12..8749114 100644 --- a/beautifulsoup/element.py +++ b/beautifulsoup/element.py @@ -372,6 +372,16 @@ class Declaration(NavigableString): class Doctype(NavigableString): + @classmethod + def for_name_and_ids(cls, name, pub_id, system_id): + value = name + if pub_id is not None: + value += ' PUBLIC "%s"' % pub_id + if system_id is not None: + value += ' SYSTEM "%s"' % system_id + + return Doctype(value) + def decodeGivenEventualEncoding(self, eventualEncoding): return u'' -- cgit v1.2.3