def load_dtd(sysid): import dtdparser, xmldtd dp = dtdparser.DTDParser() dtd = xmldtd.CompleteDTD(dp) dp.set_dtd_consumer(dtd) dp.parse_resource(sysid) return dtd
def load_dtd(sysid): import dtdparser, utils dp = dtdparser.DTDParser() dp.set_error_handler(utils.ErrorPrinter(dp)) dtd = CompleteDTD(dp) dp.set_dtd_consumer(dtd) dp.parse_resource(sysid) return dtd
def load_dtd_string(dtdstr): import dtdparser, utils dp = dtdparser.DTDParser() dp.set_error_handler(utils.ErrorPrinter(dp)) dtd = CompleteDTD(dp) dp.set_dtd_consumer(dtd) dp.parse_string(dtdstr) return dtd
def parse_content_model(cm): "Parses a content model string, returning a compiled content model." import dtdparser, utils p = dtdparser.DTDParser() p.set_error_handler(utils.ErrorPrinter(p)) p.data = cm[1:] p.datasize = len(p.data) p.final = 1 return p._parse_content_model()