Mr.DeViLsS Posted December 25, 2017 Share Posted December 25, 2017 (edited) 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) Edited December 25, 2017 by Mr.DeViLsS Link to comment
Fabervox Posted January 16, 2018 Share Posted January 16, 2018 Ну а вопрос то в чем? 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now