XmlName.fromString constructor Null safety

XmlName.fromString(
  1. String qualified
)

Create a XmlName by parsing the provided qualified name.

Implementation

factory XmlName.fromString(String qualified) {
  final index = qualified.indexOf(XmlToken.namespace);
  if (index > 0) {
    final prefix = qualified.substring(0, index);
    final local = qualified.substring(index + 1);
    return XmlPrefixName(prefix, local, qualified);
  } else {
    return XmlSimpleName(qualified);
  }
}