ok narrowed down the problem, this IS working:

def index():
    response.headers['Content-Type']='application/xml'
    rows=[['6.0', u'pap\xe0', u'kloiuy', '1995.0']]
    return export_xml(rows)


def export_xml(rows):
    colnames=['prima','seconda','terza','quarta']
    idx=range(len(colnames))
    records=[]
    for row in rows: records.append(TAG['record'](*[TAG[colnames[i]]
(row[i]) for i in idx]))
    return str(TAG['records'](*records))

but this IS NOT working with Unicode error etc etc:

def index():
    response.headers['Content-Type']='application/xml'
    rows=[['6.0', u'pap\xe0', u'kloiuy', '1995.0']]
    return export_xml(rows)


def export_xml(rows):
    colnames=[u'prima',u'seconda',u'terza',u'quarta']
    idx=range(len(colnames))
    records=[]
    for row in rows: records.append(TAG['record'](*[TAG[colnames[i]]
(row[i]) for i in idx]))
    return str(TAG['records'](*records))


so the problem is with tag names..I will try to have a look at html.py
but your opinion is welcome.

carlo

Reply via email to