Golang encoding/xml: Difference between revisions
From wikinotes
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
See also: [[golang encoding]], [[xml]] | See also: [[golang encoding]], [[xml]] | ||
A | A more detailed introduction to go's encoding interface can be seen in [[golang encoding/json]]. | ||
Revision as of 23:14, 25 June 2022
go's builtin library for parsing xml.
See also: golang encoding, xml
A more detailed introduction to go's encoding interface can be seen in golang encoding/json.
Documentation
official docs https://pkg.go.dev/encoding/xml@go1.18.3
Tutorials
tutorialedge https://tutorialedge.net/golang/parsing-xml-with-golang/
Struct Tags
See full details here
type User struct { Name `xml:"Name"` // <User><Name>value</Name></User> Color `xml:"color,attr"` // <User color="value"></User> Skip `xml:"-"` // <User></User> }Known issues:
- xml namespaces don't work as expected: https://github.com/golang/go/issues/11496
- It doesn't appear that go's internal xml library supports schema validation