When you leave the namespace out, it will match that tag in *any* namespace
(or none).
On Mon, Jul 24, 2017 at 11:56 PM Konstantin Khomoutov
wrote:
> On Mon, Jul 24, 2017 at 07:44:33PM -0700, emartinez1...@gmail.com wrote:
>
> [...]
> >>> So I'm trying to unmarshal an XML with namespaces in go b
On Mon, Jul 24, 2017 at 07:44:33PM -0700, emartinez1...@gmail.com wrote:
[...]
>>> So I'm trying to unmarshal an XML with namespaces in go but i just can't
>>> find the right parser to do so.
[...]
>> type Root struct {
>> XMLName struct{} `xml:"urn:MNResultsResults MNResultsResults"`
No, you don't declare the namespace, but specify that which namespace the tag
you're searching for is in.
--
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
Thanks!.
XMLName struct{} `xml:"urn:MNResultsResults MNResultsResults"`
Cpcs []float64 `xml:"urn:MNResultsResults
ssResultSet>ssResult>cpc"`
Is there any reason to declare the namespace 2 times? At first we declare
XMLName (which doesn't seem to be used) and then we use
urn:MNResult
On Sun, Jul 23, 2017 at 01:51:41PM -0700, emartinez1...@gmail.com wrote:
Hi!
> So I'm trying to unmarshal an XML with namespaces in go but i just can't
> find the right parser to do so.
[...]
This (elided for brewity)
8<
package main
import (
"fmt"
Hello,
So I'm trying to unmarshal an XML with namespaces in go but i just can't
find the right parser to do so.
My code:
package main
import "fmt"
import "encoding/xml"
type Root struct {
MNResultsResults []ls `xml:"xmlns ls,
MNResultsResults>ssResultSet>ssResult"`
}
type ls struct {