Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def startElement(self, name, attrs):
self.namespace = Namespace(attrs, self.namespace)
name = self.namespace.map(name)
if not self.path_stack and name not in VALID_ROOTS:
raise FeedParseError(
msg='Unsupported feed type: {}'.format(name),
exception=None,
locator=self._locator,
)
self.path_stack.append(name)
target = MAPPING.get('/'.join(self.path_stack))
if target is not None:
target.start(self, attrs)
if target.WANT_TEXT:
self.text = []