func (srv *Server) References() []*Reference {
	return srv.references
}
References impl Referencer
package ast
import (
	"github.com/caixw/apidoc/v7/internal/xmlenc"
)
type (
	APIDoc struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"apidoc,meta,usage-apidoc"`
		APIDoc        *APIDocVersionAttribute `apidoc:"apidoc,attr,usage-apidoc-apidoc,omitempty"`  
		Lang          *Attribute              `apidoc:"lang,attr,usage-apidoc-lang,omitempty"`      
		Logo          *Attribute              `apidoc:"logo,attr,usage-apidoc-logo,omitempty"`
		XMLNamespaces []*XMLNamespace         `apidoc:"xml-namespace,elem,usage-apidoc-xml-namespaces,omitempty"`
		Created       *DateAttribute          `apidoc:"created,attr,usage-apidoc-created,omitempty"`  
		Version       *VersionAttribute       `apidoc:"version,attr,usage-apidoc-version,omitempty"`
		Title         *Element                `apidoc:"title,elem,usage-apidoc-title"`
		Description   *Richtext               `apidoc:"description,elem,usage-apidoc-description,omitempty"`  
		Contact       *Contact                `apidoc:"contact,elem,usage-apidoc-contact,omitempty"`          
		License       *Link                   `apidoc:"license,elem,usage-apidoc-license,omitempty"`          
		Tags          []*Tag                  `apidoc:"tag,elem,usage-apidoc-tags,omitempty"`                 
		Servers       []*Server               `apidoc:"server,elem,usage-apidoc-servers,omitempty"`           
		APIs          []*API                  `apidoc:"api,elem,usage-apidoc-apis,omitempty"`                 
		Headers       []*Param                `apidoc:"header,elem,usage-apidoc-headers,omitempty"`           
		Responses     []*Request              `apidoc:"response,elem,usage-apidoc-responses,omitempty"`       
		Mimetypes     []*Element              `apidoc:"mimetype,elem,usage-apidoc-mimetypes"`                 
	}
	XMLNamespace struct {
		xmlenc.BaseTag
		RootName struct{}   `apidoc:"xml-namespace,meta,usage-xml-namespace"`
		Prefix   *Attribute `apidoc:"prefix,attr,usage-xml-namespace-prefix,omitempty"`
		URN      *Attribute `apidoc:"urn,attr,usage-xml-namespace-urn"`
	}
	API struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"api,meta,usage-api"`
		doc      *APIDoc
		Version     *VersionAttribute `apidoc:"version,attr,usage-api-version,omitempty"`
		Method      *MethodAttribute  `apidoc:"method,attr,usage-api-method"`
		ID          *Attribute        `apidoc:"id,attr,usage-api-id,omitempty"`
		Path        *Path             `apidoc:"path,elem,usage-api-path"`
		Summary     *Attribute        `apidoc:"summary,attr,usage-api-summary,omitempty"`
		Description *Richtext         `apidoc:"description,elem,usage-api-description,omitempty"`
		Requests    []*Request        `apidoc:"request,elem,usage-api-requests,omitempty"`  
		Responses   []*Request        `apidoc:"response,elem,usage-api-responses,omitempty"`
		Callback    *Callback         `apidoc:"callback,elem,usage-api-callback,omitempty"`
		Deprecated  *VersionAttribute `apidoc:"deprecated,attr,usage-api-deprecated,omitempty"`
		Headers     []*Param          `apidoc:"header,elem,usage-api-headers,omitempty"`
		Tags        []*TagValue       `apidoc:"tag,elem,usage-api-tags,omitempty"`
		Servers     []*ServerValue    `apidoc:"server,elem,usage-api-servers,omitempty"`
	}
	Link struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"link,meta,usage-link"`
		Text *Attribute `apidoc:"text,attr,usage-link-text"`
		URL  *Attribute `apidoc:"url,attr,usage-link-url"`
	}
	Contact struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"contact,meta,usage-contact"`
		Name  *Attribute `apidoc:"name,attr,usage-contact-name"`
		URL   *Element   `apidoc:"url,elem,usage-contact-url,omitempty"`
		Email *Element   `apidoc:"email,elem,usage-contact-email,omitempty"`
	}
	Callback struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"callback,meta,usage-callback"`
		Method      *MethodAttribute  `apidoc:"method,attr,usage-callback-method"`
		Path        *Path             `apidoc:"path,elem,usage-callback-path,omitempty"`
		Summary     *Attribute        `apidoc:"summary,attr,usage-callback-summary,omitempty"`
		Description *Richtext         `apidoc:"description,elem,usage-callback-description,omitempty"`
		Deprecated  *VersionAttribute `apidoc:"deprecated,attr,usage-callback-deprecated,omitempty"`
		Responses   []*Request        `apidoc:"response,elem,usage-callback-responses,omitempty"`
		Requests    []*Request        `apidoc:"request,elem,usage-callback-requests"`  
		Headers     []*Param          `apidoc:"header,elem,usage-callback-headers,omitempty"`
	}
	Enum struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"enum,meta,usage-enum"`
		Deprecated  *VersionAttribute `apidoc:"deprecated,attr,usage-enum-deprecated,omitempty"`
		Value       *Attribute        `apidoc:"value,attr,usage-enum-value"`
		Summary     *Attribute        `apidoc:"summary,attr,usage-enum-summary,omitempty"`
		Description *Richtext         `apidoc:"description,elem,usage-enum-description,omitempty"`
	}
	Example struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"example,meta,usage-example"`
		Mimetype *Attribute    `apidoc:"mimetype,attr,usage-example-mimetype"`
		Content  *ExampleValue `apidoc:",cdata,usage-example-content"`
		Summary  *Attribute    `apidoc:"summary,attr,usage-example-summary,omitempty"`
	}
	Param struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"param,meta,usage-param"`
		XML
		Name        *Attribute        `apidoc:"name,attr,usage-param-name"`
		Type        *TypeAttribute    `apidoc:"type,attr,usage-param-type"`
		Deprecated  *VersionAttribute `apidoc:"deprecated,attr,usage-param-deprecated,omitempty"`
		Default     *Attribute        `apidoc:"default,attr,usage-param-default,omitempty"`
		Optional    *BoolAttribute    `apidoc:"optional,attr,usage-param-optional,omitempty"`
		Array       *BoolAttribute    `apidoc:"array,attr,usage-param-array,omitempty"`
		Items       []*Param          `apidoc:"param,elem,usage-param-items,omitempty"`
		Summary     *Attribute        `apidoc:"summary,attr,usage-param-summary,omitempty"`
		Enums       []*Enum           `apidoc:"enum,elem,usage-param-enums,omitempty"`
		Description *Richtext         `apidoc:"description,elem,usage-param-description,omitempty"`
		ArrayStyle *BoolAttribute `apidoc:"array-style,attr,usage-param-array-style,omitempty"`
	}
	Path struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"path,meta,usage-path"`
		Path    *Attribute `apidoc:"path,attr,usage-path-path"`
		Params  []*Param   `apidoc:"param,elem,usage-path-params,omitempty"`
		Queries []*Param   `apidoc:"query,elem,usage-path-queries,omitempty"`
	}
	Request struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"request,meta,usage-request"`
		XML
		Name *Attribute `apidoc:"name,attr,usage-request-name,omitempty"`
		Type        *TypeAttribute    `apidoc:"type,attr,usage-request-type,omitempty"`
		Deprecated  *VersionAttribute `apidoc:"deprecated,attr,usage-request-deprecated,omitempty"`
		Enums       []*Enum           `apidoc:"enum,elem,usage-request-enums,omitempty"`
		Array       *BoolAttribute    `apidoc:"array,attr,usage-request-array,omitempty"`
		Items       []*Param          `apidoc:"param,elem,usage-request-items,omitempty"`
		Summary     *Attribute        `apidoc:"summary,attr,usage-request-summary,omitempty"`
		Status      *StatusAttribute  `apidoc:"status,attr,usage-request-status,omitempty"`
		Mimetype    *Attribute        `apidoc:"mimetype,attr,usage-request-mimetype,omitempty"`
		Examples    []*Example        `apidoc:"example,elem,usage-request-examples,omitempty"`
		Headers     []*Param          `apidoc:"header,elem,usage-request-headers,omitempty"`  
		Description *Richtext         `apidoc:"description,elem,usage-request-description,omitempty"`
	}
	Richtext struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"richtext,meta,usage-richtext"`
		Type *Attribute `apidoc:"type,attr,usage-richtext-type"`  
		Text *CData     `apidoc:",cdata,usage-richtext-text"`
	}
	Tag struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"tag,meta,usage-tag"`
		Name       *Attribute        `apidoc:"name,attr,usage-tag-name"`    
		Title      *Attribute        `apidoc:"title,attr,usage-tag-title"`  
		Deprecated *VersionAttribute `apidoc:"deprecated,attr,usage-tag-deprecated,omitempty"`
		references []*Reference
	}
	Server struct {
		xmlenc.BaseTag
		RootName struct{} `apidoc:"server,meta,usage-server"`
		Name        *Attribute        `apidoc:"name,attr,usage-server-name"`  
		URL         *Attribute        `apidoc:"url,attr,usage-server-url"`
		Deprecated  *VersionAttribute `apidoc:"deprecated,attr,usage-server-deprecated,omitempty"`
		Summary     *Attribute        `apidoc:"summary,attr,usage-server-summary,omitempty"`
		Description *Richtext         `apidoc:"description,elem,usage-server-description,omitempty"`
		references []*Reference
	}
	XML struct {
		XMLAttr     *BoolAttribute `apidoc:"xml-attr,attr,usage-xml-attr,omitempty"`         
		XMLExtract  *BoolAttribute `apidoc:"xml-extract,attr,usage-xml-extract,omitempty"`   
		XMLCData    *BoolAttribute `apidoc:"xml-cdata,attr,usage-xml-cdata,omitempty"`       
		XMLNSPrefix *Attribute     `apidoc:"xml-ns-prefix,attr,usage-xml-prefix,omitempty"`  
		XMLWrapped  *Attribute     `apidoc:"xml-wrapped,attr,usage-xml-wrapped,omitempty"`   
	}
	Element struct {
		xmlenc.BaseTag
		Content  Content  `apidoc:",content"`
		RootName struct{} `apidoc:"string,meta,usage-string"`
	}
	TagValue struct {
		xmlenc.BaseTag
		Content  Content  `apidoc:",content"`
		RootName struct{} `apidoc:"string,meta,usage-string"`
		definition *Definition
	}
	ServerValue struct {
		xmlenc.BaseTag
		Content  Content  `apidoc:",content"`
		RootName struct{} `apidoc:"string,meta,usage-string"`
		definition *Definition
	}
	CData struct {
		xmlenc.BaseTag
		Value    xmlenc.String `apidoc:"-"`
		RootName struct{}      `apidoc:"string,meta,usage-string"`
	}
	ExampleValue CData
	Content struct {
		xmlenc.Base
		Value    string   `apidoc:"-"`
		RootName struct{} `apidoc:"string,meta,usage-string"`
	}
)
func (r *Richtext) V() string {
	if r == nil || r.Text == nil {
		return ""
	}
	return r.Text.Value.Value
}
func (s *Element) V() string {
	if s == nil {
		return ""
	}
	return s.Content.Value
}
func (s *TagValue) V() string {
	if s == nil {
		return ""
	}
	return s.Content.Value
}
func (s *ServerValue) V() string {
	if s == nil {
		return ""
	}
	return s.Content.Value
}
func (s *TagValue) Definition() *Definition {
	return s.definition
}
func (s *ServerValue) Definition() *Definition {
	return s.definition
}
func (cdata *CData) EncodeXML() (string, error) {
	return cdata.Value.Value, nil
}
func (s *Content) EncodeXML() (string, error) {
	return s.Value, nil
}
func (v *ExampleValue) EncodeXML() (string, error) {
	return trimLeftSpace(v.Value.Value), nil
}
func (r *Request) Param() *Param {
	if r == nil {
		return nil
	}
	return &Param{
		XML:         r.XML,
		Name:        r.Name,
		Type:        r.Type,
		Deprecated:  r.Deprecated,
		Optional:    &BoolAttribute{Value: Bool{Value: true}},
		Array:       r.Array,
		Items:       r.Items,
		Summary:     r.Summary,
		Enums:       r.Enums,
		Description: r.Description,
	}
}
func (doc *APIDoc) XMLNamespace(prefix string) *XMLNamespace {
	for _, ns := range doc.XMLNamespaces {
		if ns.Prefix.V() == prefix {
			return ns
		}
	}
	return nil
}
func (tag *Tag) References() []*Reference {
	return tag.references
}