InterfaceModeResponse.fromXML constructor
InterfaceModeResponse.fromXML(
- String xmlSTR
Implementation
factory InterfaceModeResponse.fromXML(String xmlSTR) {
final document = XmlDocument.parse(xmlSTR);
String messageName = document.rootElement.attributes
.firstWhere((p0) => p0.name.toString() == "messageName")
.value;
// String xmlns = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "xmlns").value;
String messageID = document.rootElement.attributes
.firstWhere((p0) => p0.name.toString() == "messageID")
.value;
// String xsi = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "xmlns:xsi").value;
String result = document.rootElement.childElements.first.attributes
.firstWhere((p0) => p0.name.toString() == "result")
.value;
return InterfaceModeResponse(
messageName: messageName,
messageID: int.parse(messageID),
result: result,
);
}