XmlNodeSetName

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Sets the tag name of the specified XML node.

Syntax

bool xmlNodeSetName ( xmlnode node, string name )

OOP Syntax Help! I don't understand this!

Method: xmlnode:setName(...)
Variable: .name
Counterpart: xmlNodeGetName


Required Arguments

  • node: the node to change the tag name of.
  • name: the new tag name to set.

Returns

Returns true if successful, false otherwise.

Example

local xml = xmlCreateFile("fileName.xml","Test")
local xmlNode = xmlCreateChild(xml,"Test1")
local xmlNodeName = xmlNodeGetName(xmlNode)
xmlUnloadFile(xml)
if xmlNodeName == "Test1" then
   xmlNodeSetName(xmlNode, "Test2")
end

See Also