def startElementNS(self, name, qname, attrs): self._write(text_type('<' + self.makeName(name))) for pair in self._undeclared_ns_maps: self._write(text_type(' xmlns:%s="%s"' % pair)) self._undeclared_ns_maps = [] for (name, value) in attrs.items(): self._write(text_type(' %s=%s' % (self.makeName(name), quoteattr(value)))) self._write(text_type('>'))
def startElementNS(self, name, qname, attrs): self._write(text_type('<' + self.makeName(name))) for pair in self._undeclared_ns_maps: self._write(text_type(' xmlns:%s="%s"' % pair)) self._undeclared_ns_maps = [] for (name, value) in attrs.items(): self._write( text_type(' %s=%s' % (self.makeName(name), quoteattr(value)))) self._write(text_type('>'))
def __str__(self): text = u'' for x in self._dir: # "six.text_type" is unicode in Python 2 and str in Python 3. text += text_type(x) return ' '.join(text.split())
def __str__(self): text = u"" for x in self._dir: # "six.text_type" is unicode in Python 2 and str in Python 3. text += text_type(x) return " ".join(text.split())