public ServiceNotification(XmlNode xmlNode) : base(xmlNode) { XmlNode serviceNameNode = xmlNode.SelectSingleNode("serviceName"); if (serviceNameNode != null) { if (serviceNameNode.Attributes["href"] != null || serviceNameNode.Attributes["id"] != null) { if (serviceNameNode.Attributes["id"] != null) { serviceNameIDRef_ = serviceNameNode.Attributes["id"].Value; XsdTypeNormalizedString ob = new XsdTypeNormalizedString(serviceNameNode); IDManager.SetID(serviceNameIDRef_, ob); } else if (serviceNameNode.Attributes["href"] != null) { serviceNameIDRef_ = serviceNameNode.Attributes["href"].Value; } else { serviceName_ = new XsdTypeNormalizedString(serviceNameNode); } } else { serviceName_ = new XsdTypeNormalizedString(serviceNameNode); } } XmlNode statusNode = xmlNode.SelectSingleNode("status"); if (statusNode != null) { if (statusNode.Attributes["href"] != null || statusNode.Attributes["id"] != null) { if (statusNode.Attributes["id"] != null) { statusIDRef_ = statusNode.Attributes["id"].Value; ServiceStatus ob = new ServiceStatus(statusNode); IDManager.SetID(statusIDRef_, ob); } else if (statusNode.Attributes["href"] != null) { statusIDRef_ = statusNode.Attributes["href"].Value; } else { status_ = new ServiceStatus(statusNode); } } else { status_ = new ServiceStatus(statusNode); } } XmlNode processingStatusNode = xmlNode.SelectSingleNode("processingStatus"); if (processingStatusNode != null) { if (processingStatusNode.Attributes["href"] != null || processingStatusNode.Attributes["id"] != null) { if (processingStatusNode.Attributes["id"] != null) { processingStatusIDRef_ = processingStatusNode.Attributes["id"].Value; ServiceProcessingStatus ob = new ServiceProcessingStatus(processingStatusNode); IDManager.SetID(processingStatusIDRef_, ob); } else if (processingStatusNode.Attributes["href"] != null) { processingStatusIDRef_ = processingStatusNode.Attributes["href"].Value; } else { processingStatus_ = new ServiceProcessingStatus(processingStatusNode); } } else { processingStatus_ = new ServiceProcessingStatus(processingStatusNode); } } XmlNode advisoryNode = xmlNode.SelectSingleNode("advisory"); if (advisoryNode != null) { if (advisoryNode.Attributes["href"] != null || advisoryNode.Attributes["id"] != null) { if (advisoryNode.Attributes["id"] != null) { advisoryIDRef_ = advisoryNode.Attributes["id"].Value; ServiceAdvisory ob = new ServiceAdvisory(advisoryNode); IDManager.SetID(advisoryIDRef_, ob); } else if (advisoryNode.Attributes["href"] != null) { advisoryIDRef_ = advisoryNode.Attributes["href"].Value; } else { advisory_ = new ServiceAdvisory(advisoryNode); } } else { advisory_ = new ServiceAdvisory(advisoryNode); } } }
public ServiceNotification(XmlNode xmlNode) : base(xmlNode) { XmlNodeList serviceNameNodeList = xmlNode.SelectNodes("serviceName"); if (serviceNameNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in serviceNameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { serviceNameIDRef = item.Attributes["id"].Name; XsdTypeNormalizedString ob = XsdTypeNormalizedString(); IDManager.SetID(serviceNameIDRef, ob); } else if (item.Attributes.ToString() == "href") { serviceNameIDRef = item.Attributes["href"].Name; } else { serviceName = new XsdTypeNormalizedString(item); } } } XmlNodeList statusNodeList = xmlNode.SelectNodes("status"); if (statusNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in statusNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { statusIDRef = item.Attributes["id"].Name; ServiceStatus ob = ServiceStatus(); IDManager.SetID(statusIDRef, ob); } else if (item.Attributes.ToString() == "href") { statusIDRef = item.Attributes["href"].Name; } else { status = new ServiceStatus(item); } } } XmlNodeList processingStatusNodeList = xmlNode.SelectNodes("processingStatus"); if (processingStatusNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in processingStatusNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { processingStatusIDRef = item.Attributes["id"].Name; ServiceProcessingStatus ob = ServiceProcessingStatus(); IDManager.SetID(processingStatusIDRef, ob); } else if (item.Attributes.ToString() == "href") { processingStatusIDRef = item.Attributes["href"].Name; } else { processingStatus = new ServiceProcessingStatus(item); } } } XmlNodeList advisoryNodeList = xmlNode.SelectNodes("advisory"); if (advisoryNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in advisoryNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { advisoryIDRef = item.Attributes["id"].Name; ServiceAdvisory ob = ServiceAdvisory(); IDManager.SetID(advisoryIDRef, ob); } else if (item.Attributes.ToString() == "href") { advisoryIDRef = item.Attributes["href"].Name; } else { advisory = new ServiceAdvisory(item); } } } }