XmlUnloadFile: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(→‎Syntax: OOP syntax added)
m (fix oop syntax)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
bool xmlUnloadFile ( xmlnode node )               
bool xmlUnloadFile ( xmlnode node )               
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[xmlnode]]:destroy||}}
{{OOP||[[xmlnode]]:unload}}
===Required Arguments===  
===Required Arguments===  
*'''node:''' root of the XML document to unload
*'''node:''' root of the XML document to unload
Line 35: Line 35:
==See Also==
==See Also==
{{XML_functions}}
{{XML_functions}}
[[ru:xmlUnloadFile]]

Latest revision as of 20:16, 2 January 2015

Unloads an XML document from memory.

Syntax

bool xmlUnloadFile ( xmlnode node )               

OOP Syntax Help! I don't understand this!

Method: xmlnode:unload(...)


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 = xmlFindChild(xml, "markers", 0)
xmlNodeSetAttribute(markernode, "color", "0,0,200")
xmlSaveFile(xml)
xmlUnloadFile(xml)

See Also