function createFileHandler()
local RootNode = xmlCreateFile("new.xml"," newroot")
test_1 = xmlFindChild ( RootNode, "Test_1", 0 )
test_2 = xmlFindChild ( RootNode, "Test_2", 0 )
if test_1 == false then test_1 = xmlCreateChild ( RootNode, "Test_1", 0 ) end
if test_2 == false then test_2 = xmlCreateChild ( RootNode, "Test_2", 0 ) end
xmlNodeSetValue ( test_1, 10 )
xmlNodeSetValue ( test_2, 1 )
xmlSaveFile(RootNode)
xmlUnloadFile(RootNode)
end
addCommandHandler("createfile", createFileHandler)
function createFileHandler(commandName, param1, param2)
local RootNode = xmlCreateFile("new.xml"," newroot")
test = xmlFindChild ( RootNode, param1, 0 )
if test == false then test = xmlCreateChild ( RootNode, param1, 0 ) end
xmlNodeSetValue ( test, param2 )
xmlSaveFile(RootNode)
xmlUnloadFile(RootNode)
end
addCommandHandler("val", createFileHandler)