I have the following struct:
type XMLProduct struct {
XMLName xml.Name `xml:\"row\"`
ProductId string `xml:\"product_id\"`
ProductN
CDATA with ",cdata" notation. It is handy to create struct with "Cdata" and use along with your xml object
package main
import (
"encoding/xml"
"fmt"
)
type Person struct {
Name string `xml:"Name"`
Age int `xml:"AGE"`
Address Cdata `xml:"ADDRESS"`
}
type Cdata struct {
Value string `xml:",cdata"`
}
func main() {
var address Cdata
address.Value = "John's House, : 10,Universe PIN: 00000