encodeAttributes static method

String encodeAttributes(
  1. Map<String, dynamic> attr
)

Implementation

static String encodeAttributes(Map<String, dynamic> attr) {
  var buff = StringBuffer();
  for (var key in attr.keys) {
    buff.write(
      "<attribute><name>${key}</name>"
      "<value>${attr[key]}</value></attribute>");
  }
  return buff.toString().replaceAll(">", "&gt;").replaceAll("<", "&lt;");
}