XmlUnloadFile: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (fix oop syntax) |
||
(9 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | |||
__NOTOC__ | __NOTOC__ | ||
Unloads an XML document from memory. | Unloads an XML document from memory. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool xmlUnloadFile ( xmlnode | bool xmlUnloadFile ( xmlnode node ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[xmlnode]]:unload}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''node:''' root of the XML document to unload | ||
===Returns=== | ===Returns=== | ||
Line 29: | Line 27: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
xml = xmlLoadFile("config.xml") | xml = xmlLoadFile("config.xml") | ||
markernode = | markernode = xmlFindChild(xml, "markers", 0) | ||
xmlNodeSetAttribute(markernode, "color", "0,0,200") | xmlNodeSetAttribute(markernode, "color", "0,0,200") | ||
xmlSaveFile( | xmlSaveFile(xml) | ||
xmlUnloadFile(xml) | xmlUnloadFile(xml) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==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)