include("import") func dom() if (not isset(domimpl)) gvar(domimpl) fvar(di) println(di, ' = minidom.getDOMImplementation()') domimpl = di end end func doCreate(_data) need_minidom() dom() println(doc, ' = ', domimpl, '.createDocument(None, ', Root, ', None)') event(onCreate, doc && '.documentElement') end func doLoad(_data) need_minidom() println(doc, ' = minidom.parse(', FileName, ')') end func doSave(_data) need_minidom() need_codecs() println(f && ' = codecs.open(' && FileName && ', "w", ' && Encoding && ')') println(doc && '.writexml(' && f && ', "", "", "\n", ' && Encoding && ')') println(f && '.close()') end func DocumentElement() return(doc && '.documentElement') end