It works for me: https://play.golang.org/p/yCI68Zsg1E
On Tue, Jul 5, 2016 at 8:04 PM Hoping White <baihaop...@gmail.com> wrote: > > Hi, gophers > > > How do I unmarshal an xml as following: > > <resources> > <string name="about_part1”>data</string> > <string name="about_part2”>data</string> > </resources> > > I have tried with > > *type* Resources *struct* { > XMLName xml.Name `xml:"resources"` > Strings []String `xml:"string"` > } > > *type* String *struct* { > Name string `xml:"name,attr"` > Value string `xml:,chardata"` > } > > > thanks. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.