tweak the upgrade logic so that we don't loose existing attributes - allows upgrading a partially compliant xml

This commit is contained in:
Dane Springmeyer 2010-11-08 19:54:28 +00:00
parent 16ee468c78
commit 61940db92f

View File

@ -60,16 +60,8 @@ def fixup_pointsym(sym):
sym.attrib.pop('type')
def fixup_sym_attributes(sym):
#if not sym.find('CssParameter'):
# return
attrib = {}
metawriter = sym.attrib.get('meta-writer')
if metawriter:
attrib['meta-writer'] = metawriter
metaoutput = sym.attrib.get('meta-output')
if metaoutput:
attrib['meta-output'] = metaoutput
# copy, so we don't loose after clear()
attrib = dict(sym.attrib)
for css in sym.findall('CssParameter'):
key = css.attrib.get('name')
value = css.text