XMLNode.removeAttributeFrom(attribute)

Removes the attribute from the node Below a simple example: xmlFileContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><invoice><customer>John Doe</customer><date>May 26, 2005</date><date>May 27, 2005</date><serviceDescription>SOME SERVICE</serviceDescription><serviceAmmount>1000.0</serviceAmmount><taxes>210.0</taxes><total>1210.0</total></invoice>" xmlDoc = XMLDocument.create(content : xmlFileContent) taxes as String[String] taxes["IVA"] = "21%" taxes["ANOTHER TAX"] = "1%" xmlNode2 = addChildFor(xmlNode, tag : "taxes") xmlNode2.text = "1220" xmlNode2.attributes = taxes display print(xmlDoc) // ==================================================== // Removing an attribute from a node, in our example we'll remove "XX" and reset the tax // value without the 1% removeAttributeFrom xmlNode2 using attribute = "ANOTHER TAX" xmlNode2.text = "1210" display print(xmlDoc)

Arguments:

Name Type Description Mode
attribute String attribute to remove in