def _strip_namespace ( self , xml ) : p = re . compile ( b"xmlns=*[\"\"][^\"\"]*[\"\"]" ) allmatches = p . finditer ( xml ) for match in allmatches : xml = xml . replace ( match . group ( ) , b"" ) return xml
how to get rid of xml namespaces in python
strips any namespaces from an xml string
def _strip_namespace(self, xml):
        """strips any namespaces from an xml string"""
        p = re.compile(b"xmlns=*[\"\"][^\"\"]*[\"\"]")
        allmatches = p.finditer(xml)
        for match in allmatches:
            xml = xml.replace(match.group(), b"")
        return xml