Content.fromXml constructor

Content.fromXml(
  1. XmlElement node, {
  2. String defaultType = 'xml',
})

Creates a new Content object from an XmlElement

Implementation

factory Content.fromXml(XmlElement node, {String defaultType = 'xml'}) {
  final type = node.getAttribute('mode') ?? node.getAttribute('type') ?? defaultType;
  return Content(
    value: textDecoder(type, node),
    type: type,
    src: node.getAttribute('src'),
  );
}