Namespaces are space-separated from tag names in the struct tags.

Changing that seems to make your example work OK:

https://play.golang.org/p/GBvhcWLew_

>From the encoding/xml docs:

   If the XMLName field has an associated tag of the form
   "name" or "namespace-URL name", the XML element must have
   the given name (and, optionally, name space) or else Unmarshal
   returns an error.


On 1 August 2017 at 15:39, Marcin Jurczuk <mjurc...@gmail.com> wrote:
> Hi gophers,
>
> I stuck with something that supposed to be easy - XML decoding. Encoding
> works perfeclty.
> I'm trying for past two days to find working code for parsing SOAP message.
> I have structures that are encoded correctly but decoding responses (same
> structure, just filled with values) is failing (sic!)
>
> Here is sample code that encodes struct and then tries decode the same
> struct
>
> https://play.golang.org/p/hE7vcXbymg
>
>
> It seems that Go have a lot of issues with XML jsut small portion:
> https://github.com/golang/go/issues/6800 (this one looks like my problem -
> not fixed since 2013 !)
> https://github.com/golang/go/issues/9775
> https://github.com/golang/go/issues/9519
>
>
> Please help me to diagnose is it my problem or one of Go bugs
>
>
> --
> 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.

Reply via email to