'Load the internal subset if there might be one.'

def _setup_subset(self, buffer):

    if self.document.doctype:
        extractor = InternalSubsetExtractor()
        extractor.parseString(buffer)
        subset = extractor.getSubset()
        self.document.doctype.internalSubset = subset
