DStpExitedEvent.fromXML constructor
DStpExitedEvent.fromXML(
- String xmlSTR
Implementation
factory DStpExitedEvent.fromXML(String xmlSTR) {
final document = XmlDocument.parse(xmlSTR);
String messageName = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "messageName").value;
String messageID = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "messageID").value;
XmlElement eventElement = document.rootElement.findAllElements("dStpExitedEvent").first;
String device = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "device", orElse: orElseEmpty).value;
return DStpExitedEvent(
messageName: messageName,
messageID: int.parse(messageID),
device: device,
);
}