XmlUnloadFile

From Multi Theft Auto: Wiki
Revision as of 16:47, 15 August 2007 by Arc (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Unloads an XML document from memory.

Syntax

bool xmlUnloadFile ( xmlnode xmlnode )               

Required Arguments

  • xmlnode: root of the XML document to unload

Returns

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

Example

Modify a configuration file.

config.xml:

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

Lua code:

xml = xmlLoadFile("config.xml")
markernode = xmlFindSubNode(xml, "markers", 0)
xmlNodeSetAttribute(markernode, "color", "0,0,200")
xmlSaveFile("config.xml", xml)
xmlUnloadFile(xml)

See Also

Template:FunctionArea Functions