public RateObservation(XmlNode xmlNode) { XmlNodeList resetDateNodeList = xmlNode.SelectNodes("resetDate"); if (resetDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in resetDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { resetDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(resetDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { resetDateIDRef = item.Attributes["href"].Name; } else { resetDate = new XsdTypeDate(item); } } } XmlNodeList adjustedFixingDateNodeList = xmlNode.SelectNodes("adjustedFixingDate"); if (adjustedFixingDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in adjustedFixingDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { adjustedFixingDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(adjustedFixingDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { adjustedFixingDateIDRef = item.Attributes["href"].Name; } else { adjustedFixingDate = new XsdTypeDate(item); } } } XmlNodeList observedRateNodeList = xmlNode.SelectNodes("observedRate"); if (observedRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in observedRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { observedRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(observedRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { observedRateIDRef = item.Attributes["href"].Name; } else { observedRate = new XsdTypeDecimal(item); } } } XmlNodeList treatedRateNodeList = xmlNode.SelectNodes("treatedRate"); if (treatedRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in treatedRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { treatedRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(treatedRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { treatedRateIDRef = item.Attributes["href"].Name; } else { treatedRate = new XsdTypeDecimal(item); } } } XmlNodeList observationWeightNodeList = xmlNode.SelectNodes("observationWeight"); if (observationWeightNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in observationWeightNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { observationWeightIDRef = item.Attributes["id"].Name; XsdTypePositiveInteger ob = XsdTypePositiveInteger(); IDManager.SetID(observationWeightIDRef, ob); } else if (item.Attributes.ToString() == "href") { observationWeightIDRef = item.Attributes["href"].Name; } else { observationWeight = new XsdTypePositiveInteger(item); } } } XmlNodeList rateReferenceNodeList = xmlNode.SelectNodes("rateReference"); if (rateReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in rateReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateReferenceIDRef = item.Attributes["id"].Name; RateReference ob = RateReference(); IDManager.SetID(rateReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateReferenceIDRef = item.Attributes["href"].Name; } else { rateReference = new RateReference(item); } } } XmlNodeList forecastRateNodeList = xmlNode.SelectNodes("forecastRate"); if (forecastRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in forecastRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forecastRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(forecastRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { forecastRateIDRef = item.Attributes["href"].Name; } else { forecastRate = new XsdTypeDecimal(item); } } } XmlNodeList treatedForecastRateNodeList = xmlNode.SelectNodes("treatedForecastRate"); if (treatedForecastRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in treatedForecastRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { treatedForecastRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(treatedForecastRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { treatedForecastRateIDRef = item.Attributes["href"].Name; } else { treatedForecastRate = new XsdTypeDecimal(item); } } } }
public RateObservation(XmlNode xmlNode) { XmlNode resetDateNode = xmlNode.SelectSingleNode("resetDate"); if (resetDateNode != null) { if (resetDateNode.Attributes["href"] != null || resetDateNode.Attributes["id"] != null) { if (resetDateNode.Attributes["id"] != null) { resetDateIDRef_ = resetDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(resetDateNode); IDManager.SetID(resetDateIDRef_, ob); } else if (resetDateNode.Attributes["href"] != null) { resetDateIDRef_ = resetDateNode.Attributes["href"].Value; } else { resetDate_ = new XsdTypeDate(resetDateNode); } } else { resetDate_ = new XsdTypeDate(resetDateNode); } } XmlNode adjustedFixingDateNode = xmlNode.SelectSingleNode("adjustedFixingDate"); if (adjustedFixingDateNode != null) { if (adjustedFixingDateNode.Attributes["href"] != null || adjustedFixingDateNode.Attributes["id"] != null) { if (adjustedFixingDateNode.Attributes["id"] != null) { adjustedFixingDateIDRef_ = adjustedFixingDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(adjustedFixingDateNode); IDManager.SetID(adjustedFixingDateIDRef_, ob); } else if (adjustedFixingDateNode.Attributes["href"] != null) { adjustedFixingDateIDRef_ = adjustedFixingDateNode.Attributes["href"].Value; } else { adjustedFixingDate_ = new XsdTypeDate(adjustedFixingDateNode); } } else { adjustedFixingDate_ = new XsdTypeDate(adjustedFixingDateNode); } } XmlNode observedRateNode = xmlNode.SelectSingleNode("observedRate"); if (observedRateNode != null) { if (observedRateNode.Attributes["href"] != null || observedRateNode.Attributes["id"] != null) { if (observedRateNode.Attributes["id"] != null) { observedRateIDRef_ = observedRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(observedRateNode); IDManager.SetID(observedRateIDRef_, ob); } else if (observedRateNode.Attributes["href"] != null) { observedRateIDRef_ = observedRateNode.Attributes["href"].Value; } else { observedRate_ = new XsdTypeDecimal(observedRateNode); } } else { observedRate_ = new XsdTypeDecimal(observedRateNode); } } XmlNode treatedRateNode = xmlNode.SelectSingleNode("treatedRate"); if (treatedRateNode != null) { if (treatedRateNode.Attributes["href"] != null || treatedRateNode.Attributes["id"] != null) { if (treatedRateNode.Attributes["id"] != null) { treatedRateIDRef_ = treatedRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(treatedRateNode); IDManager.SetID(treatedRateIDRef_, ob); } else if (treatedRateNode.Attributes["href"] != null) { treatedRateIDRef_ = treatedRateNode.Attributes["href"].Value; } else { treatedRate_ = new XsdTypeDecimal(treatedRateNode); } } else { treatedRate_ = new XsdTypeDecimal(treatedRateNode); } } XmlNode observationWeightNode = xmlNode.SelectSingleNode("observationWeight"); if (observationWeightNode != null) { if (observationWeightNode.Attributes["href"] != null || observationWeightNode.Attributes["id"] != null) { if (observationWeightNode.Attributes["id"] != null) { observationWeightIDRef_ = observationWeightNode.Attributes["id"].Value; XsdTypePositiveInteger ob = new XsdTypePositiveInteger(observationWeightNode); IDManager.SetID(observationWeightIDRef_, ob); } else if (observationWeightNode.Attributes["href"] != null) { observationWeightIDRef_ = observationWeightNode.Attributes["href"].Value; } else { observationWeight_ = new XsdTypePositiveInteger(observationWeightNode); } } else { observationWeight_ = new XsdTypePositiveInteger(observationWeightNode); } } XmlNode rateReferenceNode = xmlNode.SelectSingleNode("rateReference"); if (rateReferenceNode != null) { if (rateReferenceNode.Attributes["href"] != null || rateReferenceNode.Attributes["id"] != null) { if (rateReferenceNode.Attributes["id"] != null) { rateReferenceIDRef_ = rateReferenceNode.Attributes["id"].Value; RateReference ob = new RateReference(rateReferenceNode); IDManager.SetID(rateReferenceIDRef_, ob); } else if (rateReferenceNode.Attributes["href"] != null) { rateReferenceIDRef_ = rateReferenceNode.Attributes["href"].Value; } else { rateReference_ = new RateReference(rateReferenceNode); } } else { rateReference_ = new RateReference(rateReferenceNode); } } XmlNode forecastRateNode = xmlNode.SelectSingleNode("forecastRate"); if (forecastRateNode != null) { if (forecastRateNode.Attributes["href"] != null || forecastRateNode.Attributes["id"] != null) { if (forecastRateNode.Attributes["id"] != null) { forecastRateIDRef_ = forecastRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(forecastRateNode); IDManager.SetID(forecastRateIDRef_, ob); } else if (forecastRateNode.Attributes["href"] != null) { forecastRateIDRef_ = forecastRateNode.Attributes["href"].Value; } else { forecastRate_ = new XsdTypeDecimal(forecastRateNode); } } else { forecastRate_ = new XsdTypeDecimal(forecastRateNode); } } XmlNode treatedForecastRateNode = xmlNode.SelectSingleNode("treatedForecastRate"); if (treatedForecastRateNode != null) { if (treatedForecastRateNode.Attributes["href"] != null || treatedForecastRateNode.Attributes["id"] != null) { if (treatedForecastRateNode.Attributes["id"] != null) { treatedForecastRateIDRef_ = treatedForecastRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(treatedForecastRateNode); IDManager.SetID(treatedForecastRateIDRef_, ob); } else if (treatedForecastRateNode.Attributes["href"] != null) { treatedForecastRateIDRef_ = treatedForecastRateNode.Attributes["href"].Value; } else { treatedForecastRate_ = new XsdTypeDecimal(treatedForecastRateNode); } } else { treatedForecastRate_ = new XsdTypeDecimal(treatedForecastRateNode); } } }
public RateObservation(XmlNode xmlNode) { XmlNodeList resetDateNodeList = xmlNode.SelectNodes("resetDate"); if (resetDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in resetDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { resetDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(resetDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { resetDateIDRef = item.Attributes["href"].Name; } else { resetDate = new XsdTypeDate(item); } } } XmlNodeList adjustedFixingDateNodeList = xmlNode.SelectNodes("adjustedFixingDate"); if (adjustedFixingDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in adjustedFixingDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { adjustedFixingDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(adjustedFixingDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { adjustedFixingDateIDRef = item.Attributes["href"].Name; } else { adjustedFixingDate = new XsdTypeDate(item); } } } XmlNodeList observedRateNodeList = xmlNode.SelectNodes("observedRate"); if (observedRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in observedRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { observedRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(observedRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { observedRateIDRef = item.Attributes["href"].Name; } else { observedRate = new XsdTypeDecimal(item); } } } XmlNodeList treatedRateNodeList = xmlNode.SelectNodes("treatedRate"); if (treatedRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in treatedRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { treatedRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(treatedRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { treatedRateIDRef = item.Attributes["href"].Name; } else { treatedRate = new XsdTypeDecimal(item); } } } XmlNodeList observationWeightNodeList = xmlNode.SelectNodes("observationWeight"); if (observationWeightNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in observationWeightNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { observationWeightIDRef = item.Attributes["id"].Name; XsdTypePositiveInteger ob = XsdTypePositiveInteger(); IDManager.SetID(observationWeightIDRef, ob); } else if (item.Attributes.ToString() == "href") { observationWeightIDRef = item.Attributes["href"].Name; } else { observationWeight = new XsdTypePositiveInteger(item); } } } XmlNodeList rateReferenceNodeList = xmlNode.SelectNodes("rateReference"); if (rateReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in rateReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateReferenceIDRef = item.Attributes["id"].Name; RateReference ob = RateReference(); IDManager.SetID(rateReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateReferenceIDRef = item.Attributes["href"].Name; } else { rateReference = new RateReference(item); } } } XmlNodeList forecastRateNodeList = xmlNode.SelectNodes("forecastRate"); if (forecastRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in forecastRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forecastRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(forecastRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { forecastRateIDRef = item.Attributes["href"].Name; } else { forecastRate = new XsdTypeDecimal(item); } } } XmlNodeList treatedForecastRateNodeList = xmlNode.SelectNodes("treatedForecastRate"); if (treatedForecastRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in treatedForecastRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { treatedForecastRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(treatedForecastRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { treatedForecastRateIDRef = item.Attributes["href"].Name; } else { treatedForecastRate = new XsdTypeDecimal(item); } } } }