XmlUnloadFile: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:Incomplete]]
[[Category:Incomplete]]


__NOTOC__  
__NOTOC__
This fake function is for use with blah & blah and does blahblahblabhalbhl
{{Server client function}}
Unloads an XML document from memory.


==Syntax==  
==Syntax==  
Line 10: Line 11:


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''xmlnode:''' root of the XML document to unload
 
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


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


==Example==  
==Example==  
This example does...
Modify a configuration file.
 
config.xml:
<syntaxhighlight lang="xml">
<config>
    <markers color="255,100,0" />
</config>
</syntaxhighlight>
 
Lua code:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
xml = xmlLoadFile("config.xml")
blabhalbalhb --abababa
markernode = xmlFindSubNode(xml, "markers", 0)
--This line does this...
xmlNodeSetAttribute(markernode, "color", "0,0,200")
mooo
xmlSaveFile("config.xml", xml)
xmlUnloadFile(xml)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 16:47, 15 August 2007


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