public GenericProduct(XmlNode xmlNode) : base(xmlNode) { XmlNode multiLegNode = xmlNode.SelectSingleNode("multiLeg"); if (multiLegNode != null) { if (multiLegNode.Attributes["href"] != null || multiLegNode.Attributes["id"] != null) { if (multiLegNode.Attributes["id"] != null) { multiLegIDRef_ = multiLegNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(multiLegNode); IDManager.SetID(multiLegIDRef_, ob); } else if (multiLegNode.Attributes["href"] != null) { multiLegIDRef_ = multiLegNode.Attributes["href"].Value; } else { multiLeg_ = new XsdTypeBoolean(multiLegNode); } } else { multiLeg_ = new XsdTypeBoolean(multiLegNode); } } XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference"); if (counterpartyReferenceNodeList != null) { this.counterpartyReference_ = new List<PartyReference>(); foreach (XmlNode item in counterpartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { counterpartyReferenceIDRef_ = item.Attributes["id"].Value; counterpartyReference_.Add(new PartyReference(item)); IDManager.SetID(counterpartyReferenceIDRef_, counterpartyReference_[counterpartyReference_.Count - 1 ]); } else if (item.Attributes["href"] != null) { counterpartyReferenceIDRef_ = item.Attributes["href"].Value; } else { counterpartyReference_.Add(new PartyReference(item)); } } else { counterpartyReference_.Add(new PartyReference(item)); } } } XmlNode premiumNode = xmlNode.SelectSingleNode("premium"); if (premiumNode != null) { if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null) { if (premiumNode.Attributes["id"] != null) { premiumIDRef_ = premiumNode.Attributes["id"].Value; SimplePayment ob = new SimplePayment(premiumNode); IDManager.SetID(premiumIDRef_, ob); } else if (premiumNode.Attributes["href"] != null) { premiumIDRef_ = premiumNode.Attributes["href"].Value; } else { premium_ = new SimplePayment(premiumNode); } } else { premium_ = new SimplePayment(premiumNode); } } XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate"); if (effectiveDateNode != null) { if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) { if (effectiveDateNode.Attributes["id"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode); IDManager.SetID(effectiveDateIDRef_, ob); } else if (effectiveDateNode.Attributes["href"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value; } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } XmlNode expirationDateNode = xmlNode.SelectSingleNode("expirationDate"); if (expirationDateNode != null) { if (expirationDateNode.Attributes["href"] != null || expirationDateNode.Attributes["id"] != null) { if (expirationDateNode.Attributes["id"] != null) { expirationDateIDRef_ = expirationDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(expirationDateNode); IDManager.SetID(expirationDateIDRef_, ob); } else if (expirationDateNode.Attributes["href"] != null) { expirationDateIDRef_ = expirationDateNode.Attributes["href"].Value; } else { expirationDate_ = new AdjustableDate2(expirationDateNode); } } else { expirationDate_ = new AdjustableDate2(expirationDateNode); } } XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate"); if (terminationDateNode != null) { if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null) { if (terminationDateNode.Attributes["id"] != null) { terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(terminationDateNode); IDManager.SetID(terminationDateIDRef_, ob); } else if (terminationDateNode.Attributes["href"] != null) { terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value; } else { terminationDate_ = new AdjustableDate2(terminationDateNode); } } else { terminationDate_ = new AdjustableDate2(terminationDateNode); } } XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer"); if (underlyerNodeList != null) { this.underlyer_ = new List<TradeUnderlyer2>(); foreach (XmlNode item in underlyerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { underlyerIDRef_ = item.Attributes["id"].Value; underlyer_.Add(new TradeUnderlyer2(item)); IDManager.SetID(underlyerIDRef_, underlyer_[underlyer_.Count - 1 ]); } else if (item.Attributes["href"] != null) { underlyerIDRef_ = item.Attributes["href"].Value; } else { underlyer_.Add(new TradeUnderlyer2(item)); } } else { underlyer_.Add(new TradeUnderlyer2(item)); } } } XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional"); if (notionalNodeList != null) { this.notional_ = new List<CashflowNotional>(); foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { notionalIDRef_ = item.Attributes["id"].Value; notional_.Add(new CashflowNotional(item)); IDManager.SetID(notionalIDRef_, notional_[notional_.Count - 1 ]); } else if (item.Attributes["href"] != null) { notionalIDRef_ = item.Attributes["href"].Value; } else { notional_.Add(new CashflowNotional(item)); } } else { notional_.Add(new CashflowNotional(item)); } } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; OptionType ob = new OptionType(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new OptionType(optionTypeNode); } } else { optionType_ = new OptionType(optionTypeNode); } } XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency"); if (settlementCurrencyNodeList != null) { this.settlementCurrency_ = new List<IdentifiedCurrency>(); foreach (XmlNode item in settlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { settlementCurrencyIDRef_ = item.Attributes["id"].Value; settlementCurrency_.Add(new IdentifiedCurrency(item)); IDManager.SetID(settlementCurrencyIDRef_, settlementCurrency_[settlementCurrency_.Count - 1 ]); } else if (item.Attributes["href"] != null) { settlementCurrencyIDRef_ = item.Attributes["href"].Value; } else { settlementCurrency_.Add(new IdentifiedCurrency(item)); } } else { settlementCurrency_.Add(new IdentifiedCurrency(item)); } } } XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction"); if (dayCountFractionNodeList != null) { this.dayCountFraction_ = new List<DayCountFraction>(); foreach (XmlNode item in dayCountFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { dayCountFractionIDRef_ = item.Attributes["id"].Value; dayCountFraction_.Add(new DayCountFraction(item)); IDManager.SetID(dayCountFractionIDRef_, dayCountFraction_[dayCountFraction_.Count - 1 ]); } else if (item.Attributes["href"] != null) { dayCountFractionIDRef_ = item.Attributes["href"].Value; } else { dayCountFraction_.Add(new DayCountFraction(item)); } } else { dayCountFraction_.Add(new DayCountFraction(item)); } } } }
public GeneralTerms(XmlNode xmlNode) { XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate"); if (effectiveDateNode != null) { if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) { if (effectiveDateNode.Attributes["id"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode); IDManager.SetID(effectiveDateIDRef_, ob); } else if (effectiveDateNode.Attributes["href"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value; } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } XmlNode scheduledTerminationDateNode = xmlNode.SelectSingleNode("scheduledTerminationDate"); if (scheduledTerminationDateNode != null) { if (scheduledTerminationDateNode.Attributes["href"] != null || scheduledTerminationDateNode.Attributes["id"] != null) { if (scheduledTerminationDateNode.Attributes["id"] != null) { scheduledTerminationDateIDRef_ = scheduledTerminationDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(scheduledTerminationDateNode); IDManager.SetID(scheduledTerminationDateIDRef_, ob); } else if (scheduledTerminationDateNode.Attributes["href"] != null) { scheduledTerminationDateIDRef_ = scheduledTerminationDateNode.Attributes["href"].Value; } else { scheduledTerminationDate_ = new AdjustableDate2(scheduledTerminationDateNode); } } else { scheduledTerminationDate_ = new AdjustableDate2(scheduledTerminationDateNode); } } XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode dateAdjustmentsNode = xmlNode.SelectSingleNode("dateAdjustments"); if (dateAdjustmentsNode != null) { if (dateAdjustmentsNode.Attributes["href"] != null || dateAdjustmentsNode.Attributes["id"] != null) { if (dateAdjustmentsNode.Attributes["id"] != null) { dateAdjustmentsIDRef_ = dateAdjustmentsNode.Attributes["id"].Value; BusinessDayAdjustments ob = new BusinessDayAdjustments(dateAdjustmentsNode); IDManager.SetID(dateAdjustmentsIDRef_, ob); } else if (dateAdjustmentsNode.Attributes["href"] != null) { dateAdjustmentsIDRef_ = dateAdjustmentsNode.Attributes["href"].Value; } else { dateAdjustments_ = new BusinessDayAdjustments(dateAdjustmentsNode); } } else { dateAdjustments_ = new BusinessDayAdjustments(dateAdjustmentsNode); } } XmlNode referenceInformationNode = xmlNode.SelectSingleNode("referenceInformation"); if (referenceInformationNode != null) { if (referenceInformationNode.Attributes["href"] != null || referenceInformationNode.Attributes["id"] != null) { if (referenceInformationNode.Attributes["id"] != null) { referenceInformationIDRef_ = referenceInformationNode.Attributes["id"].Value; ReferenceInformation ob = new ReferenceInformation(referenceInformationNode); IDManager.SetID(referenceInformationIDRef_, ob); } else if (referenceInformationNode.Attributes["href"] != null) { referenceInformationIDRef_ = referenceInformationNode.Attributes["href"].Value; } else { referenceInformation_ = new ReferenceInformation(referenceInformationNode); } } else { referenceInformation_ = new ReferenceInformation(referenceInformationNode); } } XmlNode indexReferenceInformationNode = xmlNode.SelectSingleNode("indexReferenceInformation"); if (indexReferenceInformationNode != null) { if (indexReferenceInformationNode.Attributes["href"] != null || indexReferenceInformationNode.Attributes["id"] != null) { if (indexReferenceInformationNode.Attributes["id"] != null) { indexReferenceInformationIDRef_ = indexReferenceInformationNode.Attributes["id"].Value; IndexReferenceInformation ob = new IndexReferenceInformation(indexReferenceInformationNode); IDManager.SetID(indexReferenceInformationIDRef_, ob); } else if (indexReferenceInformationNode.Attributes["href"] != null) { indexReferenceInformationIDRef_ = indexReferenceInformationNode.Attributes["href"].Value; } else { indexReferenceInformation_ = new IndexReferenceInformation(indexReferenceInformationNode); } } else { indexReferenceInformation_ = new IndexReferenceInformation(indexReferenceInformationNode); } } XmlNode basketReferenceInformationNode = xmlNode.SelectSingleNode("basketReferenceInformation"); if (basketReferenceInformationNode != null) { if (basketReferenceInformationNode.Attributes["href"] != null || basketReferenceInformationNode.Attributes["id"] != null) { if (basketReferenceInformationNode.Attributes["id"] != null) { basketReferenceInformationIDRef_ = basketReferenceInformationNode.Attributes["id"].Value; BasketReferenceInformation ob = new BasketReferenceInformation(basketReferenceInformationNode); IDManager.SetID(basketReferenceInformationIDRef_, ob); } else if (basketReferenceInformationNode.Attributes["href"] != null) { basketReferenceInformationIDRef_ = basketReferenceInformationNode.Attributes["href"].Value; } else { basketReferenceInformation_ = new BasketReferenceInformation(basketReferenceInformationNode); } } else { basketReferenceInformation_ = new BasketReferenceInformation(basketReferenceInformationNode); } } XmlNodeList additionalTermNodeList = xmlNode.SelectNodes("additionalTerm"); if (additionalTermNodeList != null) { this.additionalTerm_ = new List<AdditionalTerm>(); foreach (XmlNode item in additionalTermNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { additionalTermIDRef_ = item.Attributes["id"].Value; additionalTerm_.Add(new AdditionalTerm(item)); IDManager.SetID(additionalTermIDRef_, additionalTerm_[additionalTerm_.Count - 1 ]); } else if (item.Attributes["href"] != null) { additionalTermIDRef_ = item.Attributes["href"].Value; } else { additionalTerm_.Add(new AdditionalTerm(item)); } } else { additionalTerm_.Add(new AdditionalTerm(item)); } } } XmlNode substitutionNode = xmlNode.SelectSingleNode("substitution"); if (substitutionNode != null) { if (substitutionNode.Attributes["href"] != null || substitutionNode.Attributes["id"] != null) { if (substitutionNode.Attributes["id"] != null) { substitutionIDRef_ = substitutionNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(substitutionNode); IDManager.SetID(substitutionIDRef_, ob); } else if (substitutionNode.Attributes["href"] != null) { substitutionIDRef_ = substitutionNode.Attributes["href"].Value; } else { substitution_ = new XsdTypeBoolean(substitutionNode); } } else { substitution_ = new XsdTypeBoolean(substitutionNode); } } XmlNode modifiedEquityDeliveryNode = xmlNode.SelectSingleNode("modifiedEquityDelivery"); if (modifiedEquityDeliveryNode != null) { if (modifiedEquityDeliveryNode.Attributes["href"] != null || modifiedEquityDeliveryNode.Attributes["id"] != null) { if (modifiedEquityDeliveryNode.Attributes["id"] != null) { modifiedEquityDeliveryIDRef_ = modifiedEquityDeliveryNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(modifiedEquityDeliveryNode); IDManager.SetID(modifiedEquityDeliveryIDRef_, ob); } else if (modifiedEquityDeliveryNode.Attributes["href"] != null) { modifiedEquityDeliveryIDRef_ = modifiedEquityDeliveryNode.Attributes["href"].Value; } else { modifiedEquityDelivery_ = new XsdTypeBoolean(modifiedEquityDeliveryNode); } } else { modifiedEquityDelivery_ = new XsdTypeBoolean(modifiedEquityDeliveryNode); } } }
public GeneralTerms(XmlNode xmlNode) { XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate"); if (effectiveDateNode != null) { if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) { if (effectiveDateNode.Attributes["id"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode); IDManager.SetID(effectiveDateIDRef_, ob); } else if (effectiveDateNode.Attributes["href"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value; } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } XmlNode scheduledTerminationDateNode = xmlNode.SelectSingleNode("scheduledTerminationDate"); if (scheduledTerminationDateNode != null) { if (scheduledTerminationDateNode.Attributes["href"] != null || scheduledTerminationDateNode.Attributes["id"] != null) { if (scheduledTerminationDateNode.Attributes["id"] != null) { scheduledTerminationDateIDRef_ = scheduledTerminationDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(scheduledTerminationDateNode); IDManager.SetID(scheduledTerminationDateIDRef_, ob); } else if (scheduledTerminationDateNode.Attributes["href"] != null) { scheduledTerminationDateIDRef_ = scheduledTerminationDateNode.Attributes["href"].Value; } else { scheduledTerminationDate_ = new AdjustableDate2(scheduledTerminationDateNode); } } else { scheduledTerminationDate_ = new AdjustableDate2(scheduledTerminationDateNode); } } XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNode dateAdjustmentsNode = xmlNode.SelectSingleNode("dateAdjustments"); if (dateAdjustmentsNode != null) { if (dateAdjustmentsNode.Attributes["href"] != null || dateAdjustmentsNode.Attributes["id"] != null) { if (dateAdjustmentsNode.Attributes["id"] != null) { dateAdjustmentsIDRef_ = dateAdjustmentsNode.Attributes["id"].Value; BusinessDayAdjustments ob = new BusinessDayAdjustments(dateAdjustmentsNode); IDManager.SetID(dateAdjustmentsIDRef_, ob); } else if (dateAdjustmentsNode.Attributes["href"] != null) { dateAdjustmentsIDRef_ = dateAdjustmentsNode.Attributes["href"].Value; } else { dateAdjustments_ = new BusinessDayAdjustments(dateAdjustmentsNode); } } else { dateAdjustments_ = new BusinessDayAdjustments(dateAdjustmentsNode); } } XmlNode referenceInformationNode = xmlNode.SelectSingleNode("referenceInformation"); if (referenceInformationNode != null) { if (referenceInformationNode.Attributes["href"] != null || referenceInformationNode.Attributes["id"] != null) { if (referenceInformationNode.Attributes["id"] != null) { referenceInformationIDRef_ = referenceInformationNode.Attributes["id"].Value; ReferenceInformation ob = new ReferenceInformation(referenceInformationNode); IDManager.SetID(referenceInformationIDRef_, ob); } else if (referenceInformationNode.Attributes["href"] != null) { referenceInformationIDRef_ = referenceInformationNode.Attributes["href"].Value; } else { referenceInformation_ = new ReferenceInformation(referenceInformationNode); } } else { referenceInformation_ = new ReferenceInformation(referenceInformationNode); } } XmlNode indexReferenceInformationNode = xmlNode.SelectSingleNode("indexReferenceInformation"); if (indexReferenceInformationNode != null) { if (indexReferenceInformationNode.Attributes["href"] != null || indexReferenceInformationNode.Attributes["id"] != null) { if (indexReferenceInformationNode.Attributes["id"] != null) { indexReferenceInformationIDRef_ = indexReferenceInformationNode.Attributes["id"].Value; IndexReferenceInformation ob = new IndexReferenceInformation(indexReferenceInformationNode); IDManager.SetID(indexReferenceInformationIDRef_, ob); } else if (indexReferenceInformationNode.Attributes["href"] != null) { indexReferenceInformationIDRef_ = indexReferenceInformationNode.Attributes["href"].Value; } else { indexReferenceInformation_ = new IndexReferenceInformation(indexReferenceInformationNode); } } else { indexReferenceInformation_ = new IndexReferenceInformation(indexReferenceInformationNode); } } XmlNode basketReferenceInformationNode = xmlNode.SelectSingleNode("basketReferenceInformation"); if (basketReferenceInformationNode != null) { if (basketReferenceInformationNode.Attributes["href"] != null || basketReferenceInformationNode.Attributes["id"] != null) { if (basketReferenceInformationNode.Attributes["id"] != null) { basketReferenceInformationIDRef_ = basketReferenceInformationNode.Attributes["id"].Value; BasketReferenceInformation ob = new BasketReferenceInformation(basketReferenceInformationNode); IDManager.SetID(basketReferenceInformationIDRef_, ob); } else if (basketReferenceInformationNode.Attributes["href"] != null) { basketReferenceInformationIDRef_ = basketReferenceInformationNode.Attributes["href"].Value; } else { basketReferenceInformation_ = new BasketReferenceInformation(basketReferenceInformationNode); } } else { basketReferenceInformation_ = new BasketReferenceInformation(basketReferenceInformationNode); } } XmlNodeList additionalTermNodeList = xmlNode.SelectNodes("additionalTerm"); if (additionalTermNodeList != null) { this.additionalTerm_ = new List <AdditionalTerm>(); foreach (XmlNode item in additionalTermNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { additionalTermIDRef_ = item.Attributes["id"].Value; additionalTerm_.Add(new AdditionalTerm(item)); IDManager.SetID(additionalTermIDRef_, additionalTerm_[additionalTerm_.Count - 1]); } else if (item.Attributes["href"] != null) { additionalTermIDRef_ = item.Attributes["href"].Value; } else { additionalTerm_.Add(new AdditionalTerm(item)); } } else { additionalTerm_.Add(new AdditionalTerm(item)); } } } XmlNode substitutionNode = xmlNode.SelectSingleNode("substitution"); if (substitutionNode != null) { if (substitutionNode.Attributes["href"] != null || substitutionNode.Attributes["id"] != null) { if (substitutionNode.Attributes["id"] != null) { substitutionIDRef_ = substitutionNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(substitutionNode); IDManager.SetID(substitutionIDRef_, ob); } else if (substitutionNode.Attributes["href"] != null) { substitutionIDRef_ = substitutionNode.Attributes["href"].Value; } else { substitution_ = new XsdTypeBoolean(substitutionNode); } } else { substitution_ = new XsdTypeBoolean(substitutionNode); } } XmlNode modifiedEquityDeliveryNode = xmlNode.SelectSingleNode("modifiedEquityDelivery"); if (modifiedEquityDeliveryNode != null) { if (modifiedEquityDeliveryNode.Attributes["href"] != null || modifiedEquityDeliveryNode.Attributes["id"] != null) { if (modifiedEquityDeliveryNode.Attributes["id"] != null) { modifiedEquityDeliveryIDRef_ = modifiedEquityDeliveryNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(modifiedEquityDeliveryNode); IDManager.SetID(modifiedEquityDeliveryIDRef_, ob); } else if (modifiedEquityDeliveryNode.Attributes["href"] != null) { modifiedEquityDeliveryIDRef_ = modifiedEquityDeliveryNode.Attributes["href"].Value; } else { modifiedEquityDelivery_ = new XsdTypeBoolean(modifiedEquityDeliveryNode); } } else { modifiedEquityDelivery_ = new XsdTypeBoolean(modifiedEquityDeliveryNode); } } }
public GenericProduct(XmlNode xmlNode) : base(xmlNode) { XmlNode multiLegNode = xmlNode.SelectSingleNode("multiLeg"); if (multiLegNode != null) { if (multiLegNode.Attributes["href"] != null || multiLegNode.Attributes["id"] != null) { if (multiLegNode.Attributes["id"] != null) { multiLegIDRef_ = multiLegNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(multiLegNode); IDManager.SetID(multiLegIDRef_, ob); } else if (multiLegNode.Attributes["href"] != null) { multiLegIDRef_ = multiLegNode.Attributes["href"].Value; } else { multiLeg_ = new XsdTypeBoolean(multiLegNode); } } else { multiLeg_ = new XsdTypeBoolean(multiLegNode); } } XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference"); if (buyerPartyReferenceNode != null) { if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) { if (buyerPartyReferenceNode.Attributes["id"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(buyerPartyReferenceNode); IDManager.SetID(buyerPartyReferenceIDRef_, ob); } else if (buyerPartyReferenceNode.Attributes["href"] != null) { buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value; } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } else { buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode); } } XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference"); if (buyerAccountReferenceNode != null) { if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) { if (buyerAccountReferenceNode.Attributes["id"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(buyerAccountReferenceNode); IDManager.SetID(buyerAccountReferenceIDRef_, ob); } else if (buyerAccountReferenceNode.Attributes["href"] != null) { buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value; } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } else { buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode); } } XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference"); if (sellerPartyReferenceNode != null) { if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) { if (sellerPartyReferenceNode.Attributes["id"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(sellerPartyReferenceNode); IDManager.SetID(sellerPartyReferenceIDRef_, ob); } else if (sellerPartyReferenceNode.Attributes["href"] != null) { sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value; } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } else { sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode); } } XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference"); if (sellerAccountReferenceNode != null) { if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) { if (sellerAccountReferenceNode.Attributes["id"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(sellerAccountReferenceNode); IDManager.SetID(sellerAccountReferenceIDRef_, ob); } else if (sellerAccountReferenceNode.Attributes["href"] != null) { sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value; } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } else { sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode); } } XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference"); if (counterpartyReferenceNodeList != null) { this.counterpartyReference_ = new List <PartyReference>(); foreach (XmlNode item in counterpartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { counterpartyReferenceIDRef_ = item.Attributes["id"].Value; counterpartyReference_.Add(new PartyReference(item)); IDManager.SetID(counterpartyReferenceIDRef_, counterpartyReference_[counterpartyReference_.Count - 1]); } else if (item.Attributes["href"] != null) { counterpartyReferenceIDRef_ = item.Attributes["href"].Value; } else { counterpartyReference_.Add(new PartyReference(item)); } } else { counterpartyReference_.Add(new PartyReference(item)); } } } XmlNode premiumNode = xmlNode.SelectSingleNode("premium"); if (premiumNode != null) { if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null) { if (premiumNode.Attributes["id"] != null) { premiumIDRef_ = premiumNode.Attributes["id"].Value; SimplePayment ob = new SimplePayment(premiumNode); IDManager.SetID(premiumIDRef_, ob); } else if (premiumNode.Attributes["href"] != null) { premiumIDRef_ = premiumNode.Attributes["href"].Value; } else { premium_ = new SimplePayment(premiumNode); } } else { premium_ = new SimplePayment(premiumNode); } } XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate"); if (effectiveDateNode != null) { if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) { if (effectiveDateNode.Attributes["id"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode); IDManager.SetID(effectiveDateIDRef_, ob); } else if (effectiveDateNode.Attributes["href"] != null) { effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value; } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } else { effectiveDate_ = new AdjustableDate2(effectiveDateNode); } } XmlNode expirationDateNode = xmlNode.SelectSingleNode("expirationDate"); if (expirationDateNode != null) { if (expirationDateNode.Attributes["href"] != null || expirationDateNode.Attributes["id"] != null) { if (expirationDateNode.Attributes["id"] != null) { expirationDateIDRef_ = expirationDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(expirationDateNode); IDManager.SetID(expirationDateIDRef_, ob); } else if (expirationDateNode.Attributes["href"] != null) { expirationDateIDRef_ = expirationDateNode.Attributes["href"].Value; } else { expirationDate_ = new AdjustableDate2(expirationDateNode); } } else { expirationDate_ = new AdjustableDate2(expirationDateNode); } } XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate"); if (terminationDateNode != null) { if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null) { if (terminationDateNode.Attributes["id"] != null) { terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value; AdjustableDate2 ob = new AdjustableDate2(terminationDateNode); IDManager.SetID(terminationDateIDRef_, ob); } else if (terminationDateNode.Attributes["href"] != null) { terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value; } else { terminationDate_ = new AdjustableDate2(terminationDateNode); } } else { terminationDate_ = new AdjustableDate2(terminationDateNode); } } XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer"); if (underlyerNodeList != null) { this.underlyer_ = new List <TradeUnderlyer2>(); foreach (XmlNode item in underlyerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { underlyerIDRef_ = item.Attributes["id"].Value; underlyer_.Add(new TradeUnderlyer2(item)); IDManager.SetID(underlyerIDRef_, underlyer_[underlyer_.Count - 1]); } else if (item.Attributes["href"] != null) { underlyerIDRef_ = item.Attributes["href"].Value; } else { underlyer_.Add(new TradeUnderlyer2(item)); } } else { underlyer_.Add(new TradeUnderlyer2(item)); } } } XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional"); if (notionalNodeList != null) { this.notional_ = new List <CashflowNotional>(); foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { notionalIDRef_ = item.Attributes["id"].Value; notional_.Add(new CashflowNotional(item)); IDManager.SetID(notionalIDRef_, notional_[notional_.Count - 1]); } else if (item.Attributes["href"] != null) { notionalIDRef_ = item.Attributes["href"].Value; } else { notional_.Add(new CashflowNotional(item)); } } else { notional_.Add(new CashflowNotional(item)); } } } XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType"); if (optionTypeNode != null) { if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) { if (optionTypeNode.Attributes["id"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value; OptionType ob = new OptionType(optionTypeNode); IDManager.SetID(optionTypeIDRef_, ob); } else if (optionTypeNode.Attributes["href"] != null) { optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value; } else { optionType_ = new OptionType(optionTypeNode); } } else { optionType_ = new OptionType(optionTypeNode); } } XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency"); if (settlementCurrencyNodeList != null) { this.settlementCurrency_ = new List <IdentifiedCurrency>(); foreach (XmlNode item in settlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { settlementCurrencyIDRef_ = item.Attributes["id"].Value; settlementCurrency_.Add(new IdentifiedCurrency(item)); IDManager.SetID(settlementCurrencyIDRef_, settlementCurrency_[settlementCurrency_.Count - 1]); } else if (item.Attributes["href"] != null) { settlementCurrencyIDRef_ = item.Attributes["href"].Value; } else { settlementCurrency_.Add(new IdentifiedCurrency(item)); } } else { settlementCurrency_.Add(new IdentifiedCurrency(item)); } } } XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction"); if (dayCountFractionNodeList != null) { this.dayCountFraction_ = new List <DayCountFraction>(); foreach (XmlNode item in dayCountFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { dayCountFractionIDRef_ = item.Attributes["id"].Value; dayCountFraction_.Add(new DayCountFraction(item)); IDManager.SetID(dayCountFractionIDRef_, dayCountFraction_[dayCountFraction_.Count - 1]); } else if (item.Attributes["href"] != null) { dayCountFractionIDRef_ = item.Attributes["href"].Value; } else { dayCountFraction_.Add(new DayCountFraction(item)); } } else { dayCountFraction_.Add(new DayCountFraction(item)); } } } }
public GeneralTerms(XmlNode xmlNode) { XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate"); if (effectiveDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in effectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { effectiveDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(effectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { effectiveDateIDRef = item.Attributes["href"].Name; } else { effectiveDate = new AdjustableDate2(item); } } } XmlNodeList scheduledTerminationDateNodeList = xmlNode.SelectNodes("scheduledTerminationDate"); if (scheduledTerminationDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in scheduledTerminationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { scheduledTerminationDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(scheduledTerminationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { scheduledTerminationDateIDRef = item.Attributes["href"].Name; } else { scheduledTerminationDate = new AdjustableDate2(item); } } } XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList dateAdjustmentsNodeList = xmlNode.SelectNodes("dateAdjustments"); if (dateAdjustmentsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in dateAdjustmentsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { dateAdjustmentsIDRef = item.Attributes["id"].Name; BusinessDayAdjustments ob = BusinessDayAdjustments(); IDManager.SetID(dateAdjustmentsIDRef, ob); } else if (item.Attributes.ToString() == "href") { dateAdjustmentsIDRef = item.Attributes["href"].Name; } else { dateAdjustments = new BusinessDayAdjustments(item); } } } XmlNodeList referenceInformationNodeList = xmlNode.SelectNodes("referenceInformation"); if (referenceInformationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in referenceInformationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { referenceInformationIDRef = item.Attributes["id"].Name; ReferenceInformation ob = ReferenceInformation(); IDManager.SetID(referenceInformationIDRef, ob); } else if (item.Attributes.ToString() == "href") { referenceInformationIDRef = item.Attributes["href"].Name; } else { referenceInformation = new ReferenceInformation(item); } } } XmlNodeList indexReferenceInformationNodeList = xmlNode.SelectNodes("indexReferenceInformation"); if (indexReferenceInformationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in indexReferenceInformationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { indexReferenceInformationIDRef = item.Attributes["id"].Name; IndexReferenceInformation ob = IndexReferenceInformation(); IDManager.SetID(indexReferenceInformationIDRef, ob); } else if (item.Attributes.ToString() == "href") { indexReferenceInformationIDRef = item.Attributes["href"].Name; } else { indexReferenceInformation = new IndexReferenceInformation(item); } } } XmlNodeList basketReferenceInformationNodeList = xmlNode.SelectNodes("basketReferenceInformation"); if (basketReferenceInformationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in basketReferenceInformationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { basketReferenceInformationIDRef = item.Attributes["id"].Name; BasketReferenceInformation ob = BasketReferenceInformation(); IDManager.SetID(basketReferenceInformationIDRef, ob); } else if (item.Attributes.ToString() == "href") { basketReferenceInformationIDRef = item.Attributes["href"].Name; } else { basketReferenceInformation = new BasketReferenceInformation(item); } } } XmlNodeList additionalTermNodeList = xmlNode.SelectNodes("additionalTerm"); foreach (XmlNode item in additionalTermNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { additionalTermIDRef = item.Attributes["id"].Name; List <AdditionalTerm> ob = new List <AdditionalTerm>(); ob.Add(new AdditionalTerm(item)); IDManager.SetID(additionalTermIDRef, ob); } else if (item.Attributes.ToString() == "href") { additionalTermIDRef = item.Attributes["href"].Name; } else { additionalTerm.Add(new AdditionalTerm(item)); } } } XmlNodeList substitutionNodeList = xmlNode.SelectNodes("substitution"); if (substitutionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in substitutionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { substitutionIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(substitutionIDRef, ob); } else if (item.Attributes.ToString() == "href") { substitutionIDRef = item.Attributes["href"].Name; } else { substitution = new XsdTypeBoolean(item); } } } XmlNodeList modifiedEquityDeliveryNodeList = xmlNode.SelectNodes("modifiedEquityDelivery"); if (modifiedEquityDeliveryNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in modifiedEquityDeliveryNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { modifiedEquityDeliveryIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(modifiedEquityDeliveryIDRef, ob); } else if (item.Attributes.ToString() == "href") { modifiedEquityDeliveryIDRef = item.Attributes["href"].Name; } else { modifiedEquityDelivery = new XsdTypeBoolean(item); } } } }
public GeneralTerms(XmlNode xmlNode) { XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate"); if (effectiveDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in effectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { effectiveDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(effectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { effectiveDateIDRef = item.Attributes["href"].Name; } else { effectiveDate = new AdjustableDate2(item); } } } XmlNodeList scheduledTerminationDateNodeList = xmlNode.SelectNodes("scheduledTerminationDate"); if (scheduledTerminationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in scheduledTerminationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { scheduledTerminationDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(scheduledTerminationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { scheduledTerminationDateIDRef = item.Attributes["href"].Name; } else { scheduledTerminationDate = new AdjustableDate2(item); } } } XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList dateAdjustmentsNodeList = xmlNode.SelectNodes("dateAdjustments"); if (dateAdjustmentsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in dateAdjustmentsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { dateAdjustmentsIDRef = item.Attributes["id"].Name; BusinessDayAdjustments ob = BusinessDayAdjustments(); IDManager.SetID(dateAdjustmentsIDRef, ob); } else if (item.Attributes.ToString() == "href") { dateAdjustmentsIDRef = item.Attributes["href"].Name; } else { dateAdjustments = new BusinessDayAdjustments(item); } } } XmlNodeList referenceInformationNodeList = xmlNode.SelectNodes("referenceInformation"); if (referenceInformationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in referenceInformationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { referenceInformationIDRef = item.Attributes["id"].Name; ReferenceInformation ob = ReferenceInformation(); IDManager.SetID(referenceInformationIDRef, ob); } else if (item.Attributes.ToString() == "href") { referenceInformationIDRef = item.Attributes["href"].Name; } else { referenceInformation = new ReferenceInformation(item); } } } XmlNodeList indexReferenceInformationNodeList = xmlNode.SelectNodes("indexReferenceInformation"); if (indexReferenceInformationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in indexReferenceInformationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { indexReferenceInformationIDRef = item.Attributes["id"].Name; IndexReferenceInformation ob = IndexReferenceInformation(); IDManager.SetID(indexReferenceInformationIDRef, ob); } else if (item.Attributes.ToString() == "href") { indexReferenceInformationIDRef = item.Attributes["href"].Name; } else { indexReferenceInformation = new IndexReferenceInformation(item); } } } XmlNodeList basketReferenceInformationNodeList = xmlNode.SelectNodes("basketReferenceInformation"); if (basketReferenceInformationNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in basketReferenceInformationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { basketReferenceInformationIDRef = item.Attributes["id"].Name; BasketReferenceInformation ob = BasketReferenceInformation(); IDManager.SetID(basketReferenceInformationIDRef, ob); } else if (item.Attributes.ToString() == "href") { basketReferenceInformationIDRef = item.Attributes["href"].Name; } else { basketReferenceInformation = new BasketReferenceInformation(item); } } } XmlNodeList additionalTermNodeList = xmlNode.SelectNodes("additionalTerm"); foreach (XmlNode item in additionalTermNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { additionalTermIDRef = item.Attributes["id"].Name; List<AdditionalTerm> ob = new List<AdditionalTerm>(); ob.Add(new AdditionalTerm(item)); IDManager.SetID(additionalTermIDRef, ob); } else if (item.Attributes.ToString() == "href") { additionalTermIDRef = item.Attributes["href"].Name; } else { additionalTerm.Add(new AdditionalTerm(item)); } } } XmlNodeList substitutionNodeList = xmlNode.SelectNodes("substitution"); if (substitutionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in substitutionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { substitutionIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(substitutionIDRef, ob); } else if (item.Attributes.ToString() == "href") { substitutionIDRef = item.Attributes["href"].Name; } else { substitution = new XsdTypeBoolean(item); } } } XmlNodeList modifiedEquityDeliveryNodeList = xmlNode.SelectNodes("modifiedEquityDelivery"); if (modifiedEquityDeliveryNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in modifiedEquityDeliveryNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { modifiedEquityDeliveryIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(modifiedEquityDeliveryIDRef, ob); } else if (item.Attributes.ToString() == "href") { modifiedEquityDeliveryIDRef = item.Attributes["href"].Name; } else { modifiedEquityDelivery = new XsdTypeBoolean(item); } } } }
public GenericProduct(XmlNode xmlNode) : base(xmlNode) { XmlNodeList multiLegNodeList = xmlNode.SelectNodes("multiLeg"); if (multiLegNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in multiLegNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { multiLegIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(multiLegIDRef, ob); } else if (item.Attributes.ToString() == "href") { multiLegIDRef = item.Attributes["href"].Name; } else { multiLeg = new XsdTypeBoolean(item); } } } XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference"); foreach (XmlNode item in counterpartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { counterpartyReferenceIDRef = item.Attributes["id"].Name; List <PartyReference> ob = new List <PartyReference>(); ob.Add(new PartyReference(item)); IDManager.SetID(counterpartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { counterpartyReferenceIDRef = item.Attributes["href"].Name; } else { counterpartyReference.Add(new PartyReference(item)); } } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; SimplePayment ob = SimplePayment(); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium = new SimplePayment(item); } } } XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate"); if (effectiveDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in effectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { effectiveDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(effectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { effectiveDateIDRef = item.Attributes["href"].Name; } else { effectiveDate = new AdjustableDate2(item); } } } XmlNodeList expirationDateNodeList = xmlNode.SelectNodes("expirationDate"); if (expirationDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in expirationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { expirationDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(expirationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { expirationDateIDRef = item.Attributes["href"].Name; } else { expirationDate = new AdjustableDate2(item); } } } XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate"); if (terminationDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in terminationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { terminationDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(terminationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { terminationDateIDRef = item.Attributes["href"].Name; } else { terminationDate = new AdjustableDate2(item); } } } XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer"); foreach (XmlNode item in underlyerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyerIDRef = item.Attributes["id"].Name; List <TradeUnderlyer2> ob = new List <TradeUnderlyer2>(); ob.Add(new TradeUnderlyer2(item)); IDManager.SetID(underlyerIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyerIDRef = item.Attributes["href"].Name; } else { underlyer.Add(new TradeUnderlyer2(item)); } } } XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional"); foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalIDRef = item.Attributes["id"].Name; List <CashflowNotional> ob = new List <CashflowNotional>(); ob.Add(new CashflowNotional(item)); IDManager.SetID(notionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalIDRef = item.Attributes["href"].Name; } else { notional.Add(new CashflowNotional(item)); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; OptionType ob = OptionType(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new OptionType(item); } } } XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency"); foreach (XmlNode item in settlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementCurrencyIDRef = item.Attributes["id"].Name; List <IdentifiedCurrency> ob = new List <IdentifiedCurrency>(); ob.Add(new IdentifiedCurrency(item)); IDManager.SetID(settlementCurrencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementCurrencyIDRef = item.Attributes["href"].Name; } else { settlementCurrency.Add(new IdentifiedCurrency(item)); } } } XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction"); foreach (XmlNode item in dayCountFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { dayCountFractionIDRef = item.Attributes["id"].Name; List <DayCountFraction> ob = new List <DayCountFraction>(); ob.Add(new DayCountFraction(item)); IDManager.SetID(dayCountFractionIDRef, ob); } else if (item.Attributes.ToString() == "href") { dayCountFractionIDRef = item.Attributes["href"].Name; } else { dayCountFraction.Add(new DayCountFraction(item)); } } } }
public GenericProduct(XmlNode xmlNode) : base(xmlNode) { XmlNodeList multiLegNodeList = xmlNode.SelectNodes("multiLeg"); if (multiLegNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in multiLegNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { multiLegIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(multiLegIDRef, ob); } else if (item.Attributes.ToString() == "href") { multiLegIDRef = item.Attributes["href"].Name; } else { multiLeg = new XsdTypeBoolean(item); } } } XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference"); if (buyerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(buyerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerPartyReferenceIDRef = item.Attributes["href"].Name; } else { buyerPartyReference = new PartyReference(item); } } } XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference"); if (buyerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(buyerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerAccountReferenceIDRef = item.Attributes["href"].Name; } else { buyerAccountReference = new AccountReference(item); } } } XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference"); if (sellerPartyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerPartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerPartyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(sellerPartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerPartyReferenceIDRef = item.Attributes["href"].Name; } else { sellerPartyReference = new PartyReference(item); } } } XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference"); if (sellerAccountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerAccountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerAccountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(sellerAccountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerAccountReferenceIDRef = item.Attributes["href"].Name; } else { sellerAccountReference = new AccountReference(item); } } } XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference"); foreach (XmlNode item in counterpartyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { counterpartyReferenceIDRef = item.Attributes["id"].Name; List<PartyReference> ob = new List<PartyReference>(); ob.Add(new PartyReference(item)); IDManager.SetID(counterpartyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { counterpartyReferenceIDRef = item.Attributes["href"].Name; } else { counterpartyReference.Add(new PartyReference(item)); } } } XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium"); if (premiumNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in premiumNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { premiumIDRef = item.Attributes["id"].Name; SimplePayment ob = SimplePayment(); IDManager.SetID(premiumIDRef, ob); } else if (item.Attributes.ToString() == "href") { premiumIDRef = item.Attributes["href"].Name; } else { premium = new SimplePayment(item); } } } XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate"); if (effectiveDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in effectiveDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { effectiveDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(effectiveDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { effectiveDateIDRef = item.Attributes["href"].Name; } else { effectiveDate = new AdjustableDate2(item); } } } XmlNodeList expirationDateNodeList = xmlNode.SelectNodes("expirationDate"); if (expirationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in expirationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { expirationDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(expirationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { expirationDateIDRef = item.Attributes["href"].Name; } else { expirationDate = new AdjustableDate2(item); } } } XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate"); if (terminationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in terminationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { terminationDateIDRef = item.Attributes["id"].Name; AdjustableDate2 ob = AdjustableDate2(); IDManager.SetID(terminationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { terminationDateIDRef = item.Attributes["href"].Name; } else { terminationDate = new AdjustableDate2(item); } } } XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer"); foreach (XmlNode item in underlyerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { underlyerIDRef = item.Attributes["id"].Name; List<TradeUnderlyer2> ob = new List<TradeUnderlyer2>(); ob.Add(new TradeUnderlyer2(item)); IDManager.SetID(underlyerIDRef, ob); } else if (item.Attributes.ToString() == "href") { underlyerIDRef = item.Attributes["href"].Name; } else { underlyer.Add(new TradeUnderlyer2(item)); } } } XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional"); foreach (XmlNode item in notionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { notionalIDRef = item.Attributes["id"].Name; List<CashflowNotional> ob = new List<CashflowNotional>(); ob.Add(new CashflowNotional(item)); IDManager.SetID(notionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { notionalIDRef = item.Attributes["href"].Name; } else { notional.Add(new CashflowNotional(item)); } } } XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType"); if (optionTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in optionTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { optionTypeIDRef = item.Attributes["id"].Name; OptionType ob = OptionType(); IDManager.SetID(optionTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { optionTypeIDRef = item.Attributes["href"].Name; } else { optionType = new OptionType(item); } } } XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency"); foreach (XmlNode item in settlementCurrencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementCurrencyIDRef = item.Attributes["id"].Name; List<IdentifiedCurrency> ob = new List<IdentifiedCurrency>(); ob.Add(new IdentifiedCurrency(item)); IDManager.SetID(settlementCurrencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementCurrencyIDRef = item.Attributes["href"].Name; } else { settlementCurrency.Add(new IdentifiedCurrency(item)); } } } XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction"); foreach (XmlNode item in dayCountFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { dayCountFractionIDRef = item.Attributes["id"].Name; List<DayCountFraction> ob = new List<DayCountFraction>(); ob.Add(new DayCountFraction(item)); IDManager.SetID(dayCountFractionIDRef, ob); } else if (item.Attributes.ToString() == "href") { dayCountFractionIDRef = item.Attributes["href"].Name; } else { dayCountFraction.Add(new DayCountFraction(item)); } } } }