toXML method

  1. @override
String toXML()
override

Implementation

@override
String toXML() {
  List<AeaMessage> textMessages = texts
      .map((e) => AeaMessage(
          aeaText: AeaText(data: e), aeaBinary: AeaBinary(data: "")))
      .toList();
  List<AeaMessage> binaryMessages = binaries
      .map((e) => AeaMessage(
          aeaText: AeaText(data: ""), aeaBinary: AeaBinary(data: e)))
      .toList();
  return '''<?xml version="1.0" encoding="utf-8"?>
  <cupps xmlns="$xmlns" messageID="$messageID" xmlns:xsi="#$xsi" messageName="$messageName">
  <aeaRequest>
  ${textMessages.map((e) => e.toXML()).join()}
  ${binaryMessages.map((e) => e.toXML()).join()}
  </aeaRequest>
  </cupps>''';
}