- Documentation
- Shared functions
- xmlDestroyNode
Function
xmlDestroyNode
Removes a node together with its children. The root node cannot be removed.
Syntax
bool xmlDestroyNode(xmlnode theXMLNode)Arguments
theXMLNodexmlnode- The node to remove.
Returns
true when removed.
Example
local root = xmlLoadFile("bans.xml")
for _, ban in ipairs(xmlNodeGetChildren(root)) do
if xmlNodeGetAttribute(ban, "serial") == "ABC123" then xmlDestroyNode(ban) end
end
xmlSaveFile(root)
xmlUnloadFile(root)