public EquityDerivativeBase(XmlNode xmlNode)
 : base(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 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;
                 EquityOptionTypeEnum ob = EquityOptionTypeEnum();
                 IDManager.SetID(optionTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionType = new EquityOptionTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList equityEffectiveDateNodeList = xmlNode.SelectNodes("equityEffectiveDate");
     if (equityEffectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in equityEffectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 equityEffectiveDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(equityEffectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 equityEffectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 equityEffectiveDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");
     if (underlyerNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in underlyerNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 underlyerIDRef = item.Attributes["id"].Name;
                 Underlyer ob = Underlyer();
                 IDManager.SetID(underlyerIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 underlyerIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 underlyer = new Underlyer(item);
             }
         }
     }
     
 
     XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");
     if (notionalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(notionalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notional = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList equityExerciseNodeList = xmlNode.SelectNodes("equityExercise");
     if (equityExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in equityExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 equityExerciseIDRef = item.Attributes["id"].Name;
                 EquityExerciseValuationSettlement ob = EquityExerciseValuationSettlement();
                 IDManager.SetID(equityExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 equityExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 equityExercise = new EquityExerciseValuationSettlement(item);
             }
         }
     }
     
 
     XmlNodeList featureNodeList = xmlNode.SelectNodes("feature");
     if (featureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in featureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 featureIDRef = item.Attributes["id"].Name;
                 OptionFeatures ob = OptionFeatures();
                 IDManager.SetID(featureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 featureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feature = new OptionFeatures(item);
             }
         }
     }
     
 
     XmlNodeList fxFeatureNodeList = xmlNode.SelectNodes("fxFeature");
     if (fxFeatureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxFeatureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxFeatureIDRef = item.Attributes["id"].Name;
                 FxFeature ob = FxFeature();
                 IDManager.SetID(fxFeatureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxFeatureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fxFeature = new FxFeature(item);
             }
         }
     }
     
 
     XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature");
     if (strategyFeatureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in strategyFeatureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strategyFeatureIDRef = item.Attributes["id"].Name;
                 StrategyFeature ob = StrategyFeature();
                 IDManager.SetID(strategyFeatureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strategyFeatureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 strategyFeature = new StrategyFeature(item);
             }
         }
     }
     
 
 }
 public EquityDerivativeBase(XmlNode xmlNode)
 : base(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 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;
                 EquityOptionTypeEnum ob = new EquityOptionTypeEnum(optionTypeNode);
                 IDManager.SetID(optionTypeIDRef_, ob);
             }
             else if (optionTypeNode.Attributes["href"] != null)
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
             }
             else
             {
                 optionType_ = new EquityOptionTypeEnum(optionTypeNode);
             }
         }
         else
         {
             optionType_ = new EquityOptionTypeEnum(optionTypeNode);
         }
     }
     
 
     XmlNode equityEffectiveDateNode = xmlNode.SelectSingleNode("equityEffectiveDate");
     
     if (equityEffectiveDateNode != null)
     {
         if (equityEffectiveDateNode.Attributes["href"] != null || equityEffectiveDateNode.Attributes["id"] != null) 
         {
             if (equityEffectiveDateNode.Attributes["id"] != null) 
             {
                 equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(equityEffectiveDateNode);
                 IDManager.SetID(equityEffectiveDateIDRef_, ob);
             }
             else if (equityEffectiveDateNode.Attributes["href"] != null)
             {
                 equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode);
             }
         }
         else
         {
             equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode);
         }
     }
     
 
     XmlNode underlyerNode = xmlNode.SelectSingleNode("underlyer");
     
     if (underlyerNode != null)
     {
         if (underlyerNode.Attributes["href"] != null || underlyerNode.Attributes["id"] != null) 
         {
             if (underlyerNode.Attributes["id"] != null) 
             {
                 underlyerIDRef_ = underlyerNode.Attributes["id"].Value;
                 Underlyer ob = new Underlyer(underlyerNode);
                 IDManager.SetID(underlyerIDRef_, ob);
             }
             else if (underlyerNode.Attributes["href"] != null)
             {
                 underlyerIDRef_ = underlyerNode.Attributes["href"].Value;
             }
             else
             {
                 underlyer_ = new Underlyer(underlyerNode);
             }
         }
         else
         {
             underlyer_ = new Underlyer(underlyerNode);
         }
     }
     
 
     XmlNode notionalNode = xmlNode.SelectSingleNode("notional");
     
     if (notionalNode != null)
     {
         if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) 
         {
             if (notionalNode.Attributes["id"] != null) 
             {
                 notionalIDRef_ = notionalNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(notionalNode);
                 IDManager.SetID(notionalIDRef_, ob);
             }
             else if (notionalNode.Attributes["href"] != null)
             {
                 notionalIDRef_ = notionalNode.Attributes["href"].Value;
             }
             else
             {
                 notional_ = new NonNegativeMoney(notionalNode);
             }
         }
         else
         {
             notional_ = new NonNegativeMoney(notionalNode);
         }
     }
     
 
     XmlNode equityExerciseNode = xmlNode.SelectSingleNode("equityExercise");
     
     if (equityExerciseNode != null)
     {
         if (equityExerciseNode.Attributes["href"] != null || equityExerciseNode.Attributes["id"] != null) 
         {
             if (equityExerciseNode.Attributes["id"] != null) 
             {
                 equityExerciseIDRef_ = equityExerciseNode.Attributes["id"].Value;
                 EquityExerciseValuationSettlement ob = new EquityExerciseValuationSettlement(equityExerciseNode);
                 IDManager.SetID(equityExerciseIDRef_, ob);
             }
             else if (equityExerciseNode.Attributes["href"] != null)
             {
                 equityExerciseIDRef_ = equityExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode);
             }
         }
         else
         {
             equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode);
         }
     }
     
 
     XmlNode featureNode = xmlNode.SelectSingleNode("feature");
     
     if (featureNode != null)
     {
         if (featureNode.Attributes["href"] != null || featureNode.Attributes["id"] != null) 
         {
             if (featureNode.Attributes["id"] != null) 
             {
                 featureIDRef_ = featureNode.Attributes["id"].Value;
                 OptionFeatures ob = new OptionFeatures(featureNode);
                 IDManager.SetID(featureIDRef_, ob);
             }
             else if (featureNode.Attributes["href"] != null)
             {
                 featureIDRef_ = featureNode.Attributes["href"].Value;
             }
             else
             {
                 feature_ = new OptionFeatures(featureNode);
             }
         }
         else
         {
             feature_ = new OptionFeatures(featureNode);
         }
     }
     
 
     XmlNode fxFeatureNode = xmlNode.SelectSingleNode("fxFeature");
     
     if (fxFeatureNode != null)
     {
         if (fxFeatureNode.Attributes["href"] != null || fxFeatureNode.Attributes["id"] != null) 
         {
             if (fxFeatureNode.Attributes["id"] != null) 
             {
                 fxFeatureIDRef_ = fxFeatureNode.Attributes["id"].Value;
                 FxFeature ob = new FxFeature(fxFeatureNode);
                 IDManager.SetID(fxFeatureIDRef_, ob);
             }
             else if (fxFeatureNode.Attributes["href"] != null)
             {
                 fxFeatureIDRef_ = fxFeatureNode.Attributes["href"].Value;
             }
             else
             {
                 fxFeature_ = new FxFeature(fxFeatureNode);
             }
         }
         else
         {
             fxFeature_ = new FxFeature(fxFeatureNode);
         }
     }
     
 
     XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature");
     
     if (strategyFeatureNode != null)
     {
         if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null) 
         {
             if (strategyFeatureNode.Attributes["id"] != null) 
             {
                 strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value;
                 StrategyFeature ob = new StrategyFeature(strategyFeatureNode);
                 IDManager.SetID(strategyFeatureIDRef_, ob);
             }
             else if (strategyFeatureNode.Attributes["href"] != null)
             {
                 strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value;
             }
             else
             {
                 strategyFeature_ = new StrategyFeature(strategyFeatureNode);
             }
         }
         else
         {
             strategyFeature_ = new StrategyFeature(strategyFeatureNode);
         }
     }
     
 
 }
        public EquityDerivativeBase(XmlNode xmlNode)
            : base(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 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;
                        EquityOptionTypeEnum ob = EquityOptionTypeEnum();
                        IDManager.SetID(optionTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionType = new EquityOptionTypeEnum(item);
                    }
                }
            }


            XmlNodeList equityEffectiveDateNodeList = xmlNode.SelectNodes("equityEffectiveDate");

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

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


            XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");

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

            foreach (XmlNode item in underlyerNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        underlyerIDRef = item.Attributes["id"].Name;
                        Underlyer ob = Underlyer();
                        IDManager.SetID(underlyerIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        underlyerIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        underlyer = new Underlyer(item);
                    }
                }
            }


            XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");

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

            foreach (XmlNode item in notionalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(notionalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notional = new NonNegativeMoney(item);
                    }
                }
            }


            XmlNodeList equityExerciseNodeList = xmlNode.SelectNodes("equityExercise");

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

            foreach (XmlNode item in equityExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        equityExerciseIDRef = item.Attributes["id"].Name;
                        EquityExerciseValuationSettlement ob = EquityExerciseValuationSettlement();
                        IDManager.SetID(equityExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        equityExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        equityExercise = new EquityExerciseValuationSettlement(item);
                    }
                }
            }


            XmlNodeList featureNodeList = xmlNode.SelectNodes("feature");

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

            foreach (XmlNode item in featureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        featureIDRef = item.Attributes["id"].Name;
                        OptionFeatures ob = OptionFeatures();
                        IDManager.SetID(featureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        featureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        feature = new OptionFeatures(item);
                    }
                }
            }


            XmlNodeList fxFeatureNodeList = xmlNode.SelectNodes("fxFeature");

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

            foreach (XmlNode item in fxFeatureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxFeatureIDRef = item.Attributes["id"].Name;
                        FxFeature ob = FxFeature();
                        IDManager.SetID(fxFeatureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxFeatureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fxFeature = new FxFeature(item);
                    }
                }
            }


            XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature");

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

            foreach (XmlNode item in strategyFeatureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        strategyFeatureIDRef = item.Attributes["id"].Name;
                        StrategyFeature ob = StrategyFeature();
                        IDManager.SetID(strategyFeatureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        strategyFeatureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        strategyFeature = new StrategyFeature(item);
                    }
                }
            }
        }
Example #4
0
        public EquityDerivativeBase(XmlNode xmlNode)
            : base(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 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;
                        EquityOptionTypeEnum ob = new EquityOptionTypeEnum(optionTypeNode);
                        IDManager.SetID(optionTypeIDRef_, ob);
                    }
                    else if (optionTypeNode.Attributes["href"] != null)
                    {
                        optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionType_ = new EquityOptionTypeEnum(optionTypeNode);
                    }
                }
                else
                {
                    optionType_ = new EquityOptionTypeEnum(optionTypeNode);
                }
            }


            XmlNode equityEffectiveDateNode = xmlNode.SelectSingleNode("equityEffectiveDate");

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


            XmlNode underlyerNode = xmlNode.SelectSingleNode("underlyer");

            if (underlyerNode != null)
            {
                if (underlyerNode.Attributes["href"] != null || underlyerNode.Attributes["id"] != null)
                {
                    if (underlyerNode.Attributes["id"] != null)
                    {
                        underlyerIDRef_ = underlyerNode.Attributes["id"].Value;
                        Underlyer ob = new Underlyer(underlyerNode);
                        IDManager.SetID(underlyerIDRef_, ob);
                    }
                    else if (underlyerNode.Attributes["href"] != null)
                    {
                        underlyerIDRef_ = underlyerNode.Attributes["href"].Value;
                    }
                    else
                    {
                        underlyer_ = new Underlyer(underlyerNode);
                    }
                }
                else
                {
                    underlyer_ = new Underlyer(underlyerNode);
                }
            }


            XmlNode notionalNode = xmlNode.SelectSingleNode("notional");

            if (notionalNode != null)
            {
                if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null)
                {
                    if (notionalNode.Attributes["id"] != null)
                    {
                        notionalIDRef_ = notionalNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(notionalNode);
                        IDManager.SetID(notionalIDRef_, ob);
                    }
                    else if (notionalNode.Attributes["href"] != null)
                    {
                        notionalIDRef_ = notionalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        notional_ = new NonNegativeMoney(notionalNode);
                    }
                }
                else
                {
                    notional_ = new NonNegativeMoney(notionalNode);
                }
            }


            XmlNode equityExerciseNode = xmlNode.SelectSingleNode("equityExercise");

            if (equityExerciseNode != null)
            {
                if (equityExerciseNode.Attributes["href"] != null || equityExerciseNode.Attributes["id"] != null)
                {
                    if (equityExerciseNode.Attributes["id"] != null)
                    {
                        equityExerciseIDRef_ = equityExerciseNode.Attributes["id"].Value;
                        EquityExerciseValuationSettlement ob = new EquityExerciseValuationSettlement(equityExerciseNode);
                        IDManager.SetID(equityExerciseIDRef_, ob);
                    }
                    else if (equityExerciseNode.Attributes["href"] != null)
                    {
                        equityExerciseIDRef_ = equityExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode);
                    }
                }
                else
                {
                    equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode);
                }
            }


            XmlNode featureNode = xmlNode.SelectSingleNode("feature");

            if (featureNode != null)
            {
                if (featureNode.Attributes["href"] != null || featureNode.Attributes["id"] != null)
                {
                    if (featureNode.Attributes["id"] != null)
                    {
                        featureIDRef_ = featureNode.Attributes["id"].Value;
                        OptionFeatures ob = new OptionFeatures(featureNode);
                        IDManager.SetID(featureIDRef_, ob);
                    }
                    else if (featureNode.Attributes["href"] != null)
                    {
                        featureIDRef_ = featureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        feature_ = new OptionFeatures(featureNode);
                    }
                }
                else
                {
                    feature_ = new OptionFeatures(featureNode);
                }
            }


            XmlNode fxFeatureNode = xmlNode.SelectSingleNode("fxFeature");

            if (fxFeatureNode != null)
            {
                if (fxFeatureNode.Attributes["href"] != null || fxFeatureNode.Attributes["id"] != null)
                {
                    if (fxFeatureNode.Attributes["id"] != null)
                    {
                        fxFeatureIDRef_ = fxFeatureNode.Attributes["id"].Value;
                        FxFeature ob = new FxFeature(fxFeatureNode);
                        IDManager.SetID(fxFeatureIDRef_, ob);
                    }
                    else if (fxFeatureNode.Attributes["href"] != null)
                    {
                        fxFeatureIDRef_ = fxFeatureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fxFeature_ = new FxFeature(fxFeatureNode);
                    }
                }
                else
                {
                    fxFeature_ = new FxFeature(fxFeatureNode);
                }
            }


            XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature");

            if (strategyFeatureNode != null)
            {
                if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null)
                {
                    if (strategyFeatureNode.Attributes["id"] != null)
                    {
                        strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value;
                        StrategyFeature ob = new StrategyFeature(strategyFeatureNode);
                        IDManager.SetID(strategyFeatureIDRef_, ob);
                    }
                    else if (strategyFeatureNode.Attributes["href"] != null)
                    {
                        strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        strategyFeature_ = new StrategyFeature(strategyFeatureNode);
                    }
                }
                else
                {
                    strategyFeature_ = new StrategyFeature(strategyFeatureNode);
                }
            }
        }