public Market(XmlNode xmlNode)
 {
     XmlNode nameNode = xmlNode.SelectSingleNode("name");
     
     if (nameNode != null)
     {
         if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) 
         {
             if (nameNode.Attributes["id"] != null) 
             {
                 nameIDRef_ = nameNode.Attributes["id"].Value;
                 XsdTypeString ob = new XsdTypeString(nameNode);
                 IDManager.SetID(nameIDRef_, ob);
             }
             else if (nameNode.Attributes["href"] != null)
             {
                 nameIDRef_ = nameNode.Attributes["href"].Value;
             }
             else
             {
                 name_ = new XsdTypeString(nameNode);
             }
         }
         else
         {
             name_ = new XsdTypeString(nameNode);
         }
     }
     
 
     XmlNode benchmarkQuotesNode = xmlNode.SelectSingleNode("benchmarkQuotes");
     
     if (benchmarkQuotesNode != null)
     {
         if (benchmarkQuotesNode.Attributes["href"] != null || benchmarkQuotesNode.Attributes["id"] != null) 
         {
             if (benchmarkQuotesNode.Attributes["id"] != null) 
             {
                 benchmarkQuotesIDRef_ = benchmarkQuotesNode.Attributes["id"].Value;
                 QuotedAssetSet ob = new QuotedAssetSet(benchmarkQuotesNode);
                 IDManager.SetID(benchmarkQuotesIDRef_, ob);
             }
             else if (benchmarkQuotesNode.Attributes["href"] != null)
             {
                 benchmarkQuotesIDRef_ = benchmarkQuotesNode.Attributes["href"].Value;
             }
             else
             {
                 benchmarkQuotes_ = new QuotedAssetSet(benchmarkQuotesNode);
             }
         }
         else
         {
             benchmarkQuotes_ = new QuotedAssetSet(benchmarkQuotesNode);
         }
     }
     
 
     XmlNode pricingStructureNode = xmlNode.SelectSingleNode("pricingStructure");
     
     if (pricingStructureNode != null)
     {
         if (pricingStructureNode.Attributes["href"] != null || pricingStructureNode.Attributes["id"] != null) 
         {
             if (pricingStructureNode.Attributes["id"] != null) 
             {
                 pricingStructureIDRef_ = pricingStructureNode.Attributes["id"].Value;
                 PricingStructure ob = new PricingStructure(pricingStructureNode);
                 IDManager.SetID(pricingStructureIDRef_, ob);
             }
             else if (pricingStructureNode.Attributes["href"] != null)
             {
                 pricingStructureIDRef_ = pricingStructureNode.Attributes["href"].Value;
             }
             else
             {
                 pricingStructure_ = new PricingStructure(pricingStructureNode);
             }
         }
         else
         {
             pricingStructure_ = new PricingStructure(pricingStructureNode);
         }
     }
     
 
     XmlNode creditCurveNode = xmlNode.SelectSingleNode("creditCurve");
     
     if (creditCurveNode != null)
     {
         if (creditCurveNode.Attributes["href"] != null || creditCurveNode.Attributes["id"] != null) 
         {
             if (creditCurveNode.Attributes["id"] != null) 
             {
                 creditCurveIDRef_ = creditCurveNode.Attributes["id"].Value;
                 CreditCurve ob = new CreditCurve(creditCurveNode);
                 IDManager.SetID(creditCurveIDRef_, ob);
             }
             else if (creditCurveNode.Attributes["href"] != null)
             {
                 creditCurveIDRef_ = creditCurveNode.Attributes["href"].Value;
             }
             else
             {
                 creditCurve_ = new CreditCurve(creditCurveNode);
             }
         }
         else
         {
             creditCurve_ = new CreditCurve(creditCurveNode);
         }
     }
     
 
     XmlNode fxCurveNode = xmlNode.SelectSingleNode("fxCurve");
     
     if (fxCurveNode != null)
     {
         if (fxCurveNode.Attributes["href"] != null || fxCurveNode.Attributes["id"] != null) 
         {
             if (fxCurveNode.Attributes["id"] != null) 
             {
                 fxCurveIDRef_ = fxCurveNode.Attributes["id"].Value;
                 FxCurve ob = new FxCurve(fxCurveNode);
                 IDManager.SetID(fxCurveIDRef_, ob);
             }
             else if (fxCurveNode.Attributes["href"] != null)
             {
                 fxCurveIDRef_ = fxCurveNode.Attributes["href"].Value;
             }
             else
             {
                 fxCurve_ = new FxCurve(fxCurveNode);
             }
         }
         else
         {
             fxCurve_ = new FxCurve(fxCurveNode);
         }
     }
     
 
     XmlNode volatilityRepresentationNode = xmlNode.SelectSingleNode("volatilityRepresentation");
     
     if (volatilityRepresentationNode != null)
     {
         if (volatilityRepresentationNode.Attributes["href"] != null || volatilityRepresentationNode.Attributes["id"] != null) 
         {
             if (volatilityRepresentationNode.Attributes["id"] != null) 
             {
                 volatilityRepresentationIDRef_ = volatilityRepresentationNode.Attributes["id"].Value;
                 VolatilityRepresentation ob = new VolatilityRepresentation(volatilityRepresentationNode);
                 IDManager.SetID(volatilityRepresentationIDRef_, ob);
             }
             else if (volatilityRepresentationNode.Attributes["href"] != null)
             {
                 volatilityRepresentationIDRef_ = volatilityRepresentationNode.Attributes["href"].Value;
             }
             else
             {
                 volatilityRepresentation_ = new VolatilityRepresentation(volatilityRepresentationNode);
             }
         }
         else
         {
             volatilityRepresentation_ = new VolatilityRepresentation(volatilityRepresentationNode);
         }
     }
     
 
     XmlNode yieldCurveNode = xmlNode.SelectSingleNode("yieldCurve");
     
     if (yieldCurveNode != null)
     {
         if (yieldCurveNode.Attributes["href"] != null || yieldCurveNode.Attributes["id"] != null) 
         {
             if (yieldCurveNode.Attributes["id"] != null) 
             {
                 yieldCurveIDRef_ = yieldCurveNode.Attributes["id"].Value;
                 YieldCurve ob = new YieldCurve(yieldCurveNode);
                 IDManager.SetID(yieldCurveIDRef_, ob);
             }
             else if (yieldCurveNode.Attributes["href"] != null)
             {
                 yieldCurveIDRef_ = yieldCurveNode.Attributes["href"].Value;
             }
             else
             {
                 yieldCurve_ = new YieldCurve(yieldCurveNode);
             }
         }
         else
         {
             yieldCurve_ = new YieldCurve(yieldCurveNode);
         }
     }
     
 
     XmlNode pricingStructureValuationNode = xmlNode.SelectSingleNode("pricingStructureValuation");
     
     if (pricingStructureValuationNode != null)
     {
         if (pricingStructureValuationNode.Attributes["href"] != null || pricingStructureValuationNode.Attributes["id"] != null) 
         {
             if (pricingStructureValuationNode.Attributes["id"] != null) 
             {
                 pricingStructureValuationIDRef_ = pricingStructureValuationNode.Attributes["id"].Value;
                 PricingStructureValuation ob = new PricingStructureValuation(pricingStructureValuationNode);
                 IDManager.SetID(pricingStructureValuationIDRef_, ob);
             }
             else if (pricingStructureValuationNode.Attributes["href"] != null)
             {
                 pricingStructureValuationIDRef_ = pricingStructureValuationNode.Attributes["href"].Value;
             }
             else
             {
                 pricingStructureValuation_ = new PricingStructureValuation(pricingStructureValuationNode);
             }
         }
         else
         {
             pricingStructureValuation_ = new PricingStructureValuation(pricingStructureValuationNode);
         }
     }
     
 
     XmlNode creditCurveValuationNode = xmlNode.SelectSingleNode("creditCurveValuation");
     
     if (creditCurveValuationNode != null)
     {
         if (creditCurveValuationNode.Attributes["href"] != null || creditCurveValuationNode.Attributes["id"] != null) 
         {
             if (creditCurveValuationNode.Attributes["id"] != null) 
             {
                 creditCurveValuationIDRef_ = creditCurveValuationNode.Attributes["id"].Value;
                 CreditCurveValuation ob = new CreditCurveValuation(creditCurveValuationNode);
                 IDManager.SetID(creditCurveValuationIDRef_, ob);
             }
             else if (creditCurveValuationNode.Attributes["href"] != null)
             {
                 creditCurveValuationIDRef_ = creditCurveValuationNode.Attributes["href"].Value;
             }
             else
             {
                 creditCurveValuation_ = new CreditCurveValuation(creditCurveValuationNode);
             }
         }
         else
         {
             creditCurveValuation_ = new CreditCurveValuation(creditCurveValuationNode);
         }
     }
     
 
     XmlNode fxCurveValuationNode = xmlNode.SelectSingleNode("fxCurveValuation");
     
     if (fxCurveValuationNode != null)
     {
         if (fxCurveValuationNode.Attributes["href"] != null || fxCurveValuationNode.Attributes["id"] != null) 
         {
             if (fxCurveValuationNode.Attributes["id"] != null) 
             {
                 fxCurveValuationIDRef_ = fxCurveValuationNode.Attributes["id"].Value;
                 FxCurveValuation ob = new FxCurveValuation(fxCurveValuationNode);
                 IDManager.SetID(fxCurveValuationIDRef_, ob);
             }
             else if (fxCurveValuationNode.Attributes["href"] != null)
             {
                 fxCurveValuationIDRef_ = fxCurveValuationNode.Attributes["href"].Value;
             }
             else
             {
                 fxCurveValuation_ = new FxCurveValuation(fxCurveValuationNode);
             }
         }
         else
         {
             fxCurveValuation_ = new FxCurveValuation(fxCurveValuationNode);
         }
     }
     
 
     XmlNode volatilityMatrixValuationNode = xmlNode.SelectSingleNode("volatilityMatrixValuation");
     
     if (volatilityMatrixValuationNode != null)
     {
         if (volatilityMatrixValuationNode.Attributes["href"] != null || volatilityMatrixValuationNode.Attributes["id"] != null) 
         {
             if (volatilityMatrixValuationNode.Attributes["id"] != null) 
             {
                 volatilityMatrixValuationIDRef_ = volatilityMatrixValuationNode.Attributes["id"].Value;
                 VolatilityMatrix ob = new VolatilityMatrix(volatilityMatrixValuationNode);
                 IDManager.SetID(volatilityMatrixValuationIDRef_, ob);
             }
             else if (volatilityMatrixValuationNode.Attributes["href"] != null)
             {
                 volatilityMatrixValuationIDRef_ = volatilityMatrixValuationNode.Attributes["href"].Value;
             }
             else
             {
                 volatilityMatrixValuation_ = new VolatilityMatrix(volatilityMatrixValuationNode);
             }
         }
         else
         {
             volatilityMatrixValuation_ = new VolatilityMatrix(volatilityMatrixValuationNode);
         }
     }
     
 
     XmlNode yieldCurveValuationNode = xmlNode.SelectSingleNode("yieldCurveValuation");
     
     if (yieldCurveValuationNode != null)
     {
         if (yieldCurveValuationNode.Attributes["href"] != null || yieldCurveValuationNode.Attributes["id"] != null) 
         {
             if (yieldCurveValuationNode.Attributes["id"] != null) 
             {
                 yieldCurveValuationIDRef_ = yieldCurveValuationNode.Attributes["id"].Value;
                 YieldCurveValuation ob = new YieldCurveValuation(yieldCurveValuationNode);
                 IDManager.SetID(yieldCurveValuationIDRef_, ob);
             }
             else if (yieldCurveValuationNode.Attributes["href"] != null)
             {
                 yieldCurveValuationIDRef_ = yieldCurveValuationNode.Attributes["href"].Value;
             }
             else
             {
                 yieldCurveValuation_ = new YieldCurveValuation(yieldCurveValuationNode);
             }
         }
         else
         {
             yieldCurveValuation_ = new YieldCurveValuation(yieldCurveValuationNode);
         }
     }
     
 
     XmlNodeList benchmarkPricingMethodNodeList = xmlNode.SelectNodes("benchmarkPricingMethod");
     
     if (benchmarkPricingMethodNodeList != null)
     {
         this.benchmarkPricingMethod_ = new List<PricingMethod>();
         foreach (XmlNode item in benchmarkPricingMethodNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     benchmarkPricingMethodIDRef_ = item.Attributes["id"].Value;
                     benchmarkPricingMethod_.Add(new PricingMethod(item));
                     IDManager.SetID(benchmarkPricingMethodIDRef_, benchmarkPricingMethod_[benchmarkPricingMethod_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     benchmarkPricingMethodIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 benchmarkPricingMethod_.Add(new PricingMethod(item));
                 }
             }
             else
             {
                 benchmarkPricingMethod_.Add(new PricingMethod(item));
             }
         }
     }
     
 
 }
Example #2
0
        public Market(XmlNode xmlNode)
        {
            XmlNodeList nameNodeList = xmlNode.SelectNodes("name");

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

            foreach (XmlNode item in nameNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        nameIDRef = item.Attributes["id"].Name;
                        XsdTypeString ob = XsdTypeString();
                        IDManager.SetID(nameIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        nameIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        name = new XsdTypeString(item);
                    }
                }
            }


            XmlNodeList benchmarkQuotesNodeList = xmlNode.SelectNodes("benchmarkQuotes");

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

            foreach (XmlNode item in benchmarkQuotesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        benchmarkQuotesIDRef = item.Attributes["id"].Name;
                        QuotedAssetSet ob = QuotedAssetSet();
                        IDManager.SetID(benchmarkQuotesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        benchmarkQuotesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        benchmarkQuotes = new QuotedAssetSet(item);
                    }
                }
            }


            XmlNodeList pricingStructureNodeList = xmlNode.SelectNodes("pricingStructure");

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

            foreach (XmlNode item in pricingStructureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pricingStructureIDRef = item.Attributes["id"].Name;
                        PricingStructure ob = PricingStructure();
                        IDManager.SetID(pricingStructureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pricingStructureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pricingStructure = new PricingStructure(item);
                    }
                }
            }


            XmlNodeList creditCurveNodeList = xmlNode.SelectNodes("creditCurve");

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

            foreach (XmlNode item in creditCurveNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        creditCurveIDRef = item.Attributes["id"].Name;
                        CreditCurve ob = CreditCurve();
                        IDManager.SetID(creditCurveIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        creditCurveIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        creditCurve = new CreditCurve(item);
                    }
                }
            }


            XmlNodeList fxCurveNodeList = xmlNode.SelectNodes("fxCurve");

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

            foreach (XmlNode item in fxCurveNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxCurveIDRef = item.Attributes["id"].Name;
                        FxCurve ob = FxCurve();
                        IDManager.SetID(fxCurveIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxCurveIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fxCurve = new FxCurve(item);
                    }
                }
            }


            XmlNodeList volatilityRepresentationNodeList = xmlNode.SelectNodes("volatilityRepresentation");

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

            foreach (XmlNode item in volatilityRepresentationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        volatilityRepresentationIDRef = item.Attributes["id"].Name;
                        VolatilityRepresentation ob = VolatilityRepresentation();
                        IDManager.SetID(volatilityRepresentationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        volatilityRepresentationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        volatilityRepresentation = new VolatilityRepresentation(item);
                    }
                }
            }


            XmlNodeList yieldCurveNodeList = xmlNode.SelectNodes("yieldCurve");

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

            foreach (XmlNode item in yieldCurveNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        yieldCurveIDRef = item.Attributes["id"].Name;
                        YieldCurve ob = YieldCurve();
                        IDManager.SetID(yieldCurveIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        yieldCurveIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        yieldCurve = new YieldCurve(item);
                    }
                }
            }


            XmlNodeList pricingStructureValuationNodeList = xmlNode.SelectNodes("pricingStructureValuation");

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

            foreach (XmlNode item in pricingStructureValuationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pricingStructureValuationIDRef = item.Attributes["id"].Name;
                        PricingStructureValuation ob = PricingStructureValuation();
                        IDManager.SetID(pricingStructureValuationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pricingStructureValuationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pricingStructureValuation = new PricingStructureValuation(item);
                    }
                }
            }


            XmlNodeList creditCurveValuationNodeList = xmlNode.SelectNodes("creditCurveValuation");

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

            foreach (XmlNode item in creditCurveValuationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        creditCurveValuationIDRef = item.Attributes["id"].Name;
                        CreditCurveValuation ob = CreditCurveValuation();
                        IDManager.SetID(creditCurveValuationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        creditCurveValuationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        creditCurveValuation = new CreditCurveValuation(item);
                    }
                }
            }


            XmlNodeList fxCurveValuationNodeList = xmlNode.SelectNodes("fxCurveValuation");

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

            foreach (XmlNode item in fxCurveValuationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxCurveValuationIDRef = item.Attributes["id"].Name;
                        FxCurveValuation ob = FxCurveValuation();
                        IDManager.SetID(fxCurveValuationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxCurveValuationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fxCurveValuation = new FxCurveValuation(item);
                    }
                }
            }


            XmlNodeList volatilityMatrixValuationNodeList = xmlNode.SelectNodes("volatilityMatrixValuation");

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

            foreach (XmlNode item in volatilityMatrixValuationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        volatilityMatrixValuationIDRef = item.Attributes["id"].Name;
                        VolatilityMatrix ob = VolatilityMatrix();
                        IDManager.SetID(volatilityMatrixValuationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        volatilityMatrixValuationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        volatilityMatrixValuation = new VolatilityMatrix(item);
                    }
                }
            }


            XmlNodeList yieldCurveValuationNodeList = xmlNode.SelectNodes("yieldCurveValuation");

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

            foreach (XmlNode item in yieldCurveValuationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        yieldCurveValuationIDRef = item.Attributes["id"].Name;
                        YieldCurveValuation ob = YieldCurveValuation();
                        IDManager.SetID(yieldCurveValuationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        yieldCurveValuationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        yieldCurveValuation = new YieldCurveValuation(item);
                    }
                }
            }


            XmlNodeList benchmarkPricingMethodNodeList = xmlNode.SelectNodes("benchmarkPricingMethod");

            foreach (XmlNode item in benchmarkPricingMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        benchmarkPricingMethodIDRef = item.Attributes["id"].Name;
                        List <PricingMethod> ob = new List <PricingMethod>();
                        ob.Add(new PricingMethod(item));
                        IDManager.SetID(benchmarkPricingMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        benchmarkPricingMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        benchmarkPricingMethod.Add(new PricingMethod(item));
                    }
                }
            }
        }
 public Market(XmlNode xmlNode)
 {
     XmlNodeList nameNodeList = xmlNode.SelectNodes("name");
     if (nameNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in nameNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 nameIDRef = item.Attributes["id"].Name;
                 XsdTypeString ob = XsdTypeString();
                 IDManager.SetID(nameIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 nameIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 name = new XsdTypeString(item);
             }
         }
     }
     
 
     XmlNodeList benchmarkQuotesNodeList = xmlNode.SelectNodes("benchmarkQuotes");
     if (benchmarkQuotesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in benchmarkQuotesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 benchmarkQuotesIDRef = item.Attributes["id"].Name;
                 QuotedAssetSet ob = QuotedAssetSet();
                 IDManager.SetID(benchmarkQuotesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 benchmarkQuotesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 benchmarkQuotes = new QuotedAssetSet(item);
             }
         }
     }
     
 
     XmlNodeList pricingStructureNodeList = xmlNode.SelectNodes("pricingStructure");
     if (pricingStructureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in pricingStructureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 pricingStructureIDRef = item.Attributes["id"].Name;
                 PricingStructure ob = PricingStructure();
                 IDManager.SetID(pricingStructureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 pricingStructureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 pricingStructure = new PricingStructure(item);
             }
         }
     }
     
 
     XmlNodeList creditCurveNodeList = xmlNode.SelectNodes("creditCurve");
     if (creditCurveNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in creditCurveNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 creditCurveIDRef = item.Attributes["id"].Name;
                 CreditCurve ob = CreditCurve();
                 IDManager.SetID(creditCurveIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 creditCurveIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 creditCurve = new CreditCurve(item);
             }
         }
     }
     
 
     XmlNodeList fxCurveNodeList = xmlNode.SelectNodes("fxCurve");
     if (fxCurveNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxCurveNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxCurveIDRef = item.Attributes["id"].Name;
                 FxCurve ob = FxCurve();
                 IDManager.SetID(fxCurveIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxCurveIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fxCurve = new FxCurve(item);
             }
         }
     }
     
 
     XmlNodeList volatilityRepresentationNodeList = xmlNode.SelectNodes("volatilityRepresentation");
     if (volatilityRepresentationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in volatilityRepresentationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 volatilityRepresentationIDRef = item.Attributes["id"].Name;
                 VolatilityRepresentation ob = VolatilityRepresentation();
                 IDManager.SetID(volatilityRepresentationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 volatilityRepresentationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 volatilityRepresentation = new VolatilityRepresentation(item);
             }
         }
     }
     
 
     XmlNodeList yieldCurveNodeList = xmlNode.SelectNodes("yieldCurve");
     if (yieldCurveNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in yieldCurveNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 yieldCurveIDRef = item.Attributes["id"].Name;
                 YieldCurve ob = YieldCurve();
                 IDManager.SetID(yieldCurveIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 yieldCurveIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 yieldCurve = new YieldCurve(item);
             }
         }
     }
     
 
     XmlNodeList pricingStructureValuationNodeList = xmlNode.SelectNodes("pricingStructureValuation");
     if (pricingStructureValuationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in pricingStructureValuationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 pricingStructureValuationIDRef = item.Attributes["id"].Name;
                 PricingStructureValuation ob = PricingStructureValuation();
                 IDManager.SetID(pricingStructureValuationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 pricingStructureValuationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 pricingStructureValuation = new PricingStructureValuation(item);
             }
         }
     }
     
 
     XmlNodeList creditCurveValuationNodeList = xmlNode.SelectNodes("creditCurveValuation");
     if (creditCurveValuationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in creditCurveValuationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 creditCurveValuationIDRef = item.Attributes["id"].Name;
                 CreditCurveValuation ob = CreditCurveValuation();
                 IDManager.SetID(creditCurveValuationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 creditCurveValuationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 creditCurveValuation = new CreditCurveValuation(item);
             }
         }
     }
     
 
     XmlNodeList fxCurveValuationNodeList = xmlNode.SelectNodes("fxCurveValuation");
     if (fxCurveValuationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxCurveValuationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxCurveValuationIDRef = item.Attributes["id"].Name;
                 FxCurveValuation ob = FxCurveValuation();
                 IDManager.SetID(fxCurveValuationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxCurveValuationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fxCurveValuation = new FxCurveValuation(item);
             }
         }
     }
     
 
     XmlNodeList volatilityMatrixValuationNodeList = xmlNode.SelectNodes("volatilityMatrixValuation");
     if (volatilityMatrixValuationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in volatilityMatrixValuationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 volatilityMatrixValuationIDRef = item.Attributes["id"].Name;
                 VolatilityMatrix ob = VolatilityMatrix();
                 IDManager.SetID(volatilityMatrixValuationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 volatilityMatrixValuationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 volatilityMatrixValuation = new VolatilityMatrix(item);
             }
         }
     }
     
 
     XmlNodeList yieldCurveValuationNodeList = xmlNode.SelectNodes("yieldCurveValuation");
     if (yieldCurveValuationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in yieldCurveValuationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 yieldCurveValuationIDRef = item.Attributes["id"].Name;
                 YieldCurveValuation ob = YieldCurveValuation();
                 IDManager.SetID(yieldCurveValuationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 yieldCurveValuationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 yieldCurveValuation = new YieldCurveValuation(item);
             }
         }
     }
     
 
     XmlNodeList benchmarkPricingMethodNodeList = xmlNode.SelectNodes("benchmarkPricingMethod");
     
     foreach (XmlNode item in benchmarkPricingMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 benchmarkPricingMethodIDRef = item.Attributes["id"].Name;
                 List<PricingMethod> ob = new List<PricingMethod>();
                 ob.Add(new PricingMethod(item));
                 IDManager.SetID(benchmarkPricingMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 benchmarkPricingMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
             benchmarkPricingMethod.Add(new PricingMethod(item));
             }
         }
     }
     
 
 }
Example #4
0
        public Market(XmlNode xmlNode)
        {
            XmlNode nameNode = xmlNode.SelectSingleNode("name");

            if (nameNode != null)
            {
                if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null)
                {
                    if (nameNode.Attributes["id"] != null)
                    {
                        nameIDRef_ = nameNode.Attributes["id"].Value;
                        XsdTypeString ob = new XsdTypeString(nameNode);
                        IDManager.SetID(nameIDRef_, ob);
                    }
                    else if (nameNode.Attributes["href"] != null)
                    {
                        nameIDRef_ = nameNode.Attributes["href"].Value;
                    }
                    else
                    {
                        name_ = new XsdTypeString(nameNode);
                    }
                }
                else
                {
                    name_ = new XsdTypeString(nameNode);
                }
            }


            XmlNode benchmarkQuotesNode = xmlNode.SelectSingleNode("benchmarkQuotes");

            if (benchmarkQuotesNode != null)
            {
                if (benchmarkQuotesNode.Attributes["href"] != null || benchmarkQuotesNode.Attributes["id"] != null)
                {
                    if (benchmarkQuotesNode.Attributes["id"] != null)
                    {
                        benchmarkQuotesIDRef_ = benchmarkQuotesNode.Attributes["id"].Value;
                        QuotedAssetSet ob = new QuotedAssetSet(benchmarkQuotesNode);
                        IDManager.SetID(benchmarkQuotesIDRef_, ob);
                    }
                    else if (benchmarkQuotesNode.Attributes["href"] != null)
                    {
                        benchmarkQuotesIDRef_ = benchmarkQuotesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        benchmarkQuotes_ = new QuotedAssetSet(benchmarkQuotesNode);
                    }
                }
                else
                {
                    benchmarkQuotes_ = new QuotedAssetSet(benchmarkQuotesNode);
                }
            }


            XmlNode pricingStructureNode = xmlNode.SelectSingleNode("pricingStructure");

            if (pricingStructureNode != null)
            {
                if (pricingStructureNode.Attributes["href"] != null || pricingStructureNode.Attributes["id"] != null)
                {
                    if (pricingStructureNode.Attributes["id"] != null)
                    {
                        pricingStructureIDRef_ = pricingStructureNode.Attributes["id"].Value;
                        PricingStructure ob = new PricingStructure(pricingStructureNode);
                        IDManager.SetID(pricingStructureIDRef_, ob);
                    }
                    else if (pricingStructureNode.Attributes["href"] != null)
                    {
                        pricingStructureIDRef_ = pricingStructureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pricingStructure_ = new PricingStructure(pricingStructureNode);
                    }
                }
                else
                {
                    pricingStructure_ = new PricingStructure(pricingStructureNode);
                }
            }


            XmlNode creditCurveNode = xmlNode.SelectSingleNode("creditCurve");

            if (creditCurveNode != null)
            {
                if (creditCurveNode.Attributes["href"] != null || creditCurveNode.Attributes["id"] != null)
                {
                    if (creditCurveNode.Attributes["id"] != null)
                    {
                        creditCurveIDRef_ = creditCurveNode.Attributes["id"].Value;
                        CreditCurve ob = new CreditCurve(creditCurveNode);
                        IDManager.SetID(creditCurveIDRef_, ob);
                    }
                    else if (creditCurveNode.Attributes["href"] != null)
                    {
                        creditCurveIDRef_ = creditCurveNode.Attributes["href"].Value;
                    }
                    else
                    {
                        creditCurve_ = new CreditCurve(creditCurveNode);
                    }
                }
                else
                {
                    creditCurve_ = new CreditCurve(creditCurveNode);
                }
            }


            XmlNode fxCurveNode = xmlNode.SelectSingleNode("fxCurve");

            if (fxCurveNode != null)
            {
                if (fxCurveNode.Attributes["href"] != null || fxCurveNode.Attributes["id"] != null)
                {
                    if (fxCurveNode.Attributes["id"] != null)
                    {
                        fxCurveIDRef_ = fxCurveNode.Attributes["id"].Value;
                        FxCurve ob = new FxCurve(fxCurveNode);
                        IDManager.SetID(fxCurveIDRef_, ob);
                    }
                    else if (fxCurveNode.Attributes["href"] != null)
                    {
                        fxCurveIDRef_ = fxCurveNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fxCurve_ = new FxCurve(fxCurveNode);
                    }
                }
                else
                {
                    fxCurve_ = new FxCurve(fxCurveNode);
                }
            }


            XmlNode volatilityRepresentationNode = xmlNode.SelectSingleNode("volatilityRepresentation");

            if (volatilityRepresentationNode != null)
            {
                if (volatilityRepresentationNode.Attributes["href"] != null || volatilityRepresentationNode.Attributes["id"] != null)
                {
                    if (volatilityRepresentationNode.Attributes["id"] != null)
                    {
                        volatilityRepresentationIDRef_ = volatilityRepresentationNode.Attributes["id"].Value;
                        VolatilityRepresentation ob = new VolatilityRepresentation(volatilityRepresentationNode);
                        IDManager.SetID(volatilityRepresentationIDRef_, ob);
                    }
                    else if (volatilityRepresentationNode.Attributes["href"] != null)
                    {
                        volatilityRepresentationIDRef_ = volatilityRepresentationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        volatilityRepresentation_ = new VolatilityRepresentation(volatilityRepresentationNode);
                    }
                }
                else
                {
                    volatilityRepresentation_ = new VolatilityRepresentation(volatilityRepresentationNode);
                }
            }


            XmlNode yieldCurveNode = xmlNode.SelectSingleNode("yieldCurve");

            if (yieldCurveNode != null)
            {
                if (yieldCurveNode.Attributes["href"] != null || yieldCurveNode.Attributes["id"] != null)
                {
                    if (yieldCurveNode.Attributes["id"] != null)
                    {
                        yieldCurveIDRef_ = yieldCurveNode.Attributes["id"].Value;
                        YieldCurve ob = new YieldCurve(yieldCurveNode);
                        IDManager.SetID(yieldCurveIDRef_, ob);
                    }
                    else if (yieldCurveNode.Attributes["href"] != null)
                    {
                        yieldCurveIDRef_ = yieldCurveNode.Attributes["href"].Value;
                    }
                    else
                    {
                        yieldCurve_ = new YieldCurve(yieldCurveNode);
                    }
                }
                else
                {
                    yieldCurve_ = new YieldCurve(yieldCurveNode);
                }
            }


            XmlNode pricingStructureValuationNode = xmlNode.SelectSingleNode("pricingStructureValuation");

            if (pricingStructureValuationNode != null)
            {
                if (pricingStructureValuationNode.Attributes["href"] != null || pricingStructureValuationNode.Attributes["id"] != null)
                {
                    if (pricingStructureValuationNode.Attributes["id"] != null)
                    {
                        pricingStructureValuationIDRef_ = pricingStructureValuationNode.Attributes["id"].Value;
                        PricingStructureValuation ob = new PricingStructureValuation(pricingStructureValuationNode);
                        IDManager.SetID(pricingStructureValuationIDRef_, ob);
                    }
                    else if (pricingStructureValuationNode.Attributes["href"] != null)
                    {
                        pricingStructureValuationIDRef_ = pricingStructureValuationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pricingStructureValuation_ = new PricingStructureValuation(pricingStructureValuationNode);
                    }
                }
                else
                {
                    pricingStructureValuation_ = new PricingStructureValuation(pricingStructureValuationNode);
                }
            }


            XmlNode creditCurveValuationNode = xmlNode.SelectSingleNode("creditCurveValuation");

            if (creditCurveValuationNode != null)
            {
                if (creditCurveValuationNode.Attributes["href"] != null || creditCurveValuationNode.Attributes["id"] != null)
                {
                    if (creditCurveValuationNode.Attributes["id"] != null)
                    {
                        creditCurveValuationIDRef_ = creditCurveValuationNode.Attributes["id"].Value;
                        CreditCurveValuation ob = new CreditCurveValuation(creditCurveValuationNode);
                        IDManager.SetID(creditCurveValuationIDRef_, ob);
                    }
                    else if (creditCurveValuationNode.Attributes["href"] != null)
                    {
                        creditCurveValuationIDRef_ = creditCurveValuationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        creditCurveValuation_ = new CreditCurveValuation(creditCurveValuationNode);
                    }
                }
                else
                {
                    creditCurveValuation_ = new CreditCurveValuation(creditCurveValuationNode);
                }
            }


            XmlNode fxCurveValuationNode = xmlNode.SelectSingleNode("fxCurveValuation");

            if (fxCurveValuationNode != null)
            {
                if (fxCurveValuationNode.Attributes["href"] != null || fxCurveValuationNode.Attributes["id"] != null)
                {
                    if (fxCurveValuationNode.Attributes["id"] != null)
                    {
                        fxCurveValuationIDRef_ = fxCurveValuationNode.Attributes["id"].Value;
                        FxCurveValuation ob = new FxCurveValuation(fxCurveValuationNode);
                        IDManager.SetID(fxCurveValuationIDRef_, ob);
                    }
                    else if (fxCurveValuationNode.Attributes["href"] != null)
                    {
                        fxCurveValuationIDRef_ = fxCurveValuationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fxCurveValuation_ = new FxCurveValuation(fxCurveValuationNode);
                    }
                }
                else
                {
                    fxCurveValuation_ = new FxCurveValuation(fxCurveValuationNode);
                }
            }


            XmlNode volatilityMatrixValuationNode = xmlNode.SelectSingleNode("volatilityMatrixValuation");

            if (volatilityMatrixValuationNode != null)
            {
                if (volatilityMatrixValuationNode.Attributes["href"] != null || volatilityMatrixValuationNode.Attributes["id"] != null)
                {
                    if (volatilityMatrixValuationNode.Attributes["id"] != null)
                    {
                        volatilityMatrixValuationIDRef_ = volatilityMatrixValuationNode.Attributes["id"].Value;
                        VolatilityMatrix ob = new VolatilityMatrix(volatilityMatrixValuationNode);
                        IDManager.SetID(volatilityMatrixValuationIDRef_, ob);
                    }
                    else if (volatilityMatrixValuationNode.Attributes["href"] != null)
                    {
                        volatilityMatrixValuationIDRef_ = volatilityMatrixValuationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        volatilityMatrixValuation_ = new VolatilityMatrix(volatilityMatrixValuationNode);
                    }
                }
                else
                {
                    volatilityMatrixValuation_ = new VolatilityMatrix(volatilityMatrixValuationNode);
                }
            }


            XmlNode yieldCurveValuationNode = xmlNode.SelectSingleNode("yieldCurveValuation");

            if (yieldCurveValuationNode != null)
            {
                if (yieldCurveValuationNode.Attributes["href"] != null || yieldCurveValuationNode.Attributes["id"] != null)
                {
                    if (yieldCurveValuationNode.Attributes["id"] != null)
                    {
                        yieldCurveValuationIDRef_ = yieldCurveValuationNode.Attributes["id"].Value;
                        YieldCurveValuation ob = new YieldCurveValuation(yieldCurveValuationNode);
                        IDManager.SetID(yieldCurveValuationIDRef_, ob);
                    }
                    else if (yieldCurveValuationNode.Attributes["href"] != null)
                    {
                        yieldCurveValuationIDRef_ = yieldCurveValuationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        yieldCurveValuation_ = new YieldCurveValuation(yieldCurveValuationNode);
                    }
                }
                else
                {
                    yieldCurveValuation_ = new YieldCurveValuation(yieldCurveValuationNode);
                }
            }


            XmlNodeList benchmarkPricingMethodNodeList = xmlNode.SelectNodes("benchmarkPricingMethod");

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