Hi. I am trying to unmarshal the xml file I get from my bank. It seems
that the unmarshal routine cannot deal w/ the nested html fields.
sample.qfx
OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE
<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<DTSERVER>20170602063954
<LANGUAGE>ENG
<FI>
<ORG>Citibank
<FID>2102
</FI>
<INTU.BID>2102
</SONRS>
</SIGNONMSGSRSV1>
type citixmlheadertype struct {
DTSERVER string `xml:"DTSERVER,OFX>SIGNONMSGSRSV1>SONRS" `
LANGUAGE string `xml:"LANGUAGE,OFX>SIGNONMSGSRSV1>SONRS" `
ORG string `xml:"ORG,OFX>SIGNONMSGSRSVR1>SONRS>FI" `
FID int `xml:"FID,OFX>SIGNONMSGSRSVR1>SONRS>FI" `
CURDEF string `xml:"CURDEF,OFX>BANKMSGSRSV1>STMTTRNRS"`
BANKID string `xml:"BANKID,OFX>BANKMSGSRSV1>STMTTRNRS>BANKACCTFROM"`
ACCTID string `xml:"ACCTID,OFX>BANKMSGSRSV1>STMTTRNRS>BANKACCTFROM"`
ACCTTYPE string
`xml:"ACCTTYPE,OFX>BANKMSGSRSV1>STMTTRNRS>BANKACCTFROM"`
DTSTART string `xml:"DTSTART,OFX>BANKMSGSRSV1>STMTTRNRS>BANKTRANLIST"`
DTEND string `xml:"DTEND,OFX>BANKMSGSRSV1>STMTTRNRS>BANKTRANLIST"`
}
var citiheader citixmlheadertype
e = xml.Unmarshal(filebyteslice, &citiheader) // this requires a []byte
if e != nil {
fmt.Println(" Unmarshalling the header error", e)
os.Exit(1)
}
fmt.Printf(" header %#v \n", citiheader)
I'm getting an xml syntax error that "element <SEVERITY> closed by </STATUS>
I guess I don't understand this yet.
Thanks,
Rob Solomon
--
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.