// StripTags removes the tags of the raw XML string.
342552
func StripTags(raw string, strict, escaped bool) (string, error) {
	// Remove escaping.
	xmldoc := raw
	if escaped {
		xmldoc = html.UnescapeString(xmldoc)
	}
	// Decode the document.
	buffer := []string{}
	dec := xml.NewDecoder(bytes.NewBufferString(xmldoc))
	dec.Strict = strict
	dec.CharsetReader = CharsetReader
	for {
		token, err := dec.Token()
		if err == io.EOF {
			break
		}
		if err != nil {
			return "", err
		}
		switch t := token.(type) {
		case xml.CharData:
			trimmed := strings.TrimSpace(string(t))
			buffer = append(buffer, trimmed)
		default:
			// NOP.
		}
	}
	return strings.Join(buffer, " "), nil
}
621672
func (s *DescribeReservationOutput) SetTags(v map[string]*string) *DescribeReservationOutput {
	s.Tags = v
	return s
}
853159
func (s *DeleteReservationOutput) SetTags(v map[string]*string) *DeleteReservationOutput {
	s.Tags = v
	return s
}
382405
func (s *InstanceSnapshot) SetTags(v []*Tag) *InstanceSnapshot {
	s.Tags = v
	return s
}
373815
func (s *DescribeInputOutput) SetTags(v map[string]*string) *DescribeInputOutput {
	s.Tags = v
	return s
}
258761
func (s *GetDeviceDefinitionOutput) SetTags(v map[string]*string) *GetDeviceDefinitionOutput {
	s.Tags = v
	return s
}
207113
func (s *SetTagsForResourceInput) SetTags(v []*Tag) *SetTagsForResourceInput {
	s.Tags = v
	return s
}
557920
func StripHTML(s string) string {

	// Shortcut strings with no tags in them
	if !strings.ContainsAny(s, "<>") {
		return s
	}
	s = stripHTMLReplacer.Replace(s)

	// Walk through the string removing all tags
	b := bp.GetBuffer()
	defer bp.PutBuffer(b)
	var inTag, isSpace, wasSpace bool
	for _, r := range s {
		if !inTag {
			isSpace = false
		}

		switch {
		case r == '<':
			inTag = true
		case r == '>':
			inTag = false
		case unicode.IsSpace(r):
			isSpace = true
			fallthrough
		default:
			if !inTag && (!isSpace || (isSpace && !wasSpace)) {
				b.WriteRune(r)
			}
		}

		wasSpace = isSpace

	}
	return b.String()
}
245767
func (s *HsmClientCertificate) SetTags(v []*Tag) *HsmClientCertificate {
	s.Tags = v
	return s
}
606324
func MarshalTags(tags map[string]string) []string {
	var result []string
	for name, value := range tags {
		result = append(result, fmt.Sprintf("%s=%s", name, value))
	}
	return result
}
581898
func (s *ProvisionedProductPlanDetails) SetTags(v []*Tag) *ProvisionedProductPlanDetails {
	s.Tags = v
	return s
}
523331
func (s *CreateOriginEndpointInput) SetTags(v map[string]*string) *CreateOriginEndpointInput {
	s.Tags = v
	return s
}
580599
func convertTags(tags map[string]string) []string {
	result := make([]string, 0, len(tags))
	for k, v := range tags {
		k := strings.ToLower(strings.TrimSpace(k))
		v := strings.ToLower(strings.TrimSpace(v))
		result = append(result, fmt.Sprintf("%s:%s", k, v))
	}
	return result
}
387682
func (s *Domain) SetTags(v []*Tag) *Domain {
	s.Tags = v
	return s
}
886176
func StripTags(src string) string {
	//将HTML标签全转换成小写
	//src = regexpAnyHTMLTag.ReplaceAllStringFunc(src, strings.ToLower)

	//remove tag <style>
	src = regexpStyleHTMLTag.ReplaceAllString(src, "")

	//remove tag <script>
	src = regexpScriptHTMLTag.ReplaceAllString(src, "")

	//replace all html tag into \n
	src = regexpAnyHTMLTag.ReplaceAllString(src, "\n")

	//trim all spaces(2+) into \n
	src = regexpMoreSpace.ReplaceAllString(src, "\n")

	return strings.TrimSpace(src)
}
345838
func (c *awsCloudImplementation) DeleteTags(resourceId string, tags map[string]string) error {
	return deleteTags(c, resourceId, tags)
}
275901
func (s *CreateOriginEndpointOutput) SetTags(v map[string]*string) *CreateOriginEndpointOutput {
	s.Tags = v
	return s
}