XmlUnloadFile

From Multi Theft Auto: Wiki
Revision as of 07:44, 24 November 2010 by Ransom (talk | contribs)

Dialog-information.png This article needs checking.

Reason(s): Example outdated. xmlFindSubNode no longer exists.

Unloads an XML document from memory.

Syntax

bool xmlUnloadFile ( xmlnode node )               

Required Arguments

  • node: 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(xml)
xmlUnloadFile(xml)

See Also


Bold text