From 9fa807d7edb1d6cfc5fd2026ea6169bf80abb465 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Tue, 30 Jan 2024 20:25:57 -0500 Subject: [PATCH] Fix marshalling/unmarshalling of command children --- stanza/commands.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stanza/commands.go b/stanza/commands.go index 3d9d4ea..0009a02 100644 --- a/stanza/commands.go +++ b/stanza/commands.go @@ -56,6 +56,8 @@ type CommandElement interface { } type Actions struct { + XMLName xml.Name `xml:"actions"` + Prev *struct{} `xml:"prev,omitempty"` Next *struct{} `xml:"next,omitempty"` Complete *struct{} `xml:"complete,omitempty"` @@ -68,6 +70,8 @@ func (a *Actions) Ref() string { } type Note struct { + XMLName xml.Name `xml:"note"` + Text string `xml:",cdata"` Type string `xml:"type,attr,omitempty"` } @@ -117,11 +121,11 @@ func (c *Command) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { var err error switch tt.Name.Local { - case "affiliations": + case "actions": a := Actions{} err = d.DecodeElement(&a, &tt) c.CommandElement = &a - case "configure": + case "note": nt := Note{} err = d.DecodeElement(&nt, &tt) c.CommandElement = &nt