# HG changeset patch # User Chris Jones # Date 1325351461 25200 # Node ID fbda8e925fdf5fdda34cdb284b08c5f718f8e5ba # Parent 9fe022261dccfe2bf6d9ec7e17d5867552055516 Minor fixups to make this come closer to working. It doesn't actually work, though, because the nesting in XML is backwards from how it is in Go. vs. RosterIq { Iq } diff -r 9fe022261dcc -r fbda8e925fdf roster.go --- a/roster.go Fri Dec 30 21:49:00 2011 -0700 +++ b/roster.go Sat Dec 31 10:11:01 2011 -0700 @@ -36,6 +36,10 @@ Group []string } +func (riq *RosterIq) MarshalXML() ([]byte, os.Error) { + return marshalXML(riq) +} + func (riq *RosterIq) InnerMarshal(w io.Writer) os.Error { return xml.Marshal(w, riq.Query) } diff -r 9fe022261dcc -r fbda8e925fdf stream.go --- a/stream.go Fri Dec 30 21:49:00 2011 -0700 +++ b/stream.go Sat Dec 31 10:11:01 2011 -0700 @@ -158,7 +158,7 @@ obj = con(&name) xmlStr, _ := marshalXML(st) r := bytes.NewBuffer(xmlStr) - err = xml.Unmarshal(r, &obj) + err = xml.Unmarshal(r, obj) if err != nil { log.Printf("ext unmarshal: %v", err) diff -r 9fe022261dcc -r fbda8e925fdf structs.go --- a/structs.go Fri Dec 30 21:49:00 2011 -0700 +++ b/structs.go Sat Dec 31 10:11:01 2011 -0700 @@ -99,6 +99,7 @@ } type ExtendedStanza interface { + Stanza InnerMarshal(io.Writer) os.Error }