xmlNodeSetName
Client-side
Server-side
Shared
Pair: xmlNodeGetName
Sets the tag name of the specified XML node.
OOP Syntax Help! I don't understand this!
- Method: xmlnode:setName(...)
- Variable: .name
Syntax
bool xmlNodeSetName ( xmlnode node, string name )
Required Arguments
- node: The xmlnode to change the tag name of.
- name: The name of the attribute.
Returns
- bool: result
Returns true if successful, false otherwise.
Code Examples
shared
This example changes the node's name from Test1 to Test2.
local xml = xmlCreateFile("fileName.xml","Test")if (not xml) then returnend
local xmlNode = xmlCreateChild(xml,"Test1")local xmlNodeName = xmlNodeGetName(xmlNode)if (xmlNodeName == "Test1") then xmlNodeSetName(xmlNode, "Test2")end
xmlUnloadFile(xml)