- next = elem.nextSibling
- parent.replaceChild(self.dummyNode, elem)
- # Append to new DOM, write it
- mainNode.appendChild(elem)
- dom.writexml(memFile, encoding=self.rootObj.params['encoding'].value())
- # Put back in place
- mainNode.removeChild(elem)
- dom.unlink()
- parent.replaceChild(elem, self.dummyNode)
- # Remove temporary name or restore changed
- if not xxx.name:
- elem.removeAttribute('name')
- else:
- elem.setAttribute('name', xxx.name)
- if xxx.__class__ in [xxxWizardPage, xxxWizardPageSimple]:
- elem.setAttribute('class', oldCl)
+ encd = self.rootObj.params['encoding'].value()
+ if not encd: encd = None
+ try:
+ self.dom.writexml(memFile, encoding=encd)
+ except:
+ inf = sys.exc_info()
+ wxLogError(traceback.format_exception(inf[0], inf[1], None)[-1])
+ wxLogError('Error writing temporary file')
+ if debug: raise