parse static method

RssPodcastIndexLiveItem? parse(
  1. XmlElement? element
)

Implementation

static RssPodcastIndexLiveItem? parse(XmlElement? element) {
  if (element == null) {
    return null;
  }

  return RssPodcastIndexLiveItem(
    //elements
    title: findElementOrNull(element, "title")?.innerText,
    description: findElementOrNull(element, "description")?.innerText,
    link: findElementOrNull(element, "link")?.innerText,
    author: findElementOrNull(element, "author")?.innerText,

    // attributes
    status: element.getAttribute("status"),
    start: element.getAttribute("start"),
    end: element.getAttribute("end"),

    // classes
    guid: RssPodcastIndexGuid.parse(findElementOrNull(element, "guid")),

    images: RssPodcastIndexLiveItemImages.parse(findElementOrNull(element, "podcast:images")),

    itunesImage: RssItunesImage.parse(findElementOrNull(element, "itunes:image")),
    alternateEnclosure:
        RssPodcastIndexAlternateEnclosure.parse(findElementOrNull(element, "podcast:alternateEnclosure")),

    persons: element.findElements('podcast:person').map((e) => RssPodcastIndexPerson.parse(e)).toList(),
    enclosure: RssEnclosure.parse(findElementOrNull(element, "enclosure")),

    contentLinks:
        element.findElements('podcast:contentLink').map((e) => RssPodcastIndexContentLink.parse(e)).toList(),
  );
}