doctypeElement property

  1. @override
XmlDoctype? get doctypeElement
inherited

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

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