First implementation of an atom feed
This commit is contained in:
23
xhtmlText.go
Normal file
23
xhtmlText.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package atomfeed
|
||||
|
||||
import "errors"
|
||||
|
||||
type XHTMLText struct {
|
||||
*CommonAttributes
|
||||
Type string `xml:"type,attr"` // Must be xhtml
|
||||
XHTMLDiv string `xml:"div"`
|
||||
}
|
||||
|
||||
func (x *XHTMLText) IsText() bool { return true }
|
||||
|
||||
func (x *XHTMLText) Check() error {
|
||||
if x.Type != "xhtml" {
|
||||
return errors.New("type attribute of xhtml text must be xhtml")
|
||||
}
|
||||
|
||||
if x.XHTMLDiv == "" {
|
||||
return errors.New("xhtmlDiv element of xhtml text empty")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user