示例#1
0
    def insertDoctype(self, token):
        name = token["name"]
        publicId = token["publicId"]
        systemId = token["systemId"]

        doctype = Doctype.for_name_and_ids(name, publicId, systemId)
        self.soup.object_was_parsed(doctype)
示例#2
0
    def insertDoctype(self, token):
        name = token["name"]
        publicId = token["publicId"]
        systemId = token["systemId"]

        doctype = Doctype.for_name_and_ids(name, publicId, systemId)
        self.soup.object_was_parsed(doctype)
示例#3
0
 def test_doctype_ends_in_newline(self):
     # Unlike other NavigableString subclasses, a DOCTYPE always ends
     # in a newline.
     doctype = Doctype("foo")
     soup = self.soup("")
     soup.insert(1, doctype)
     assert soup.encode() == b"<!DOCTYPE foo>\n"
示例#4
0
def _add_document(soup, node, soup_listing):
    if node.has_doctype:
        doctype = Doctype.for_name_and_ids(node.name, node.public_identifier,
                                           node.system_identifier)
        doctype.offset = node.offset
        soup.object_was_parsed(doctype)
        soup_listing.append(doctype)
示例#5
0
 def doctype(self, name, pubid, system):
     self.soup.endData()
     doctype = Doctype.for_name_and_ids(name, pubid, system)
     self.soup.object_was_parsed(doctype)
示例#6
0
	def doctype(self, name, pubid, system):
		self.soup.endData()
		doctype = Doctype.for_name_and_ids(name, pubid, system)
		self.soup.object_was_parsed(doctype)