more helper methods

This commit is contained in:
Matthew Kanwisher 2013-08-29 17:38:55 -04:00
parent d59371c359
commit 3236d1c7cb
1 changed files with 10 additions and 0 deletions

10
node.go
View File

@ -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) {