func (resultBean *ResultBean) Xml() (bool, string, error) { if resultBean.Error != nil { return false, "", resultBean.Error } if !resultBean.Has { return resultBean.Has, "", nil } has, result, err := resultBean.Json() if err != nil { return false, "", err } if !has { return has, "", nil } var anydata = []byte(result) var i interface{} err = json.Unmarshal(anydata, &i) if err != nil { return false, "", err } resultByte, err := anyxml.Xml(i) if err != nil { return false, "", err } return resultBean.Has, string(resultByte), err }
func (resultMap *ResultMap) Xml() (string, error) { if resultMap.Error != nil { return "", resultMap.Error } results, err := anyxml.Xml(resultMap.Results) if err != nil { return "", err } return string(results), nil }
func (session *Session) queryAllToXmlString(sql string, paramStr ...interface{}) (string, error) { resultMap, err := session.queryAll(sql, paramStr...) if err != nil { return "", err } results, err := anyxml.Xml(resultMap) if err != nil { return "", err } return string(results), nil }
func (resultStructs *ResultStructs) Xml() (string, error) { if resultStructs.Error != nil { return "", resultStructs.Error } result, err := resultStructs.Json() if err != nil { return "", err } var anydata = []byte(result) var i interface{} err = json.Unmarshal(anydata, &i) if err != nil { return "", err } resultByte, err := anyxml.Xml(i) if err != nil { return "", err } return string(resultByte), nil }