xmlUnloadFile | Multi Theft Auto: Wiki Skip to content

xmlUnloadFile

Client-side
Server-side
Shared

Unloads an XML document from memory.

OOP Syntax Help! I don't understand this!

Syntax

boolean xmlUnloadFile ( xmlnode rootNode )
Required Arguments
  • rootNode: The root of the XML document to unload.

Returns

  • boolean: result

Returns true if the document was unloaded successfully, false otherwise.

Code Examples

shared

Modify a configuration file.

config.xml

<config>
<markers color="255,100,0" />
</config>

Lua code

local xml = xmlLoadFile("config.xml")
if (not xml) then
return
end
local markernode = xmlFindChild(xml, "markers", 0)
xmlNodeSetAttribute(markernode, "color", "0,0,200")
xmlSaveFile(xml)
xmlUnloadFile(xml)