diff --git a/inlineOtherContent.go b/inlineOtherContent.go index dec8bd2..d55bc8d 100644 --- a/inlineOtherContent.go +++ b/inlineOtherContent.go @@ -1,5 +1,7 @@ package atomfeed +import "errors" + type InlineOtherContent struct { *CommonAttributes Type MediaType `xml:"type,attr,omitempty"` @@ -12,4 +14,10 @@ func (i *InlineOtherContent) hasSRC() bool { return false } func (i *InlineOtherContent) getType() string { return string(i.Type) } -func (i *InlineOtherContent) Check() error { return nil } +func (i *InlineOtherContent) Check() error { + if isCompositeMediaType(i.getType()) { + return errors.New("type attribute of inline other content must not be a composite type") + } + + return nil +} diff --git a/outOfLineContent.go b/outOfLineContent.go index e3805e9..17d4f64 100644 --- a/outOfLineContent.go +++ b/outOfLineContent.go @@ -15,6 +15,10 @@ func (o *OutOfLineContent) hasSRC() bool { return true } func (o *OutOfLineContent) getType() string { return string(o.Type) } func (o *OutOfLineContent) Check() error { + if isCompositeMediaType(o.getType()) { + return errors.New("type attribute of out of line content must not be a composite type") + } + if o.SRC == "" { return errors.New("src attribute of out of line content empty") }