Thx Jason.

If helps someone, plz find how I manage this: 
https://go.dev/play/p/kLwRB3fuJdK


Le mercredi 29 novembre 2023 à 03:26:27 UTC+1, Jason E. Aten a écrit :

> Perhaps you can adapt this to your needs.
>
> https://github.com/glycerine/xml2csv
>
> by taking just the xml parsing part, and then doing what you want with the 
> tree of tags.
>
> On Tuesday, November 28, 2023 at 3:00:18 PM UTC Jérôme LAFORGE wrote:
>
>> Hello,
>> The playground: https://go.dev/play/p/EQTHwGlKQDt
>>
>> I have this xml
>> data := []byte(`<xml1>
>> <xml2>hello</xml2>
>> <xml3><xml4>foobar</xml4></xml3>
>> </xml1>`)
>>
>> That, I want to unmarhsall into xmlBody struct:
>> type (
>> xml3 struct {
>> Data string `xml:",innerxml"`
>> }
>>
>> xmlBody struct {
>> XML2 string `xml:"xml2"`
>> XML3 xml3   `xml:"xml3"`
>> }
>> )
>>
>> Unfortunately, I am not able to get <xml3><xml4>foobar</xml4></xml3> as 
>> string in x.XML3.Data.
>>
>> Thanks in advance for your help.
>>
>>
>>
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4ea059cf-f30b-44d5-bf0d-35a3ced33d90n%40googlegroups.com.

Reply via email to