XML:setAttribute(path,attribute,value)

Set the value of a single attribute.

When the two argument form is used, the first argument is the attribute name and the second string is the attribute value. The two argument form modifies the current element.

When the three argument form is used, the first argument is the path to an element, the second argument is the attribute name, and the third argument is the attribute value.

Example

doc = xml.parse('<config><connection host='127.0.0.1'/></config>')
doc:setAttribute('/config/connection', 'host', '208.94.146.70')

doc:goPath('/config/connection')
doc:setAttribute('host','127.0.0.1')