value property

  1. @override
String value

Returns the value of the node, or null.

The returned value depends on the type of the node:

  • attributes return their attribute value;
  • text, CDATA, and comment nodes return their textual content; and
  • processing and declaration nodes return their contents. All other nodes return null.

Implementation

@override
String get value {
  if (attributes.isEmpty) return '';
  final result = toXmlString();
  return result.substring(XmlToken.openDeclaration.length + 1,
      result.length - XmlToken.closeDeclaration.length);
}