MCPcopy Index your code
hub / github.com/RustPython/RustPython / start_element_ns

Method start_element_ns

Lib/xml/sax/expatreader.py:346–378  ·  view source on GitHub ↗
(self, name, attrs)

Source from the content-addressed store, hash-verified

344 self._cont_handler.endElement(name)
345
346 def start_element_ns(self, name, attrs):
347 pair = name.split()
348 if len(pair) == 1:
349 # no namespace
350 pair = (None, name)
351 elif len(pair) == 3:
352 pair = pair[0], pair[1]
353 else:
354 # default namespace
355 pair = tuple(pair)
356
357 newattrs = {}
358 qnames = {}
359 for (aname, value) in attrs.items():
360 parts = aname.split()
361 length = len(parts)
362 if length == 1:
363 # no namespace
364 qname = aname
365 apair = (None, aname)
366 elif length == 3:
367 qname = "%s:%s" % (parts[2], parts[1])
368 apair = parts[0], parts[1]
369 else:
370 # default namespace
371 qname = parts[1]
372 apair = tuple(parts)
373
374 newattrs[apair] = value
375 qnames[apair] = qname
376
377 self._cont_handler.startElementNS(pair, None,
378 AttributesNSImpl(newattrs, qnames))
379
380 def end_element_ns(self, name):
381 pair = name.split()

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
AttributesNSImplClass · 0.85
splitMethod · 0.45
itemsMethod · 0.45
startElementNSMethod · 0.45

Tested by

no test coverage detected