From 3236d1c7cbfadc08f45ff54c967ac501f7874369 Mon Sep 17 00:00:00 2001 From: Matthew Kanwisher Date: Thu, 29 Aug 2013 17:38:55 -0400 Subject: [PATCH] more helper methods --- node.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/node.go b/node.go index c57dee7..42d55f7 100644 --- a/node.go +++ b/node.go @@ -397,6 +397,16 @@ func rec_SelectNodes(cn *Node, namespace, name string, list *[]*Node, recurse bo func (this *Node) RemoveNameSpace() { this.Name.Space = "" + this.RemoveAttr("xmlns") +} + +func (this *Node) RemoveAttr(name string) { + for i, v := range this.Attributes { + if name == v.Name.Local { + //Delete it + this.Attributes = append(this.Attributes[:i], this.Attributes[i+1:]...) + } + } } func (this *Node) SetAttr(name, value string) {