2024-10-16 21:28:04 +02:00
|
|
|
package atom
|
2024-10-13 17:19:40 +02:00
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type CommonAttributes struct {
|
2024-10-16 17:33:25 +02:00
|
|
|
Base IRI `xml:"base,attr,omitempty"`
|
2024-10-13 17:19:40 +02:00
|
|
|
Lang LanguageTag `xml:"lang,attr,omitempty"`
|
|
|
|
UndefinedAttributes []*ExtensionAttribute `xml:",any"`
|
|
|
|
}
|
|
|
|
|
2024-10-16 19:59:28 +02:00
|
|
|
// Check checks the CommonAttributes for incompatibilities with RFC4287. It
|
|
|
|
// returns an error.
|
2024-10-13 17:19:40 +02:00
|
|
|
func (c *CommonAttributes) Check() error {
|
|
|
|
for i, e := range c.UndefinedAttributes {
|
|
|
|
if err := e.Check(); err != nil {
|
|
|
|
return fmt.Errorf("extension attribute %v of common attributes: %v", i, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|