XmlSaveFile: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:


==Example==
==Example==
This example loads an XML file then saves it again. The file should contain the same data, though it is possible that the order of the tags and/or the order of the attributes may have changed.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
node = xmlLoadFile ( "test.xml" ) --load an xml file
node = xmlLoadFile ( "test.xml" ) --load an xml file

Revision as of 20:24, 9 March 2008

This function saves a loaded XML file.

Syntax

bool xmlSaveFile ( xmlnode rootNode ) 

Required Arguments

  • rootNode: the root xmlnode of the loaded XML file.

Returns

Returns true if save was successful, false if the XML file does not exist.

Example

This example loads an XML file then saves it again. The file should contain the same data, though it is possible that the order of the tags and/or the order of the attributes may have changed.

node = xmlLoadFile ( "test.xml" ) --load an xml file
xmlSaveFile( node ) --Save the xml file

See Also