XmlUnloadFile: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
[[Category:Incomplete]]
[[Category:Incomplete]]
 
{{Server client function}}
__NOTOC__
__NOTOC__
{{Server client function}}
Unloads an XML document from memory.
Unloads an XML document from memory.


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool xmlUnloadFile ( xmlnode xmlnode )               
bool xmlUnloadFile ( xmlnode node )               
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''xmlnode:''' root of the XML document to unload
*'''node:''' root of the XML document to unload


===Returns===
===Returns===

Revision as of 15:46, 21 August 2007

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("config.xml", xml)
xmlUnloadFile(xml)

See Also

Template:FunctionArea Functions