RemoveAttr removes the attribute with the specified name.
(key string)
| 433 | |
| 434 | // RemoveAttr removes the attribute with the specified name. |
| 435 | func (n *Node) RemoveAttr(key string) bool { |
| 436 | name := newXMLName(key) |
| 437 | for i, attr := range n.Attr { |
| 438 | if attr.Name == name { |
| 439 | n.Attr = append(n.Attr[:i], n.Attr[i+1:]...) |
| 440 | return true |
| 441 | } |
| 442 | } |
| 443 | return false |
| 444 | } |
| 445 | |
| 446 | // AddChild adds a new node 'n' to a node 'parent' as its last child. |
| 447 | func AddChild(parent, n *Node) { |