Go xml unmarshalling

tmwtbd

New Member
Is there a way to extract the source of an image in an HTML file using only one struct (with encode/xml)? Now I have something like this\[code\]type XML struct { A Imatge `xml:"div>img"`}type Imatge struct { I string `xml:"src,attr"`}\[/code\]And would be great to only declare something like this\[code\]type Image struct { I string `xml:"div>img,src,attr"`}\[/code\]This is the HTML\[code\]<div><div><img src="http://stackoverflow.com/questions/12515493/hello.png"></div></div>\[/code\]
 
Back
Top