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));
             }
         }
     }
     
 
 }
Beispiel #2
0
        public OptionExercise(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList optionSellerNodeList = xmlNode.SelectNodes("optionSeller");

            if (optionSellerNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in optionSellerNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionSellerIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(optionSellerIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionSellerIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionSeller = new PartyReference(item);
                    }
                }
            }


            XmlNodeList optionBuyerNodeList = xmlNode.SelectNodes("optionBuyer");

            if (optionBuyerNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in optionBuyerNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionBuyerIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(optionBuyerIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionBuyerIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionBuyer = new PartyReference(item);
                    }
                }
            }


            XmlNodeList originalTradeNodeList = xmlNode.SelectNodes("originalTrade");

            if (originalTradeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in originalTradeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        originalTradeIDRef = item.Attributes["id"].Name;
                        Trade ob = Trade();
                        IDManager.SetID(originalTradeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        originalTradeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        originalTrade = new Trade(item);
                    }
                }
            }


            XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");

            foreach (XmlNode item in tradeIdentifierNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        tradeIdentifierIDRef = item.Attributes["id"].Name;
                        List <PartyTradeIdentifier> ob = new List <PartyTradeIdentifier>();
                        ob.Add(new PartyTradeIdentifier(item));
                        IDManager.SetID(tradeIdentifierIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        tradeIdentifierIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tradeIdentifier.Add(new PartyTradeIdentifier(item));
                    }
                }
            }


            XmlNodeList exerciseDateNodeList = xmlNode.SelectNodes("exerciseDate");

            if (exerciseDateNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(exerciseDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList exerciseTimeNodeList = xmlNode.SelectNodes("exerciseTime");

            if (exerciseTimeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseTimeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseTimeIDRef = item.Attributes["id"].Name;
                        XsdTypeTime ob = XsdTypeTime();
                        IDManager.SetID(exerciseTimeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseTimeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseTime = new XsdTypeTime(item);
                    }
                }
            }


            XmlNodeList expiryNodeList = xmlNode.SelectNodes("expiry");

            if (expiryNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in expiryNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        expiryIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(expiryIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        expiryIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        expiry = new XsdTypeBoolean(item);
                    }
                }
            }


            XmlNodeList fullExerciseNodeList = xmlNode.SelectNodes("fullExercise");

            if (fullExerciseNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in fullExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fullExerciseIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(fullExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fullExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fullExercise = new XsdTypeBoolean(item);
                    }
                }
            }


            XmlNodeList exerciseInNotionalAmountNodeList = xmlNode.SelectNodes("exerciseInNotionalAmount");

            if (exerciseInNotionalAmountNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseInNotionalAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseInNotionalAmountIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(exerciseInNotionalAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseInNotionalAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseInNotionalAmount = new Money(item);
                    }
                }
            }


            XmlNodeList outstandingNotionalAmountNodeList = xmlNode.SelectNodes("outstandingNotionalAmount");

            if (outstandingNotionalAmountNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in outstandingNotionalAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        outstandingNotionalAmountIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(outstandingNotionalAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        outstandingNotionalAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        outstandingNotionalAmount = new Money(item);
                    }
                }
            }


            XmlNodeList exerciseInNumberOfOptionsNodeList = xmlNode.SelectNodes("exerciseInNumberOfOptions");

            if (exerciseInNumberOfOptionsNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseInNumberOfOptionsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseInNumberOfOptionsIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(exerciseInNumberOfOptionsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseInNumberOfOptionsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseInNumberOfOptions = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList outstandingNumberOfOptionsNodeList = xmlNode.SelectNodes("outstandingNumberOfOptions");

            if (outstandingNumberOfOptionsNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in outstandingNumberOfOptionsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        outstandingNumberOfOptionsIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(outstandingNumberOfOptionsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        outstandingNumberOfOptionsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        outstandingNumberOfOptions = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList exerciseInNumberOfUnitsNodeList = xmlNode.SelectNodes("exerciseInNumberOfUnits");

            if (exerciseInNumberOfUnitsNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseInNumberOfUnitsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseInNumberOfUnitsIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(exerciseInNumberOfUnitsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseInNumberOfUnitsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseInNumberOfUnits = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList outstandingNumberOfUnitsNodeList = xmlNode.SelectNodes("outstandingNumberOfUnits");

            if (outstandingNumberOfUnitsNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in outstandingNumberOfUnitsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        outstandingNumberOfUnitsIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(outstandingNumberOfUnitsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        outstandingNumberOfUnitsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        outstandingNumberOfUnits = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList settlementTypeNodeList = xmlNode.SelectNodes("settlementType");

            if (settlementTypeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in settlementTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementTypeIDRef = item.Attributes["id"].Name;
                        SettlementTypeEnum ob = SettlementTypeEnum();
                        IDManager.SetID(settlementTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementType = new SettlementTypeEnum(item);
                    }
                }
            }


            XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");

            if (cashSettlementNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in cashSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashSettlementIDRef = item.Attributes["id"].Name;
                        SimplePayment ob = SimplePayment();
                        IDManager.SetID(cashSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashSettlement = new SimplePayment(item);
                    }
                }
            }


            XmlNodeList physicalSettlementNodeList = xmlNode.SelectNodes("physicalSettlement");

            if (physicalSettlementNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in physicalSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalSettlementIDRef = item.Attributes["id"].Name;
                        PhysicalSettlement ob = PhysicalSettlement();
                        IDManager.SetID(physicalSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalSettlement = new PhysicalSettlement(item);
                    }
                }
            }


            XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");

            if (paymentNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in paymentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentIDRef = item.Attributes["id"].Name;
                        NonNegativePayment ob = NonNegativePayment();
                        IDManager.SetID(paymentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payment = new NonNegativePayment(item);
                    }
                }
            }
        }
Beispiel #3
0
        public CancelableProvision(XmlNode xmlNode)
        {
            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 exerciseNodeList = xmlNode.SelectNodes("exercise");

            if (exerciseNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseIDRef = item.Attributes["id"].Name;
                        Exercise ob = Exercise();
                        IDManager.SetID(exerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exercise = new Exercise(item);
                    }
                }
            }


            XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");

            if (americanExerciseNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in americanExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        americanExerciseIDRef = item.Attributes["id"].Name;
                        AmericanExercise ob = AmericanExercise();
                        IDManager.SetID(americanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        americanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        americanExercise = new AmericanExercise(item);
                    }
                }
            }


            XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise");

            if (bermudaExerciseNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in bermudaExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        bermudaExerciseIDRef = item.Attributes["id"].Name;
                        BermudaExercise ob = BermudaExercise();
                        IDManager.SetID(bermudaExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        bermudaExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        bermudaExercise = new BermudaExercise(item);
                    }
                }
            }


            XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");

            if (europeanExerciseNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in europeanExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        europeanExerciseIDRef = item.Attributes["id"].Name;
                        EuropeanExercise ob = EuropeanExercise();
                        IDManager.SetID(europeanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        europeanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        europeanExercise = new EuropeanExercise(item);
                    }
                }
            }


            XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice");

            if (exerciseNoticeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in exerciseNoticeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseNoticeIDRef = item.Attributes["id"].Name;
                        ExerciseNotice ob = ExerciseNotice();
                        IDManager.SetID(exerciseNoticeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseNoticeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseNotice = new ExerciseNotice(item);
                    }
                }
            }


            XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation");

            if (followUpConfirmationNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in followUpConfirmationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        followUpConfirmationIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(followUpConfirmationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        followUpConfirmationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        followUpConfirmation = new XsdTypeBoolean(item);
                    }
                }
            }


            XmlNodeList cancelableProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("cancelableProvisionAdjustedDates");

            if (cancelableProvisionAdjustedDatesNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in cancelableProvisionAdjustedDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cancelableProvisionAdjustedDatesIDRef = item.Attributes["id"].Name;
                        CancelableProvisionAdjustedDates ob = CancelableProvisionAdjustedDates();
                        IDManager.SetID(cancelableProvisionAdjustedDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cancelableProvisionAdjustedDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cancelableProvisionAdjustedDates = new CancelableProvisionAdjustedDates(item);
                    }
                }
            }


            XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment");

            foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["id"].Name;
                        List <FinalCalculationPeriodDateAdjustment> ob = new List <FinalCalculationPeriodDateAdjustment>();
                        ob.Add(new FinalCalculationPeriodDateAdjustment(item));
                        IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        finalCalculationPeriodDateAdjustment.Add(new FinalCalculationPeriodDateAdjustment(item));
                    }
                }
            }


            XmlNodeList initialFeeNodeList = xmlNode.SelectNodes("initialFee");

            if (initialFeeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in initialFeeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        initialFeeIDRef = item.Attributes["id"].Name;
                        SimplePayment ob = SimplePayment();
                        IDManager.SetID(initialFeeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        initialFeeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        initialFee = new SimplePayment(item);
                    }
                }
            }
        }
 public CancelableProvision(XmlNode xmlNode)
 {
     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 exerciseNodeList = xmlNode.SelectNodes("exercise");
     if (exerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseIDRef = item.Attributes["id"].Name;
                 Exercise ob = Exercise();
                 IDManager.SetID(exerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exercise = new Exercise(item);
             }
         }
     }
     
 
     XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");
     if (americanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in americanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 americanExerciseIDRef = item.Attributes["id"].Name;
                 AmericanExercise ob = AmericanExercise();
                 IDManager.SetID(americanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 americanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 americanExercise = new AmericanExercise(item);
             }
         }
     }
     
 
     XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise");
     if (bermudaExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in bermudaExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 bermudaExerciseIDRef = item.Attributes["id"].Name;
                 BermudaExercise ob = BermudaExercise();
                 IDManager.SetID(bermudaExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 bermudaExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 bermudaExercise = new BermudaExercise(item);
             }
         }
     }
     
 
     XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");
     if (europeanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in europeanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef = item.Attributes["id"].Name;
                 EuropeanExercise ob = EuropeanExercise();
                 IDManager.SetID(europeanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 europeanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 europeanExercise = new EuropeanExercise(item);
             }
         }
     }
     
 
     XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice");
     if (exerciseNoticeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseNoticeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseNoticeIDRef = item.Attributes["id"].Name;
                 ExerciseNotice ob = ExerciseNotice();
                 IDManager.SetID(exerciseNoticeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseNoticeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseNotice = new ExerciseNotice(item);
             }
         }
     }
     
 
     XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation");
     if (followUpConfirmationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in followUpConfirmationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 followUpConfirmationIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(followUpConfirmationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 followUpConfirmationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 followUpConfirmation = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList cancelableProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("cancelableProvisionAdjustedDates");
     if (cancelableProvisionAdjustedDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cancelableProvisionAdjustedDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cancelableProvisionAdjustedDatesIDRef = item.Attributes["id"].Name;
                 CancelableProvisionAdjustedDates ob = CancelableProvisionAdjustedDates();
                 IDManager.SetID(cancelableProvisionAdjustedDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cancelableProvisionAdjustedDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cancelableProvisionAdjustedDates = new CancelableProvisionAdjustedDates(item);
             }
         }
     }
     
 
     XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment");
     
     foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["id"].Name;
                 List<FinalCalculationPeriodDateAdjustment> ob = new List<FinalCalculationPeriodDateAdjustment>();
                 ob.Add(new FinalCalculationPeriodDateAdjustment(item));
                 IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
             finalCalculationPeriodDateAdjustment.Add(new FinalCalculationPeriodDateAdjustment(item));
             }
         }
     }
     
 
     XmlNodeList initialFeeNodeList = xmlNode.SelectNodes("initialFee");
     if (initialFeeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in initialFeeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 initialFeeIDRef = item.Attributes["id"].Name;
                 SimplePayment ob = SimplePayment();
                 IDManager.SetID(initialFeeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 initialFeeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 initialFee = new SimplePayment(item);
             }
         }
     }
     
 
 }
 public CancelableProvision(XmlNode xmlNode)
 {
     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 exerciseNode = xmlNode.SelectSingleNode("exercise");
     
     if (exerciseNode != null)
     {
         if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) 
         {
             if (exerciseNode.Attributes["id"] != null) 
             {
                 exerciseIDRef_ = exerciseNode.Attributes["id"].Value;
                 Exercise ob = new Exercise(exerciseNode);
                 IDManager.SetID(exerciseIDRef_, ob);
             }
             else if (exerciseNode.Attributes["href"] != null)
             {
                 exerciseIDRef_ = exerciseNode.Attributes["href"].Value;
             }
             else
             {
                 exercise_ = new Exercise(exerciseNode);
             }
         }
         else
         {
             exercise_ = new Exercise(exerciseNode);
         }
     }
     
 
     XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");
     
     if (americanExerciseNode != null)
     {
         if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) 
         {
             if (americanExerciseNode.Attributes["id"] != null) 
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                 AmericanExercise ob = new AmericanExercise(americanExerciseNode);
                 IDManager.SetID(americanExerciseIDRef_, ob);
             }
             else if (americanExerciseNode.Attributes["href"] != null)
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 americanExercise_ = new AmericanExercise(americanExerciseNode);
             }
         }
         else
         {
             americanExercise_ = new AmericanExercise(americanExerciseNode);
         }
     }
     
 
     XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise");
     
     if (bermudaExerciseNode != null)
     {
         if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) 
         {
             if (bermudaExerciseNode.Attributes["id"] != null) 
             {
                 bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value;
                 BermudaExercise ob = new BermudaExercise(bermudaExerciseNode);
                 IDManager.SetID(bermudaExerciseIDRef_, ob);
             }
             else if (bermudaExerciseNode.Attributes["href"] != null)
             {
                 bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
             }
         }
         else
         {
             bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
         }
     }
     
 
     XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");
     
     if (europeanExerciseNode != null)
     {
         if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) 
         {
             if (europeanExerciseNode.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                 EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode);
                 IDManager.SetID(europeanExerciseIDRef_, ob);
             }
             else if (europeanExerciseNode.Attributes["href"] != null)
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
             }
         }
         else
         {
             europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
         }
     }
     
 
     XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice");
     
     if (exerciseNoticeNode != null)
     {
         if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null) 
         {
             if (exerciseNoticeNode.Attributes["id"] != null) 
             {
                 exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value;
                 ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode);
                 IDManager.SetID(exerciseNoticeIDRef_, ob);
             }
             else if (exerciseNoticeNode.Attributes["href"] != null)
             {
                 exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
             }
         }
         else
         {
             exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
         }
     }
     
 
     XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation");
     
     if (followUpConfirmationNode != null)
     {
         if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) 
         {
             if (followUpConfirmationNode.Attributes["id"] != null) 
             {
                 followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode);
                 IDManager.SetID(followUpConfirmationIDRef_, ob);
             }
             else if (followUpConfirmationNode.Attributes["href"] != null)
             {
                 followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value;
             }
             else
             {
                 followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode);
             }
         }
         else
         {
             followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode);
         }
     }
     
 
     XmlNode cancelableProvisionAdjustedDatesNode = xmlNode.SelectSingleNode("cancelableProvisionAdjustedDates");
     
     if (cancelableProvisionAdjustedDatesNode != null)
     {
         if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null || cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) 
         {
             if (cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) 
             {
                 cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["id"].Value;
                 CancelableProvisionAdjustedDates ob = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
                 IDManager.SetID(cancelableProvisionAdjustedDatesIDRef_, ob);
             }
             else if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null)
             {
                 cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["href"].Value;
             }
             else
             {
                 cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
             }
         }
         else
         {
             cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
         }
     }
     
 
     XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment");
     
     if (finalCalculationPeriodDateAdjustmentNodeList != null)
     {
         this.finalCalculationPeriodDateAdjustment_ = new List<FinalCalculationPeriodDateAdjustment>();
         foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["id"].Value;
                     finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                     IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef_, finalCalculationPeriodDateAdjustment_[finalCalculationPeriodDateAdjustment_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                 }
             }
             else
             {
                 finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
             }
         }
     }
     
 
     XmlNode initialFeeNode = xmlNode.SelectSingleNode("initialFee");
     
     if (initialFeeNode != null)
     {
         if (initialFeeNode.Attributes["href"] != null || initialFeeNode.Attributes["id"] != null) 
         {
             if (initialFeeNode.Attributes["id"] != null) 
             {
                 initialFeeIDRef_ = initialFeeNode.Attributes["id"].Value;
                 SimplePayment ob = new SimplePayment(initialFeeNode);
                 IDManager.SetID(initialFeeIDRef_, ob);
             }
             else if (initialFeeNode.Attributes["href"] != null)
             {
                 initialFeeIDRef_ = initialFeeNode.Attributes["href"].Value;
             }
             else
             {
                 initialFee_ = new SimplePayment(initialFeeNode);
             }
         }
         else
         {
             initialFee_ = new SimplePayment(initialFeeNode);
         }
     }
     
 
 }
        public OptionExercise(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode optionSellerNode = xmlNode.SelectSingleNode("optionSeller");

            if (optionSellerNode != null)
            {
                if (optionSellerNode.Attributes["href"] != null || optionSellerNode.Attributes["id"] != null)
                {
                    if (optionSellerNode.Attributes["id"] != null)
                    {
                        optionSellerIDRef_ = optionSellerNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(optionSellerNode);
                        IDManager.SetID(optionSellerIDRef_, ob);
                    }
                    else if (optionSellerNode.Attributes["href"] != null)
                    {
                        optionSellerIDRef_ = optionSellerNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionSeller_ = new PartyReference(optionSellerNode);
                    }
                }
                else
                {
                    optionSeller_ = new PartyReference(optionSellerNode);
                }
            }


            XmlNode optionBuyerNode = xmlNode.SelectSingleNode("optionBuyer");

            if (optionBuyerNode != null)
            {
                if (optionBuyerNode.Attributes["href"] != null || optionBuyerNode.Attributes["id"] != null)
                {
                    if (optionBuyerNode.Attributes["id"] != null)
                    {
                        optionBuyerIDRef_ = optionBuyerNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(optionBuyerNode);
                        IDManager.SetID(optionBuyerIDRef_, ob);
                    }
                    else if (optionBuyerNode.Attributes["href"] != null)
                    {
                        optionBuyerIDRef_ = optionBuyerNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionBuyer_ = new PartyReference(optionBuyerNode);
                    }
                }
                else
                {
                    optionBuyer_ = new PartyReference(optionBuyerNode);
                }
            }


            XmlNode originalTradeNode = xmlNode.SelectSingleNode("originalTrade");

            if (originalTradeNode != null)
            {
                if (originalTradeNode.Attributes["href"] != null || originalTradeNode.Attributes["id"] != null)
                {
                    if (originalTradeNode.Attributes["id"] != null)
                    {
                        originalTradeIDRef_ = originalTradeNode.Attributes["id"].Value;
                        Trade ob = new Trade(originalTradeNode);
                        IDManager.SetID(originalTradeIDRef_, ob);
                    }
                    else if (originalTradeNode.Attributes["href"] != null)
                    {
                        originalTradeIDRef_ = originalTradeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        originalTrade_ = new Trade(originalTradeNode);
                    }
                }
                else
                {
                    originalTrade_ = new Trade(originalTradeNode);
                }
            }


            XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");

            if (tradeIdentifierNodeList != null)
            {
                this.tradeIdentifier_ = new List <PartyTradeIdentifier>();
                foreach (XmlNode item in tradeIdentifierNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            tradeIdentifierIDRef_ = item.Attributes["id"].Value;
                            tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                            IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            tradeIdentifierIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                        }
                    }
                    else
                    {
                        tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                    }
                }
            }


            XmlNode exerciseDateNode = xmlNode.SelectSingleNode("exerciseDate");

            if (exerciseDateNode != null)
            {
                if (exerciseDateNode.Attributes["href"] != null || exerciseDateNode.Attributes["id"] != null)
                {
                    if (exerciseDateNode.Attributes["id"] != null)
                    {
                        exerciseDateIDRef_ = exerciseDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(exerciseDateNode);
                        IDManager.SetID(exerciseDateIDRef_, ob);
                    }
                    else if (exerciseDateNode.Attributes["href"] != null)
                    {
                        exerciseDateIDRef_ = exerciseDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseDate_ = new XsdTypeDate(exerciseDateNode);
                    }
                }
                else
                {
                    exerciseDate_ = new XsdTypeDate(exerciseDateNode);
                }
            }


            XmlNode exerciseTimeNode = xmlNode.SelectSingleNode("exerciseTime");

            if (exerciseTimeNode != null)
            {
                if (exerciseTimeNode.Attributes["href"] != null || exerciseTimeNode.Attributes["id"] != null)
                {
                    if (exerciseTimeNode.Attributes["id"] != null)
                    {
                        exerciseTimeIDRef_ = exerciseTimeNode.Attributes["id"].Value;
                        XsdTypeTime ob = new XsdTypeTime(exerciseTimeNode);
                        IDManager.SetID(exerciseTimeIDRef_, ob);
                    }
                    else if (exerciseTimeNode.Attributes["href"] != null)
                    {
                        exerciseTimeIDRef_ = exerciseTimeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
                    }
                }
                else
                {
                    exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
                }
            }


            XmlNode expiryNode = xmlNode.SelectSingleNode("expiry");

            if (expiryNode != null)
            {
                if (expiryNode.Attributes["href"] != null || expiryNode.Attributes["id"] != null)
                {
                    if (expiryNode.Attributes["id"] != null)
                    {
                        expiryIDRef_ = expiryNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(expiryNode);
                        IDManager.SetID(expiryIDRef_, ob);
                    }
                    else if (expiryNode.Attributes["href"] != null)
                    {
                        expiryIDRef_ = expiryNode.Attributes["href"].Value;
                    }
                    else
                    {
                        expiry_ = new XsdTypeBoolean(expiryNode);
                    }
                }
                else
                {
                    expiry_ = new XsdTypeBoolean(expiryNode);
                }
            }


            XmlNode fullExerciseNode = xmlNode.SelectSingleNode("fullExercise");

            if (fullExerciseNode != null)
            {
                if (fullExerciseNode.Attributes["href"] != null || fullExerciseNode.Attributes["id"] != null)
                {
                    if (fullExerciseNode.Attributes["id"] != null)
                    {
                        fullExerciseIDRef_ = fullExerciseNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(fullExerciseNode);
                        IDManager.SetID(fullExerciseIDRef_, ob);
                    }
                    else if (fullExerciseNode.Attributes["href"] != null)
                    {
                        fullExerciseIDRef_ = fullExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fullExercise_ = new XsdTypeBoolean(fullExerciseNode);
                    }
                }
                else
                {
                    fullExercise_ = new XsdTypeBoolean(fullExerciseNode);
                }
            }


            XmlNode exerciseInNotionalAmountNode = xmlNode.SelectSingleNode("exerciseInNotionalAmount");

            if (exerciseInNotionalAmountNode != null)
            {
                if (exerciseInNotionalAmountNode.Attributes["href"] != null || exerciseInNotionalAmountNode.Attributes["id"] != null)
                {
                    if (exerciseInNotionalAmountNode.Attributes["id"] != null)
                    {
                        exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["id"].Value;
                        Money ob = new Money(exerciseInNotionalAmountNode);
                        IDManager.SetID(exerciseInNotionalAmountIDRef_, ob);
                    }
                    else if (exerciseInNotionalAmountNode.Attributes["href"] != null)
                    {
                        exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode);
                    }
                }
                else
                {
                    exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode);
                }
            }


            XmlNode outstandingNotionalAmountNode = xmlNode.SelectSingleNode("outstandingNotionalAmount");

            if (outstandingNotionalAmountNode != null)
            {
                if (outstandingNotionalAmountNode.Attributes["href"] != null || outstandingNotionalAmountNode.Attributes["id"] != null)
                {
                    if (outstandingNotionalAmountNode.Attributes["id"] != null)
                    {
                        outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["id"].Value;
                        Money ob = new Money(outstandingNotionalAmountNode);
                        IDManager.SetID(outstandingNotionalAmountIDRef_, ob);
                    }
                    else if (outstandingNotionalAmountNode.Attributes["href"] != null)
                    {
                        outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode);
                    }
                }
                else
                {
                    outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode);
                }
            }


            XmlNode exerciseInNumberOfOptionsNode = xmlNode.SelectSingleNode("exerciseInNumberOfOptions");

            if (exerciseInNumberOfOptionsNode != null)
            {
                if (exerciseInNumberOfOptionsNode.Attributes["href"] != null || exerciseInNumberOfOptionsNode.Attributes["id"] != null)
                {
                    if (exerciseInNumberOfOptionsNode.Attributes["id"] != null)
                    {
                        exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
                        IDManager.SetID(exerciseInNumberOfOptionsIDRef_, ob);
                    }
                    else if (exerciseInNumberOfOptionsNode.Attributes["href"] != null)
                    {
                        exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
                    }
                }
                else
                {
                    exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
                }
            }


            XmlNode outstandingNumberOfOptionsNode = xmlNode.SelectSingleNode("outstandingNumberOfOptions");

            if (outstandingNumberOfOptionsNode != null)
            {
                if (outstandingNumberOfOptionsNode.Attributes["href"] != null || outstandingNumberOfOptionsNode.Attributes["id"] != null)
                {
                    if (outstandingNumberOfOptionsNode.Attributes["id"] != null)
                    {
                        outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
                        IDManager.SetID(outstandingNumberOfOptionsIDRef_, ob);
                    }
                    else if (outstandingNumberOfOptionsNode.Attributes["href"] != null)
                    {
                        outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
                    }
                }
                else
                {
                    outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
                }
            }


            XmlNode exerciseInNumberOfUnitsNode = xmlNode.SelectSingleNode("exerciseInNumberOfUnits");

            if (exerciseInNumberOfUnitsNode != null)
            {
                if (exerciseInNumberOfUnitsNode.Attributes["href"] != null || exerciseInNumberOfUnitsNode.Attributes["id"] != null)
                {
                    if (exerciseInNumberOfUnitsNode.Attributes["id"] != null)
                    {
                        exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
                        IDManager.SetID(exerciseInNumberOfUnitsIDRef_, ob);
                    }
                    else if (exerciseInNumberOfUnitsNode.Attributes["href"] != null)
                    {
                        exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
                    }
                }
                else
                {
                    exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
                }
            }


            XmlNode outstandingNumberOfUnitsNode = xmlNode.SelectSingleNode("outstandingNumberOfUnits");

            if (outstandingNumberOfUnitsNode != null)
            {
                if (outstandingNumberOfUnitsNode.Attributes["href"] != null || outstandingNumberOfUnitsNode.Attributes["id"] != null)
                {
                    if (outstandingNumberOfUnitsNode.Attributes["id"] != null)
                    {
                        outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
                        IDManager.SetID(outstandingNumberOfUnitsIDRef_, ob);
                    }
                    else if (outstandingNumberOfUnitsNode.Attributes["href"] != null)
                    {
                        outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
                    }
                }
                else
                {
                    outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
                }
            }


            XmlNode settlementTypeNode = xmlNode.SelectSingleNode("settlementType");

            if (settlementTypeNode != null)
            {
                if (settlementTypeNode.Attributes["href"] != null || settlementTypeNode.Attributes["id"] != null)
                {
                    if (settlementTypeNode.Attributes["id"] != null)
                    {
                        settlementTypeIDRef_ = settlementTypeNode.Attributes["id"].Value;
                        SettlementTypeEnum ob = new SettlementTypeEnum(settlementTypeNode);
                        IDManager.SetID(settlementTypeIDRef_, ob);
                    }
                    else if (settlementTypeNode.Attributes["href"] != null)
                    {
                        settlementTypeIDRef_ = settlementTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementType_ = new SettlementTypeEnum(settlementTypeNode);
                    }
                }
                else
                {
                    settlementType_ = new SettlementTypeEnum(settlementTypeNode);
                }
            }


            XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");

            if (cashSettlementNode != null)
            {
                if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null)
                {
                    if (cashSettlementNode.Attributes["id"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                        SimplePayment ob = new SimplePayment(cashSettlementNode);
                        IDManager.SetID(cashSettlementIDRef_, ob);
                    }
                    else if (cashSettlementNode.Attributes["href"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashSettlement_ = new SimplePayment(cashSettlementNode);
                    }
                }
                else
                {
                    cashSettlement_ = new SimplePayment(cashSettlementNode);
                }
            }


            XmlNode physicalSettlementNode = xmlNode.SelectSingleNode("physicalSettlement");

            if (physicalSettlementNode != null)
            {
                if (physicalSettlementNode.Attributes["href"] != null || physicalSettlementNode.Attributes["id"] != null)
                {
                    if (physicalSettlementNode.Attributes["id"] != null)
                    {
                        physicalSettlementIDRef_ = physicalSettlementNode.Attributes["id"].Value;
                        PhysicalSettlement ob = new PhysicalSettlement(physicalSettlementNode);
                        IDManager.SetID(physicalSettlementIDRef_, ob);
                    }
                    else if (physicalSettlementNode.Attributes["href"] != null)
                    {
                        physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
                    }
                }
                else
                {
                    physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
                }
            }


            XmlNode paymentNode = xmlNode.SelectSingleNode("payment");

            if (paymentNode != null)
            {
                if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null)
                {
                    if (paymentNode.Attributes["id"] != null)
                    {
                        paymentIDRef_ = paymentNode.Attributes["id"].Value;
                        NonNegativePayment ob = new NonNegativePayment(paymentNode);
                        IDManager.SetID(paymentIDRef_, ob);
                    }
                    else if (paymentNode.Attributes["href"] != null)
                    {
                        paymentIDRef_ = paymentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payment_ = new NonNegativePayment(paymentNode);
                    }
                }
                else
                {
                    payment_ = new NonNegativePayment(paymentNode);
                }
            }
        }
Beispiel #7
0
        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 OptionExercise(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode optionSellerNode = xmlNode.SelectSingleNode("optionSeller");
     
     if (optionSellerNode != null)
     {
         if (optionSellerNode.Attributes["href"] != null || optionSellerNode.Attributes["id"] != null) 
         {
             if (optionSellerNode.Attributes["id"] != null) 
             {
                 optionSellerIDRef_ = optionSellerNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(optionSellerNode);
                 IDManager.SetID(optionSellerIDRef_, ob);
             }
             else if (optionSellerNode.Attributes["href"] != null)
             {
                 optionSellerIDRef_ = optionSellerNode.Attributes["href"].Value;
             }
             else
             {
                 optionSeller_ = new PartyReference(optionSellerNode);
             }
         }
         else
         {
             optionSeller_ = new PartyReference(optionSellerNode);
         }
     }
     
 
     XmlNode optionBuyerNode = xmlNode.SelectSingleNode("optionBuyer");
     
     if (optionBuyerNode != null)
     {
         if (optionBuyerNode.Attributes["href"] != null || optionBuyerNode.Attributes["id"] != null) 
         {
             if (optionBuyerNode.Attributes["id"] != null) 
             {
                 optionBuyerIDRef_ = optionBuyerNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(optionBuyerNode);
                 IDManager.SetID(optionBuyerIDRef_, ob);
             }
             else if (optionBuyerNode.Attributes["href"] != null)
             {
                 optionBuyerIDRef_ = optionBuyerNode.Attributes["href"].Value;
             }
             else
             {
                 optionBuyer_ = new PartyReference(optionBuyerNode);
             }
         }
         else
         {
             optionBuyer_ = new PartyReference(optionBuyerNode);
         }
     }
     
 
     XmlNode originalTradeNode = xmlNode.SelectSingleNode("originalTrade");
     
     if (originalTradeNode != null)
     {
         if (originalTradeNode.Attributes["href"] != null || originalTradeNode.Attributes["id"] != null) 
         {
             if (originalTradeNode.Attributes["id"] != null) 
             {
                 originalTradeIDRef_ = originalTradeNode.Attributes["id"].Value;
                 Trade ob = new Trade(originalTradeNode);
                 IDManager.SetID(originalTradeIDRef_, ob);
             }
             else if (originalTradeNode.Attributes["href"] != null)
             {
                 originalTradeIDRef_ = originalTradeNode.Attributes["href"].Value;
             }
             else
             {
                 originalTrade_ = new Trade(originalTradeNode);
             }
         }
         else
         {
             originalTrade_ = new Trade(originalTradeNode);
         }
     }
     
 
     XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");
     
     if (tradeIdentifierNodeList != null)
     {
         this.tradeIdentifier_ = new List<PartyTradeIdentifier>();
         foreach (XmlNode item in tradeIdentifierNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     tradeIdentifierIDRef_ = item.Attributes["id"].Value;
                     tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                     IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     tradeIdentifierIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                 }
             }
             else
             {
                 tradeIdentifier_.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNode exerciseDateNode = xmlNode.SelectSingleNode("exerciseDate");
     
     if (exerciseDateNode != null)
     {
         if (exerciseDateNode.Attributes["href"] != null || exerciseDateNode.Attributes["id"] != null) 
         {
             if (exerciseDateNode.Attributes["id"] != null) 
             {
                 exerciseDateIDRef_ = exerciseDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(exerciseDateNode);
                 IDManager.SetID(exerciseDateIDRef_, ob);
             }
             else if (exerciseDateNode.Attributes["href"] != null)
             {
                 exerciseDateIDRef_ = exerciseDateNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseDate_ = new XsdTypeDate(exerciseDateNode);
             }
         }
         else
         {
             exerciseDate_ = new XsdTypeDate(exerciseDateNode);
         }
     }
     
 
     XmlNode exerciseTimeNode = xmlNode.SelectSingleNode("exerciseTime");
     
     if (exerciseTimeNode != null)
     {
         if (exerciseTimeNode.Attributes["href"] != null || exerciseTimeNode.Attributes["id"] != null) 
         {
             if (exerciseTimeNode.Attributes["id"] != null) 
             {
                 exerciseTimeIDRef_ = exerciseTimeNode.Attributes["id"].Value;
                 XsdTypeTime ob = new XsdTypeTime(exerciseTimeNode);
                 IDManager.SetID(exerciseTimeIDRef_, ob);
             }
             else if (exerciseTimeNode.Attributes["href"] != null)
             {
                 exerciseTimeIDRef_ = exerciseTimeNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
             }
         }
         else
         {
             exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
         }
     }
     
 
     XmlNode expiryNode = xmlNode.SelectSingleNode("expiry");
     
     if (expiryNode != null)
     {
         if (expiryNode.Attributes["href"] != null || expiryNode.Attributes["id"] != null) 
         {
             if (expiryNode.Attributes["id"] != null) 
             {
                 expiryIDRef_ = expiryNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(expiryNode);
                 IDManager.SetID(expiryIDRef_, ob);
             }
             else if (expiryNode.Attributes["href"] != null)
             {
                 expiryIDRef_ = expiryNode.Attributes["href"].Value;
             }
             else
             {
                 expiry_ = new XsdTypeBoolean(expiryNode);
             }
         }
         else
         {
             expiry_ = new XsdTypeBoolean(expiryNode);
         }
     }
     
 
     XmlNode fullExerciseNode = xmlNode.SelectSingleNode("fullExercise");
     
     if (fullExerciseNode != null)
     {
         if (fullExerciseNode.Attributes["href"] != null || fullExerciseNode.Attributes["id"] != null) 
         {
             if (fullExerciseNode.Attributes["id"] != null) 
             {
                 fullExerciseIDRef_ = fullExerciseNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(fullExerciseNode);
                 IDManager.SetID(fullExerciseIDRef_, ob);
             }
             else if (fullExerciseNode.Attributes["href"] != null)
             {
                 fullExerciseIDRef_ = fullExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 fullExercise_ = new XsdTypeBoolean(fullExerciseNode);
             }
         }
         else
         {
             fullExercise_ = new XsdTypeBoolean(fullExerciseNode);
         }
     }
     
 
     XmlNode exerciseInNotionalAmountNode = xmlNode.SelectSingleNode("exerciseInNotionalAmount");
     
     if (exerciseInNotionalAmountNode != null)
     {
         if (exerciseInNotionalAmountNode.Attributes["href"] != null || exerciseInNotionalAmountNode.Attributes["id"] != null) 
         {
             if (exerciseInNotionalAmountNode.Attributes["id"] != null) 
             {
                 exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["id"].Value;
                 Money ob = new Money(exerciseInNotionalAmountNode);
                 IDManager.SetID(exerciseInNotionalAmountIDRef_, ob);
             }
             else if (exerciseInNotionalAmountNode.Attributes["href"] != null)
             {
                 exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode);
             }
         }
         else
         {
             exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode);
         }
     }
     
 
     XmlNode outstandingNotionalAmountNode = xmlNode.SelectSingleNode("outstandingNotionalAmount");
     
     if (outstandingNotionalAmountNode != null)
     {
         if (outstandingNotionalAmountNode.Attributes["href"] != null || outstandingNotionalAmountNode.Attributes["id"] != null) 
         {
             if (outstandingNotionalAmountNode.Attributes["id"] != null) 
             {
                 outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["id"].Value;
                 Money ob = new Money(outstandingNotionalAmountNode);
                 IDManager.SetID(outstandingNotionalAmountIDRef_, ob);
             }
             else if (outstandingNotionalAmountNode.Attributes["href"] != null)
             {
                 outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode);
             }
         }
         else
         {
             outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode);
         }
     }
     
 
     XmlNode exerciseInNumberOfOptionsNode = xmlNode.SelectSingleNode("exerciseInNumberOfOptions");
     
     if (exerciseInNumberOfOptionsNode != null)
     {
         if (exerciseInNumberOfOptionsNode.Attributes["href"] != null || exerciseInNumberOfOptionsNode.Attributes["id"] != null) 
         {
             if (exerciseInNumberOfOptionsNode.Attributes["id"] != null) 
             {
                 exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
                 IDManager.SetID(exerciseInNumberOfOptionsIDRef_, ob);
             }
             else if (exerciseInNumberOfOptionsNode.Attributes["href"] != null)
             {
                 exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
             }
         }
         else
         {
             exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
         }
     }
     
 
     XmlNode outstandingNumberOfOptionsNode = xmlNode.SelectSingleNode("outstandingNumberOfOptions");
     
     if (outstandingNumberOfOptionsNode != null)
     {
         if (outstandingNumberOfOptionsNode.Attributes["href"] != null || outstandingNumberOfOptionsNode.Attributes["id"] != null) 
         {
             if (outstandingNumberOfOptionsNode.Attributes["id"] != null) 
             {
                 outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
                 IDManager.SetID(outstandingNumberOfOptionsIDRef_, ob);
             }
             else if (outstandingNumberOfOptionsNode.Attributes["href"] != null)
             {
                 outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["href"].Value;
             }
             else
             {
                 outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
             }
         }
         else
         {
             outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
         }
     }
     
 
     XmlNode exerciseInNumberOfUnitsNode = xmlNode.SelectSingleNode("exerciseInNumberOfUnits");
     
     if (exerciseInNumberOfUnitsNode != null)
     {
         if (exerciseInNumberOfUnitsNode.Attributes["href"] != null || exerciseInNumberOfUnitsNode.Attributes["id"] != null) 
         {
             if (exerciseInNumberOfUnitsNode.Attributes["id"] != null) 
             {
                 exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
                 IDManager.SetID(exerciseInNumberOfUnitsIDRef_, ob);
             }
             else if (exerciseInNumberOfUnitsNode.Attributes["href"] != null)
             {
                 exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
             }
         }
         else
         {
             exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
         }
     }
     
 
     XmlNode outstandingNumberOfUnitsNode = xmlNode.SelectSingleNode("outstandingNumberOfUnits");
     
     if (outstandingNumberOfUnitsNode != null)
     {
         if (outstandingNumberOfUnitsNode.Attributes["href"] != null || outstandingNumberOfUnitsNode.Attributes["id"] != null) 
         {
             if (outstandingNumberOfUnitsNode.Attributes["id"] != null) 
             {
                 outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
                 IDManager.SetID(outstandingNumberOfUnitsIDRef_, ob);
             }
             else if (outstandingNumberOfUnitsNode.Attributes["href"] != null)
             {
                 outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["href"].Value;
             }
             else
             {
                 outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
             }
         }
         else
         {
             outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
         }
     }
     
 
     XmlNode settlementTypeNode = xmlNode.SelectSingleNode("settlementType");
     
     if (settlementTypeNode != null)
     {
         if (settlementTypeNode.Attributes["href"] != null || settlementTypeNode.Attributes["id"] != null) 
         {
             if (settlementTypeNode.Attributes["id"] != null) 
             {
                 settlementTypeIDRef_ = settlementTypeNode.Attributes["id"].Value;
                 SettlementTypeEnum ob = new SettlementTypeEnum(settlementTypeNode);
                 IDManager.SetID(settlementTypeIDRef_, ob);
             }
             else if (settlementTypeNode.Attributes["href"] != null)
             {
                 settlementTypeIDRef_ = settlementTypeNode.Attributes["href"].Value;
             }
             else
             {
                 settlementType_ = new SettlementTypeEnum(settlementTypeNode);
             }
         }
         else
         {
             settlementType_ = new SettlementTypeEnum(settlementTypeNode);
         }
     }
     
 
     XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");
     
     if (cashSettlementNode != null)
     {
         if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) 
         {
             if (cashSettlementNode.Attributes["id"] != null) 
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                 SimplePayment ob = new SimplePayment(cashSettlementNode);
                 IDManager.SetID(cashSettlementIDRef_, ob);
             }
             else if (cashSettlementNode.Attributes["href"] != null)
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 cashSettlement_ = new SimplePayment(cashSettlementNode);
             }
         }
         else
         {
             cashSettlement_ = new SimplePayment(cashSettlementNode);
         }
     }
     
 
     XmlNode physicalSettlementNode = xmlNode.SelectSingleNode("physicalSettlement");
     
     if (physicalSettlementNode != null)
     {
         if (physicalSettlementNode.Attributes["href"] != null || physicalSettlementNode.Attributes["id"] != null) 
         {
             if (physicalSettlementNode.Attributes["id"] != null) 
             {
                 physicalSettlementIDRef_ = physicalSettlementNode.Attributes["id"].Value;
                 PhysicalSettlement ob = new PhysicalSettlement(physicalSettlementNode);
                 IDManager.SetID(physicalSettlementIDRef_, ob);
             }
             else if (physicalSettlementNode.Attributes["href"] != null)
             {
                 physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
             }
         }
         else
         {
             physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
         }
     }
     
 
     XmlNode paymentNode = xmlNode.SelectSingleNode("payment");
     
     if (paymentNode != null)
     {
         if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null) 
         {
             if (paymentNode.Attributes["id"] != null) 
             {
                 paymentIDRef_ = paymentNode.Attributes["id"].Value;
                 NonNegativePayment ob = new NonNegativePayment(paymentNode);
                 IDManager.SetID(paymentIDRef_, ob);
             }
             else if (paymentNode.Attributes["href"] != null)
             {
                 paymentIDRef_ = paymentNode.Attributes["href"].Value;
             }
             else
             {
                 payment_ = new NonNegativePayment(paymentNode);
             }
         }
         else
         {
             payment_ = new NonNegativePayment(paymentNode);
         }
     }
     
 
 }
        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));
             }
         }
     }
     
 
 }
Beispiel #11
0
        public CancelableProvision(XmlNode xmlNode)
        {
            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 exerciseNode = xmlNode.SelectSingleNode("exercise");

            if (exerciseNode != null)
            {
                if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null)
                {
                    if (exerciseNode.Attributes["id"] != null)
                    {
                        exerciseIDRef_ = exerciseNode.Attributes["id"].Value;
                        Exercise ob = new Exercise(exerciseNode);
                        IDManager.SetID(exerciseIDRef_, ob);
                    }
                    else if (exerciseNode.Attributes["href"] != null)
                    {
                        exerciseIDRef_ = exerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exercise_ = new Exercise(exerciseNode);
                    }
                }
                else
                {
                    exercise_ = new Exercise(exerciseNode);
                }
            }


            XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");

            if (americanExerciseNode != null)
            {
                if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null)
                {
                    if (americanExerciseNode.Attributes["id"] != null)
                    {
                        americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                        AmericanExercise ob = new AmericanExercise(americanExerciseNode);
                        IDManager.SetID(americanExerciseIDRef_, ob);
                    }
                    else if (americanExerciseNode.Attributes["href"] != null)
                    {
                        americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        americanExercise_ = new AmericanExercise(americanExerciseNode);
                    }
                }
                else
                {
                    americanExercise_ = new AmericanExercise(americanExerciseNode);
                }
            }


            XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise");

            if (bermudaExerciseNode != null)
            {
                if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null)
                {
                    if (bermudaExerciseNode.Attributes["id"] != null)
                    {
                        bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value;
                        BermudaExercise ob = new BermudaExercise(bermudaExerciseNode);
                        IDManager.SetID(bermudaExerciseIDRef_, ob);
                    }
                    else if (bermudaExerciseNode.Attributes["href"] != null)
                    {
                        bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
                    }
                }
                else
                {
                    bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
                }
            }


            XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");

            if (europeanExerciseNode != null)
            {
                if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null)
                {
                    if (europeanExerciseNode.Attributes["id"] != null)
                    {
                        europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                        EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode);
                        IDManager.SetID(europeanExerciseIDRef_, ob);
                    }
                    else if (europeanExerciseNode.Attributes["href"] != null)
                    {
                        europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
                    }
                }
                else
                {
                    europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
                }
            }


            XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice");

            if (exerciseNoticeNode != null)
            {
                if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null)
                {
                    if (exerciseNoticeNode.Attributes["id"] != null)
                    {
                        exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value;
                        ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode);
                        IDManager.SetID(exerciseNoticeIDRef_, ob);
                    }
                    else if (exerciseNoticeNode.Attributes["href"] != null)
                    {
                        exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
                    }
                }
                else
                {
                    exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
                }
            }


            XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation");

            if (followUpConfirmationNode != null)
            {
                if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null)
                {
                    if (followUpConfirmationNode.Attributes["id"] != null)
                    {
                        followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode);
                        IDManager.SetID(followUpConfirmationIDRef_, ob);
                    }
                    else if (followUpConfirmationNode.Attributes["href"] != null)
                    {
                        followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode);
                    }
                }
                else
                {
                    followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode);
                }
            }


            XmlNode cancelableProvisionAdjustedDatesNode = xmlNode.SelectSingleNode("cancelableProvisionAdjustedDates");

            if (cancelableProvisionAdjustedDatesNode != null)
            {
                if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null || cancelableProvisionAdjustedDatesNode.Attributes["id"] != null)
                {
                    if (cancelableProvisionAdjustedDatesNode.Attributes["id"] != null)
                    {
                        cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["id"].Value;
                        CancelableProvisionAdjustedDates ob = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
                        IDManager.SetID(cancelableProvisionAdjustedDatesIDRef_, ob);
                    }
                    else if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null)
                    {
                        cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
                    }
                }
                else
                {
                    cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
                }
            }


            XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment");

            if (finalCalculationPeriodDateAdjustmentNodeList != null)
            {
                this.finalCalculationPeriodDateAdjustment_ = new List <FinalCalculationPeriodDateAdjustment>();
                foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["id"].Value;
                            finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                            IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef_, finalCalculationPeriodDateAdjustment_[finalCalculationPeriodDateAdjustment_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                        }
                    }
                    else
                    {
                        finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                    }
                }
            }


            XmlNode initialFeeNode = xmlNode.SelectSingleNode("initialFee");

            if (initialFeeNode != null)
            {
                if (initialFeeNode.Attributes["href"] != null || initialFeeNode.Attributes["id"] != null)
                {
                    if (initialFeeNode.Attributes["id"] != null)
                    {
                        initialFeeIDRef_ = initialFeeNode.Attributes["id"].Value;
                        SimplePayment ob = new SimplePayment(initialFeeNode);
                        IDManager.SetID(initialFeeIDRef_, ob);
                    }
                    else if (initialFeeNode.Attributes["href"] != null)
                    {
                        initialFeeIDRef_ = initialFeeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        initialFee_ = new SimplePayment(initialFeeNode);
                    }
                }
                else
                {
                    initialFee_ = new SimplePayment(initialFeeNode);
                }
            }
        }
 public OptionExercise(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList optionSellerNodeList = xmlNode.SelectNodes("optionSeller");
     if (optionSellerNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionSellerNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionSellerIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(optionSellerIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionSellerIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionSeller = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList optionBuyerNodeList = xmlNode.SelectNodes("optionBuyer");
     if (optionBuyerNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionBuyerNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionBuyerIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(optionBuyerIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionBuyerIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionBuyer = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList originalTradeNodeList = xmlNode.SelectNodes("originalTrade");
     if (originalTradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in originalTradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 originalTradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(originalTradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 originalTradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 originalTrade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");
     
     foreach (XmlNode item in tradeIdentifierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeIdentifierIDRef = item.Attributes["id"].Name;
                 List<PartyTradeIdentifier> ob = new List<PartyTradeIdentifier>();
                 ob.Add(new PartyTradeIdentifier(item));
                 IDManager.SetID(tradeIdentifierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeIdentifierIDRef = item.Attributes["href"].Name;
             }
             else
             {
             tradeIdentifier.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNodeList exerciseDateNodeList = xmlNode.SelectNodes("exerciseDate");
     if (exerciseDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(exerciseDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList exerciseTimeNodeList = xmlNode.SelectNodes("exerciseTime");
     if (exerciseTimeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseTimeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseTimeIDRef = item.Attributes["id"].Name;
                 XsdTypeTime ob = XsdTypeTime();
                 IDManager.SetID(exerciseTimeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseTimeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseTime = new XsdTypeTime(item);
             }
         }
     }
     
 
     XmlNodeList expiryNodeList = xmlNode.SelectNodes("expiry");
     if (expiryNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in expiryNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 expiryIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(expiryIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 expiryIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 expiry = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList fullExerciseNodeList = xmlNode.SelectNodes("fullExercise");
     if (fullExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fullExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fullExerciseIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(fullExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fullExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fullExercise = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList exerciseInNotionalAmountNodeList = xmlNode.SelectNodes("exerciseInNotionalAmount");
     if (exerciseInNotionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseInNotionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseInNotionalAmountIDRef = item.Attributes["id"].Name;
                 Money ob = Money();
                 IDManager.SetID(exerciseInNotionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseInNotionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseInNotionalAmount = new Money(item);
             }
         }
     }
     
 
     XmlNodeList outstandingNotionalAmountNodeList = xmlNode.SelectNodes("outstandingNotionalAmount");
     if (outstandingNotionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in outstandingNotionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 outstandingNotionalAmountIDRef = item.Attributes["id"].Name;
                 Money ob = Money();
                 IDManager.SetID(outstandingNotionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 outstandingNotionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 outstandingNotionalAmount = new Money(item);
             }
         }
     }
     
 
     XmlNodeList exerciseInNumberOfOptionsNodeList = xmlNode.SelectNodes("exerciseInNumberOfOptions");
     if (exerciseInNumberOfOptionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseInNumberOfOptionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseInNumberOfOptionsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(exerciseInNumberOfOptionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseInNumberOfOptionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseInNumberOfOptions = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList outstandingNumberOfOptionsNodeList = xmlNode.SelectNodes("outstandingNumberOfOptions");
     if (outstandingNumberOfOptionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in outstandingNumberOfOptionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 outstandingNumberOfOptionsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(outstandingNumberOfOptionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 outstandingNumberOfOptionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 outstandingNumberOfOptions = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList exerciseInNumberOfUnitsNodeList = xmlNode.SelectNodes("exerciseInNumberOfUnits");
     if (exerciseInNumberOfUnitsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseInNumberOfUnitsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseInNumberOfUnitsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(exerciseInNumberOfUnitsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseInNumberOfUnitsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseInNumberOfUnits = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList outstandingNumberOfUnitsNodeList = xmlNode.SelectNodes("outstandingNumberOfUnits");
     if (outstandingNumberOfUnitsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in outstandingNumberOfUnitsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 outstandingNumberOfUnitsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(outstandingNumberOfUnitsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 outstandingNumberOfUnitsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 outstandingNumberOfUnits = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList settlementTypeNodeList = xmlNode.SelectNodes("settlementType");
     if (settlementTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementTypeIDRef = item.Attributes["id"].Name;
                 SettlementTypeEnum ob = SettlementTypeEnum();
                 IDManager.SetID(settlementTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementType = new SettlementTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");
     if (cashSettlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cashSettlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cashSettlementIDRef = item.Attributes["id"].Name;
                 SimplePayment ob = SimplePayment();
                 IDManager.SetID(cashSettlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cashSettlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cashSettlement = new SimplePayment(item);
             }
         }
     }
     
 
     XmlNodeList physicalSettlementNodeList = xmlNode.SelectNodes("physicalSettlement");
     if (physicalSettlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalSettlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalSettlementIDRef = item.Attributes["id"].Name;
                 PhysicalSettlement ob = PhysicalSettlement();
                 IDManager.SetID(physicalSettlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalSettlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalSettlement = new PhysicalSettlement(item);
             }
         }
     }
     
 
     XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");
     if (paymentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentIDRef = item.Attributes["id"].Name;
                 NonNegativePayment ob = NonNegativePayment();
                 IDManager.SetID(paymentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payment = new NonNegativePayment(item);
             }
         }
     }
     
 
 }