Example #1
0
func (o *OutOfLineContent) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("out of line", &error, o.Type, o.Src)

	return error.ErrorObject()
}
Example #2
0
func (i *InReplyTo) Validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("in-reply-to", &error, i.Ref, i.Href, i.Source, i.Type)

	return error.ErrorObject()
}
Example #3
0
File: cloud.go Project: apognu/xml
func (c *Cloud) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("cloud", &error, c.Domain, c.Port, c.Path, c.RegisterProcedure, c.Protocol)
	c.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #4
0
File: guid.go Project: apognu/xml
func (g *Guid) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("guid", &error, g.IsPermalink)
	g.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #5
0
File: image.go Project: apognu/xml
func (i *Image) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("image", &error, i.Url.Content, i.Title.Content, i.Link.Content, i.Width.Content, i.Height.Content, i.Description.Content)
	i.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #6
0
func (c *Category) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("category", &error, c.Domain)
	c.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #7
0
File: source.go Project: apognu/xml
func (s *Source) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("source", &error, s.Url)
	s.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #8
0
func (e *Enclosure) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("enclosure", &error, e.Url, e.Length, e.Type)
	e.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #9
0
func (g *Generator) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("generator", &error, g.Uri, g.Version)
	g.Extension.Validate(&error)
	g.ValidateCommonAttributes("generator", &error)

	return error.ErrorObject()
}
Example #10
0
File: link.go Project: apognu/xml
func (l *Link) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("link", &error, l.Href, l.Rel, l.Type, l.HrefLang, l.Title, l.Length)
	l.Extension.Validate(&error)
	l.ValidateCommonAttributes("link", &error)

	return error.ErrorObject()
}
Example #11
0
func (c *Category) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("category", &error, c.Term, c.Label, c.Scheme)
	c.ValidateCommonAttributes("category", &error)

	c.Extension.Validate(&error)

	return error.ErrorObject()
}
Example #12
0
func (i *InlineOtherContent) validate() xmlutils.ParserError {
	error := utils.NewErrorAggregator()

	xmlutils.ValidateElements("inlineothercontent", &error, i.Type)

	if strings.HasPrefix(i.Type.Value, "text/") && i.hasChild {
		error.NewError(xmlutils.NewError(LeafElementHasChild, "text content should not have child"))
	}

	return error.ErrorObject()
}
Example #13
0
func (c *CommonAttributes) ValidateCommonAttributes(parentName string, errorAgg *utils.ErrorAggregator) {
	xmlutils.ValidateElements(parentName, errorAgg, c.Base, c.Lang)
}