-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex XML Response #72
Comments
type Obs struct {
XMLName xml.Name `xml:"obs"`
IndexDateString string `xml:"indexDateString"`
StatusCode string `xml:"statusCode"`
Value string `xml:"value"`
}
type Response struct {
XMLName xml.Name `xml:"GetSeriesResponse"`
GetSeriesResult struct {
XMLName xml.Name `xml:"GetSeriesResult"`
Series struct {
XMLName xml.Name `xml:"Series"`
FameSeries struct {
XMLName xml.Name `xml:"fameSeries"`
Obs []Obs
}
}
}
} of course you must set correct data types for |
and yes, you can shortcut type Response struct {
XMLName xml.Name `xml:"GetSeriesResponse"`
GetSeriesResult struct {
Series struct {
FameSeries struct {
Obs []Obs `xml:"obs"`
} `xml:"fameSeries"`
} `xml:"Series"`
} `xml:"GetSeriesResult"`
} |
@tiaguinho this issue is stale and resolved. You can close it, I think... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I've been trying to parse an answer and I still can't get it right.
I have tried in different ways, which I believe closer has been the structure provided by this tool (https://www.onlinetool.io/xmltogo/)
I need to be able to extract indexDateString and value
Can you advise me on where I am failing?
Error obtained:
xml.Unmarshal error: EOF
Try 1
Try 2
Response
The text was updated successfully, but these errors were encountered: