func (c *Channel) validate() xmlutils.ParserError { err := utils.NewErrorAggregator() xmlutils.ValidateOccurenceCollection("channel", &err, c.Occurences) c.Extension.Validate(&err) return err.ErrorObject() }
func (s *Source) validate() xmlutils.ParserError { error := utils.NewErrorAggregator() xmlutils.ValidateOccurenceCollection("source", &error, s.Occurences) s.Extension.Validate(&error) s.validateLinks(&error) s.ValidateCommonAttributes("source", &error) return error.ErrorObject() }
func (i *Item) validate() xmlutils.ParserError { err := utils.NewErrorAggregator() xmlutils.ValidateOccurenceCollection("item", &err, i.Occurences) i.Extension.Validate(&err) if i.Occurences.Count("description") == 0 && i.Occurences.Count("title") == 0 { err.NewError(xmlutils.NewError(MissingAttribute, "item should have at least a title or a description")) } return err.ErrorObject() }
func (f *Feed) validate() xmlutils.ParserError { error := utils.NewErrorAggregator() xmlutils.ValidateOccurenceCollection("feed", &error, f.Occurences) f.Extension.Validate(&error) f.validateLinks(&error) f.validateAuthors(&error) f.validateEntries(&error) f.ValidateCommonAttributes("feed", &error) return error.ErrorObject() }
func (e *Entry) validate() xmlutils.ParserError { error := utils.NewErrorAggregator() e.validateLinks(&error) e.validateAuthors(&error) xmlutils.ValidateOccurenceCollection("entry", &error, e.Occurences) e.Extension.Validate(&error) e.ValidateCommonAttributes("entry", &error) if e.Occurences.Count("summary") == 0 && !e.Content.HasReadableContent() { error.NewError(xmlutils.NewError(MissingSummary, "Summary must be provided or Content must contain XML media type, XHTML or text")) } return error.ErrorObject() }
func (v *VisitorExtension) Validate(errorAgg *utils.ErrorAggregator) { xmlutils.ValidateOccurenceCollection(v.name, errorAgg, v.Store.Occ) v.Store.Validate(errorAgg) }