more helper methods
This commit is contained in:
		
							parent
							
								
									d59371c359
								
							
						
					
					
						commit
						3236d1c7cb
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		
							
								
								
									
										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() {
 | 
			
		||||
	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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue