func ExecuteTemplate(templateMap map[string]*template.Template, fullname string, tplEntity TplEntityInterface) (tplDefine *TPLDefine, err error) {
	if tplEntity == nil {
		err = errors.Errorf("ExecuteTemplate tplEntity must not nil ")
		return nil, err
	}
	namespace, name := SplitFullname(fullname)
	t, ok := templateMap[namespace]
	if !ok {
		err = errors.Errorf("not found namespace:%s", namespace)
		return nil, err
	}
	tpl := t.Lookup(name)
	if tpl == nil {
		err = errors.Errorf("ExecuteTemplate: no template %q associated with template %q", name, t.Name())
		return nil, err
	}
	tplEntityR := reflect.ValueOf(tplEntity)
	if tplEntityR.IsNil() {
		err := errors.Errorf("%#v must not nil", tplEntity)
		return nil, err

	}
	tplEntity.SetValue(TEMPLATE_MAP_KEY, templateMap) // 将模板传入，方便在模板中执行模板
	tplDefine, err = execTpl(tpl, namespace, tplEntity)
	if err != nil {
		return nil, err
	}
	return
}
// ExecuteNamespaceTemplate execute all template under namespace
ExecuteNamespaceTemplate execute all template under namespace
// ExecuteNamespaceTemplate execute all template under namespace
func ExecuteTemplate(templateMap map[string]*template.Template, fullname string, tplEntity TplEntityInterface) (tplDefine *TPLDefine, err error) {
	if tplEntity == nil {
		err = errors.Errorf("ExecuteTemplate tplEntity must not nil ")
		return nil, err
	}
	namespace, name := SplitFullname(fullname)
	t, ok := templateMap[namespace]
	if !ok {
		err = errors.Errorf("not found namespace:%s", namespace)
		return nil, err
	}
	tpl := t.Lookup(name)
	if tpl == nil {
		err = errors.Errorf("ExecuteTemplate: no template %q associated with template %q", name, t.Name())
		return nil, err
	}
	tplEntityR := reflect.ValueOf(tplEntity)
	if tplEntityR.IsNil() {
		err := errors.Errorf("%#v must not nil", tplEntity)
		return nil, err
	}
	tplEntity.SetValue(TEMPLATE_MAP_KEY, templateMap) 
	tplDefine, err = execTpl(tpl, namespace, tplEntity)
	if err != nil {
		return nil, err
	}
	return
}
func ExecuteTemplate ( templateMap map [ string ] * template . Template , fullname string , tplEntity TplEntityInterface ) ( tplDefine * TPLDefine , err error ) { if tplEntity == nil { err = errors . Errorf ( " " ) return nil , err } namespace , name := SplitFullname ( fullname ) t , ok := templateMap [ namespace ] if ! ok { err = errors . Errorf ( " " , namespace ) return nil , err } tpl := t . Lookup ( name ) if tpl == nil { err = errors . Errorf ( " " , name , t . Name ( ) ) return nil , err } tplEntityR := reflect . ValueOf ( tplEntity ) if tplEntityR . IsNil ( ) { err := errors . Errorf ( " " , tplEntity ) return nil , err } tplEntity . SetValue ( TEMPLATE_MAP_KEY , templateMap ) tplDefine , err = execTpl ( tpl , namespace , tplEntity ) if err != nil { return nil , err } return }
ExecuteNamespaceTemplate execute all template under namespace
ExecuteNamespaceTemplate execute all template under namespace
// 将模板传入，方便在模板中执行模板