public TelephoneNumber(XmlNode xmlNode) { XmlNode typeNode = xmlNode.SelectSingleNode("type"); if (typeNode != null) { if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null) { if (typeNode.Attributes["id"] != null) { typeIDRef_ = typeNode.Attributes["id"].Value; TelephoneTypeEnum ob = new TelephoneTypeEnum(typeNode); IDManager.SetID(typeIDRef_, ob); } else if (typeNode.Attributes["href"] != null) { typeIDRef_ = typeNode.Attributes["href"].Value; } else { type_ = new TelephoneTypeEnum(typeNode); } } else { type_ = new TelephoneTypeEnum(typeNode); } } XmlNode numberNode = xmlNode.SelectSingleNode("number"); if (numberNode != null) { if (numberNode.Attributes["href"] != null || numberNode.Attributes["id"] != null) { if (numberNode.Attributes["id"] != null) { numberIDRef_ = numberNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(numberNode); IDManager.SetID(numberIDRef_, ob); } else if (numberNode.Attributes["href"] != null) { numberIDRef_ = numberNode.Attributes["href"].Value; } else { number_ = new XsdTypeString(numberNode); } } else { number_ = new XsdTypeString(numberNode); } } }
public TelephoneNumber(XmlNode xmlNode) { XmlNodeList typeNodeList = xmlNode.SelectNodes("type"); if (typeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in typeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { typeIDRef = item.Attributes["id"].Name; TelephoneTypeEnum ob = TelephoneTypeEnum(); IDManager.SetID(typeIDRef, ob); } else if (item.Attributes.ToString() == "href") { typeIDRef = item.Attributes["href"].Name; } else { type = new TelephoneTypeEnum(item); } } } XmlNodeList numberNodeList = xmlNode.SelectNodes("number"); if (numberNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in numberNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { numberIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(numberIDRef, ob); } else if (item.Attributes.ToString() == "href") { numberIDRef = item.Attributes["href"].Name; } else { number = new XsdTypeString(item); } } } }