doctypeElement property

XmlDoctype? doctypeElement

Return the XmlDoctype element, or null if not defined.

For example, the following code prints <!DOCTYPE html>:

var xml = '' ''; print(XmlDocument.parse(xml).doctypeElement);

Implementation

XmlDoctype? get doctypeElement {
  for (final node in children) {
    if (node is XmlDoctype) {
      return node;
    }
  }
  return null;
}