ExceptionEvent.fromXML constructor
ExceptionEvent.fromXML(
- String xmlSTR
Implementation
factory ExceptionEvent.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("exceptionEvent").first;
String user = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "user", orElse: orElseEmpty).value;
String device = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "device", orElse: orElseEmpty).value;
String exceptionSource = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "exceptionSource", orElse: orElseEmpty).value;
String arg = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "arg", orElse: orElseEmpty).value;
String applicationVersion = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "applicationVersion", orElse: orElseEmpty).value;
String applicationName = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "applicationName", orElse: orElseEmpty).value;
String workstation =
eventElement.attributes.firstWhere((p0) => p0.name.toString() == "workstation", orElse: orElseEmpty).value;
String body = eventElement.text;
return ExceptionEvent(
messageName: messageName,
messageID: int.parse(messageID),
user: user,
device: device,
arg: arg,
exceptionSource: exceptionSource,
workstation: workstation,
applicationName: applicationName,
applicationVersion: applicationVersion,
body: body
);
}