Jump to content

piras

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by piras

  1. Hello, I am trying to save some stuff with these functions. They are not returning errors but the file is not getting saved. I can call xmlNodeGetAttributes on the node Im trying to save and it works as expected. function saveRamps() outputDebugString("saveRamps()", 0) local xml = xmlCreateFile("savedRamps.xml", "ramps") local rampXml if not xml then outputConsole("Couldnt CREATE xml file.", 0) end --<<=== This seems to work OK. for rampName,rampTabElement in pairs(win.ramps) do if type(rampTabElement) == "table" and rampTabElement.type == "tab" then rampXml = xmlCreateChild(xml, rampName) xmlNodeSetAttribute(rampXml, "modelId", rampTabElement.modelIdEdit:getValueAsString()) xmlNodeSetAttribute(rampXml, "topAngle", rampTabElement.topAngleEdit:getValueAsString()) xmlNodeSetAttribute(rampXml, "radius", rampTabElement.radiusEdit:getValueAsString()) xmlNodeSetAttribute(rampXml, "resolution", rampTabElement.resolutionEdit:getValueAsString()) xmlNodeSetAttribute(rampXml, "length", rampTabElement.lengthEdit:getValueAsString()) tableOut(xmlNodeGetAttributes(rampXml)) --<=== This works OK, everything looks fine. end end if not xmlSaveFile(xml) then outputConsole("Couldnt SAVE xml file.", 0) end --<=== This seems to work OK. end I can load an xml file with xmlLoadFile. Have I done something wrong like not called a function before calling xmlSaveFile, or something ...
×
×
  • Create New...