262 |
if type(val) == types.StringType: |
if type(val) == types.StringType: |
263 |
addl = ' %s="%s"' % (attribute.replace('__',':'), saxutils.escape('%s' % unicode(val,gConfig('textEncoding')))) |
addl = ' %s="%s"' % (attribute.replace('__',':'), saxutils.escape('%s' % unicode(val,gConfig('textEncoding')))) |
264 |
else: |
else: |
265 |
|
try: |
266 |
|
if val == int(val): |
267 |
|
val = int(val) |
268 |
|
except: |
269 |
|
pass |
270 |
addl = ' %s="%s"' % (attribute.replace('__',':'), saxutils.escape('%s' % val)) |
addl = ' %s="%s"' % (attribute.replace('__',':'), saxutils.escape('%s' % val)) |
271 |
if len(addl) + pos > 78: |
if len(addl) + pos > 78: |
272 |
xmlString += "\n" + " " * indent + addl |
xmlString += "\n" + " " * indent + addl |