api: add single tags support

This commit is contained in:
George Palanjyan
2018-04-11 13:23:19 +03:00
parent bcb01ebbb8
commit 5b71df82d8

View File

@@ -166,7 +166,7 @@ func xmlAnalize(methodStruct interface{}, acceptedData* string) (*string, error)
} }
el.AddChild(pushTmp) el.AddChild(pushTmp)
el = pushTmp el = pushTmp
} else if mas[idntIndex] == "PushPop" { //done } else if mas[idntIndex] == "PushPop" {
popTmp := etree.NewElement(elemName) popTmp := etree.NewElement(elemName)
popTmp.SetText(value) popTmp.SetText(value)
if len(attr) != 0 { if len(attr) != 0 {
@@ -174,7 +174,11 @@ func xmlAnalize(methodStruct interface{}, acceptedData* string) (*string, error)
popTmp.CreateAttr(key, value) popTmp.CreateAttr(key, value)
} }
} }
el.AddChild(popTmp) if el == nil {
el = document.CreateElement(elemName)
} else {
el.AddChild(popTmp)
}
} else if mas[idntIndex] == "Pop" { } else if mas[idntIndex] == "Pop" {
el = el.Parent() el = el.Parent()
lstIndex -= 1 lstIndex -= 1