public Correlation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList notionalAmountNodeList = xmlNode.SelectNodes("notionalAmount"); if (notionalAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in notionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalAmountIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(notionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalAmountIDRef = item.Attributes["href"].Name; } else { notionalAmount = new NonNegativeMoney(item); } } } XmlNodeList correlationStrikePriceNodeList = xmlNode.SelectNodes("correlationStrikePrice"); if (correlationStrikePriceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in correlationStrikePriceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { correlationStrikePriceIDRef = item.Attributes["id"].Name; CorrelationValue ob = CorrelationValue(); IDManager.SetID(correlationStrikePriceIDRef, ob); } else if (item.Attributes.ToString() == "href") { correlationStrikePriceIDRef = item.Attributes["href"].Name; } else { correlationStrikePrice = new CorrelationValue(item); } } } XmlNodeList boundedCorrelationNodeList = xmlNode.SelectNodes("boundedCorrelation"); if (boundedCorrelationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in boundedCorrelationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { boundedCorrelationIDRef = item.Attributes["id"].Name; BoundedCorrelation ob = BoundedCorrelation(); IDManager.SetID(boundedCorrelationIDRef, ob); } else if (item.Attributes.ToString() == "href") { boundedCorrelationIDRef = item.Attributes["href"].Name; } else { boundedCorrelation = new BoundedCorrelation(item); } } } XmlNodeList numberOfDataSeriesNodeList = xmlNode.SelectNodes("numberOfDataSeries"); if (numberOfDataSeriesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in numberOfDataSeriesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { numberOfDataSeriesIDRef = item.Attributes["id"].Name; XsdTypePositiveInteger ob = XsdTypePositiveInteger(); IDManager.SetID(numberOfDataSeriesIDRef, ob); } else if (item.Attributes.ToString() == "href") { numberOfDataSeriesIDRef = item.Attributes["href"].Name; } else { numberOfDataSeries = new XsdTypePositiveInteger(item); } } } }
public Correlation(XmlNode xmlNode) : base(xmlNode) { XmlNode notionalAmountNode = xmlNode.SelectSingleNode("notionalAmount"); if (notionalAmountNode != null) { if (notionalAmountNode.Attributes["href"] != null || notionalAmountNode.Attributes["id"] != null) { if (notionalAmountNode.Attributes["id"] != null) { notionalAmountIDRef_ = notionalAmountNode.Attributes["id"].Value; NonNegativeMoney ob = new NonNegativeMoney(notionalAmountNode); IDManager.SetID(notionalAmountIDRef_, ob); } else if (notionalAmountNode.Attributes["href"] != null) { notionalAmountIDRef_ = notionalAmountNode.Attributes["href"].Value; } else { notionalAmount_ = new NonNegativeMoney(notionalAmountNode); } } else { notionalAmount_ = new NonNegativeMoney(notionalAmountNode); } } XmlNode correlationStrikePriceNode = xmlNode.SelectSingleNode("correlationStrikePrice"); if (correlationStrikePriceNode != null) { if (correlationStrikePriceNode.Attributes["href"] != null || correlationStrikePriceNode.Attributes["id"] != null) { if (correlationStrikePriceNode.Attributes["id"] != null) { correlationStrikePriceIDRef_ = correlationStrikePriceNode.Attributes["id"].Value; CorrelationValue ob = new CorrelationValue(correlationStrikePriceNode); IDManager.SetID(correlationStrikePriceIDRef_, ob); } else if (correlationStrikePriceNode.Attributes["href"] != null) { correlationStrikePriceIDRef_ = correlationStrikePriceNode.Attributes["href"].Value; } else { correlationStrikePrice_ = new CorrelationValue(correlationStrikePriceNode); } } else { correlationStrikePrice_ = new CorrelationValue(correlationStrikePriceNode); } } XmlNode boundedCorrelationNode = xmlNode.SelectSingleNode("boundedCorrelation"); if (boundedCorrelationNode != null) { if (boundedCorrelationNode.Attributes["href"] != null || boundedCorrelationNode.Attributes["id"] != null) { if (boundedCorrelationNode.Attributes["id"] != null) { boundedCorrelationIDRef_ = boundedCorrelationNode.Attributes["id"].Value; BoundedCorrelation ob = new BoundedCorrelation(boundedCorrelationNode); IDManager.SetID(boundedCorrelationIDRef_, ob); } else if (boundedCorrelationNode.Attributes["href"] != null) { boundedCorrelationIDRef_ = boundedCorrelationNode.Attributes["href"].Value; } else { boundedCorrelation_ = new BoundedCorrelation(boundedCorrelationNode); } } else { boundedCorrelation_ = new BoundedCorrelation(boundedCorrelationNode); } } XmlNode numberOfDataSeriesNode = xmlNode.SelectSingleNode("numberOfDataSeries"); if (numberOfDataSeriesNode != null) { if (numberOfDataSeriesNode.Attributes["href"] != null || numberOfDataSeriesNode.Attributes["id"] != null) { if (numberOfDataSeriesNode.Attributes["id"] != null) { numberOfDataSeriesIDRef_ = numberOfDataSeriesNode.Attributes["id"].Value; XsdTypePositiveInteger ob = new XsdTypePositiveInteger(numberOfDataSeriesNode); IDManager.SetID(numberOfDataSeriesIDRef_, ob); } else if (numberOfDataSeriesNode.Attributes["href"] != null) { numberOfDataSeriesIDRef_ = numberOfDataSeriesNode.Attributes["href"].Value; } else { numberOfDataSeries_ = new XsdTypePositiveInteger(numberOfDataSeriesNode); } } else { numberOfDataSeries_ = new XsdTypePositiveInteger(numberOfDataSeriesNode); } } }
public Correlation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList notionalAmountNodeList = xmlNode.SelectNodes("notionalAmount"); if (notionalAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in notionalAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalAmountIDRef = item.Attributes["id"].Name; NonNegativeMoney ob = NonNegativeMoney(); IDManager.SetID(notionalAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalAmountIDRef = item.Attributes["href"].Name; } else { notionalAmount = new NonNegativeMoney(item); } } } XmlNodeList correlationStrikePriceNodeList = xmlNode.SelectNodes("correlationStrikePrice"); if (correlationStrikePriceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in correlationStrikePriceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { correlationStrikePriceIDRef = item.Attributes["id"].Name; CorrelationValue ob = CorrelationValue(); IDManager.SetID(correlationStrikePriceIDRef, ob); } else if (item.Attributes.ToString() == "href") { correlationStrikePriceIDRef = item.Attributes["href"].Name; } else { correlationStrikePrice = new CorrelationValue(item); } } } XmlNodeList boundedCorrelationNodeList = xmlNode.SelectNodes("boundedCorrelation"); if (boundedCorrelationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in boundedCorrelationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { boundedCorrelationIDRef = item.Attributes["id"].Name; BoundedCorrelation ob = BoundedCorrelation(); IDManager.SetID(boundedCorrelationIDRef, ob); } else if (item.Attributes.ToString() == "href") { boundedCorrelationIDRef = item.Attributes["href"].Name; } else { boundedCorrelation = new BoundedCorrelation(item); } } } XmlNodeList numberOfDataSeriesNodeList = xmlNode.SelectNodes("numberOfDataSeries"); if (numberOfDataSeriesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in numberOfDataSeriesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { numberOfDataSeriesIDRef = item.Attributes["id"].Name; XsdTypePositiveInteger ob = XsdTypePositiveInteger(); IDManager.SetID(numberOfDataSeriesIDRef, ob); } else if (item.Attributes.ToString() == "href") { numberOfDataSeriesIDRef = item.Attributes["href"].Name; } else { numberOfDataSeries = new XsdTypePositiveInteger(item); } } } }