xml.sax -> unicode list???

jubafre at brturbo.com jubafre at brturbo.com
Fri Jan 24 08:09:01 EST 2003


I'm using a xml.sax to take some information to the xml document,
and in the startElement method of SAX, i want to put in a list the attributes
and your values, like that:


def startElement(self, name, atts):
  print 'Tag Inicial: "%s"'%name
  for i in range(0, atts.getLength()):
    lista.append(atts.getName(i))
    lista2.append(atts.getValue(i))
    print 'Nome Atributo: "%s"\n'% atts.getName(i),
          'Tipo: "%s"\n'% atts.getType(i),
          'Valor: "%s"'% atts.getValue(i)

but the method print:
>>>[u'05', u'Bocas Ordinarias', u'Quatro', u'02', u'Chegou a Hora de Recomecar',
u'05', u'O melhor do pagode de mesa', 'da']
>>> type(lista2[0])
<type 'unicode'>

why the type of the list is unicode??/?

Juliano Freitas
www.gebrasil.hpg.com.br 


More information about the Python-list mailing list