more helper methods
This commit is contained in:
parent
d59371c359
commit
3236d1c7cb
10
node.go
10
node.go
|
@ -397,6 +397,16 @@ func rec_SelectNodes(cn *Node, namespace, name string, list *[]*Node, recurse bo
|
||||||
|
|
||||||
func (this *Node) RemoveNameSpace() {
|
func (this *Node) RemoveNameSpace() {
|
||||||
this.Name.Space = ""
|
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) {
|
func (this *Node) SetAttr(name, value string) {
|
||||||
|
|
Loading…
Reference in New Issue