AtomItem.parse constructor

AtomItem.parse(
  1. XmlElement element
)

Implementation

factory AtomItem.parse(XmlElement element) {
  return AtomItem(
    id: findElementOrNull(element, 'id')?.innerText,
    title: findElementOrNull(element, 'title')?.innerText,
    updated: findElementOrNull(element, 'updated')?.innerText,
    authors: element.findElements('author').map((element) => AtomPerson.parse(element)).toList(),
    links: element.findElements('link').map((element) => AtomLink.parse(element)).toList(),
    categories: element.findElements('category').map((element) => AtomCategory.parse(element)).toList(),
    contributors: element.findElements('contributor').map((element) => AtomPerson.parse(element)).toList(),
    source: AtomSource.parse(findElementOrNull(element, 'source')),
    published: findElementOrNull(element, 'published')?.innerText,
    content: findElementOrNull(element, 'content')?.innerText,
    summary: findElementOrNull(element, 'summary')?.innerText,
    rights: findElementOrNull(element, 'rights')?.innerText,
    media: Media.parse(element),
  );
}