declaration property

  1. @override
XmlDeclaration? get declaration
inherited

Return the XmlDeclaration element, or null if not defined.

For example the following code prints <?xml version="1.0">:

var xml = '<?xml version="1.0">' ''; print(XmlDocument.parse(xml).doctypeElement);

Implementation

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