Пример #1
0
    def _parse_from_source(self, source):
        from org.openxml.dom import SAXBuilder
        from org.openxml.parser import XMLSAXParser

        builder = SAXBuilder()
        parser = XMLSAXParser()
        parser.setDocumentHandler(builder)
        parser.parse(source)
        return Document(builder.getDocument())
Пример #2
0
    def _parse_from_source(self, source):
        from org.openxml.dom import SAXBuilder
        from org.openxml.parser import XMLSAXParser

        builder = SAXBuilder()
        parser = XMLSAXParser()
        parser.setDocumentHandler(builder)
        parser.parse(source)
        return Document(builder.getDocument())