[]=( name, value ) public

Sets an attribute, overwriting any existing attribute value by the same name. Namespace is significant.


the name of the attribute


(optional) If supplied, the value of the attribute. If nil, any existing matching attribute is deleted.


Owning element

doc = Document.new "<a x:foo='1' foo='3'/>"
doc.root.attributes['y:foo'] = '2'
doc.root.attributes['foo'] = '4'
doc.root.attributes['x:foo'] = nil
Show source
Register or log in to add new notes.