diff --git a/controller/openapi.go b/controller/openapi.go index 274f186..2cdb706 100644 --- a/controller/openapi.go +++ b/controller/openapi.go @@ -89,18 +89,21 @@ func RangeWidget(p *Widget ) string{ return "" } ret := "" - ret += p.Class + "#" + p.Name + " \r\n{\r\n}\r\n" + parent := "" + tmp := p + for ;tmp != nil;tmp = tmp.Parent{ + parent = tmp.Class + " #" + tmp.Name + " " + parent + } + ret += parent + " \r\n{\r\n}\r\n" + if(p.Childs.Len() > 0){ wid := p.Childs.Front() for ;wid != nil;wid = wid.Next(){ - output := "" tmp := wid.Value.(*Widget) - for ;tmp != nil;tmp = tmp.Parent{ - output = tmp.Class + " #" + tmp.Name + " " + output - } - ret += output + "\r\n{\r\n}\r\n" + ret += RangeWidget(tmp) } } + // log.Print(ret) return ret } @@ -115,7 +118,6 @@ func GetUifrom(path io.Reader) string{ switch startElement := token.(type) { case xml.StartElement: if(startElement.Name.Local == "widget"){ - // log.Print(startElement.Name.Local) if(list.Len() == 0){ ins := new(Widget) ins.Class = getAttr("class",startElement.Attr) @@ -126,7 +128,6 @@ func GetUifrom(path io.Reader) string{ ins := new(Widget) ins.Class = getAttr("class",startElement.Attr) ins.Name = getAttr("name",startElement.Attr) - // log.Print(list.Back().Value.(*Widget)) ins.Parent = list.Back().Value.(*Widget) list.Back().Value.(*Widget).Childs.PushBack(ins) list.PushBack(ins)