public FxFeature(XmlNode xmlNode)
 {
     XmlNode referenceCurrencyNode = xmlNode.SelectSingleNode("referenceCurrency");
     
     if (referenceCurrencyNode != null)
     {
         if (referenceCurrencyNode.Attributes["href"] != null || referenceCurrencyNode.Attributes["id"] != null) 
         {
             if (referenceCurrencyNode.Attributes["id"] != null) 
             {
                 referenceCurrencyIDRef_ = referenceCurrencyNode.Attributes["id"].Value;
                 IdentifiedCurrency ob = new IdentifiedCurrency(referenceCurrencyNode);
                 IDManager.SetID(referenceCurrencyIDRef_, ob);
             }
             else if (referenceCurrencyNode.Attributes["href"] != null)
             {
                 referenceCurrencyIDRef_ = referenceCurrencyNode.Attributes["href"].Value;
             }
             else
             {
                 referenceCurrency_ = new IdentifiedCurrency(referenceCurrencyNode);
             }
         }
         else
         {
             referenceCurrency_ = new IdentifiedCurrency(referenceCurrencyNode);
         }
     }
     
 
     XmlNode compositeNode = xmlNode.SelectSingleNode("composite");
     
     if (compositeNode != null)
     {
         if (compositeNode.Attributes["href"] != null || compositeNode.Attributes["id"] != null) 
         {
             if (compositeNode.Attributes["id"] != null) 
             {
                 compositeIDRef_ = compositeNode.Attributes["id"].Value;
                 Composite ob = new Composite(compositeNode);
                 IDManager.SetID(compositeIDRef_, ob);
             }
             else if (compositeNode.Attributes["href"] != null)
             {
                 compositeIDRef_ = compositeNode.Attributes["href"].Value;
             }
             else
             {
                 composite_ = new Composite(compositeNode);
             }
         }
         else
         {
             composite_ = new Composite(compositeNode);
         }
     }
     
 
     XmlNode quantoNode = xmlNode.SelectSingleNode("quanto");
     
     if (quantoNode != null)
     {
         if (quantoNode.Attributes["href"] != null || quantoNode.Attributes["id"] != null) 
         {
             if (quantoNode.Attributes["id"] != null) 
             {
                 quantoIDRef_ = quantoNode.Attributes["id"].Value;
                 Quanto ob = new Quanto(quantoNode);
                 IDManager.SetID(quantoIDRef_, ob);
             }
             else if (quantoNode.Attributes["href"] != null)
             {
                 quantoIDRef_ = quantoNode.Attributes["href"].Value;
             }
             else
             {
                 quanto_ = new Quanto(quantoNode);
             }
         }
         else
         {
             quanto_ = new Quanto(quantoNode);
         }
     }
     
 
     XmlNode crossCurrencyNode = xmlNode.SelectSingleNode("crossCurrency");
     
     if (crossCurrencyNode != null)
     {
         if (crossCurrencyNode.Attributes["href"] != null || crossCurrencyNode.Attributes["id"] != null) 
         {
             if (crossCurrencyNode.Attributes["id"] != null) 
             {
                 crossCurrencyIDRef_ = crossCurrencyNode.Attributes["id"].Value;
                 Composite ob = new Composite(crossCurrencyNode);
                 IDManager.SetID(crossCurrencyIDRef_, ob);
             }
             else if (crossCurrencyNode.Attributes["href"] != null)
             {
                 crossCurrencyIDRef_ = crossCurrencyNode.Attributes["href"].Value;
             }
             else
             {
                 crossCurrency_ = new Composite(crossCurrencyNode);
             }
         }
         else
         {
             crossCurrency_ = new Composite(crossCurrencyNode);
         }
     }
     
 
 }
        public LegAmount(XmlNode xmlNode)
        {
            XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");

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

            foreach (XmlNode item in currencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(currencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod");

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

            foreach (XmlNode item in determinationMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        determinationMethodIDRef = item.Attributes["id"].Name;
                        DeterminationMethod ob = DeterminationMethod();
                        IDManager.SetID(determinationMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        determinationMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        determinationMethod = new DeterminationMethod(item);
                    }
                }
            }


            XmlNodeList currencyReferenceNodeList = xmlNode.SelectNodes("currencyReference");

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

            foreach (XmlNode item in currencyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyReferenceIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrencyReference ob = IdentifiedCurrencyReference();
                        IDManager.SetID(currencyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currencyReference = new IdentifiedCurrencyReference(item);
                    }
                }
            }


            XmlNodeList referenceAmountNodeList = xmlNode.SelectNodes("referenceAmount");

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

            foreach (XmlNode item in referenceAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        referenceAmountIDRef = item.Attributes["id"].Name;
                        ReferenceAmount ob = ReferenceAmount();
                        IDManager.SetID(referenceAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        referenceAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        referenceAmount = new ReferenceAmount(item);
                    }
                }
            }


            XmlNodeList formulaNodeList = xmlNode.SelectNodes("formula");

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

            foreach (XmlNode item in formulaNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        formulaIDRef = item.Attributes["id"].Name;
                        Formula ob = Formula();
                        IDManager.SetID(formulaIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        formulaIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        formula = new Formula(item);
                    }
                }
            }


            XmlNodeList encodedDescriptionNodeList = xmlNode.SelectNodes("encodedDescription");

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

            foreach (XmlNode item in encodedDescriptionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        encodedDescriptionIDRef = item.Attributes["id"].Name;
                        XsdTypeBase64Binary ob = XsdTypeBase64Binary();
                        IDManager.SetID(encodedDescriptionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        encodedDescriptionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        encodedDescription = new XsdTypeBase64Binary(item);
                    }
                }
            }


            XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates");

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

            foreach (XmlNode item in calculationDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationDatesIDRef = item.Attributes["id"].Name;
                        AdjustableRelativeOrPeriodicDates ob = AdjustableRelativeOrPeriodicDates();
                        IDManager.SetID(calculationDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationDates = new AdjustableRelativeOrPeriodicDates(item);
                    }
                }
            }
        }
Esempio n. 3
0
        public CommoditySwaptionUnderlying(XmlNode xmlNode)
        {
            XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");

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

            foreach (XmlNode item in effectiveDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        effectiveDateIDRef = item.Attributes["id"].Name;
                        AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                        IDManager.SetID(effectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        effectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        effectiveDate = new AdjustableOrRelativeDate(item);
                    }
                }
            }


            XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate");

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

            foreach (XmlNode item in terminationDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        terminationDateIDRef = item.Attributes["id"].Name;
                        AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                        IDManager.SetID(terminationDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        terminationDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        terminationDate = new AdjustableOrRelativeDate(item);
                    }
                }
            }


            XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");

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

            foreach (XmlNode item in settlementCurrencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementCurrencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(settlementCurrencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementCurrencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementCurrency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList commoditySwapLegNodeList = xmlNode.SelectNodes("commoditySwapLeg");

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

            foreach (XmlNode item in commoditySwapLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commoditySwapLegIDRef = item.Attributes["id"].Name;
                        CommoditySwapLeg ob = CommoditySwapLeg();
                        IDManager.SetID(commoditySwapLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commoditySwapLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commoditySwapLeg = new CommoditySwapLeg(item);
                    }
                }
            }


            XmlNodeList coalPhysicalLegNodeList = xmlNode.SelectNodes("coalPhysicalLeg");

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

            foreach (XmlNode item in coalPhysicalLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        coalPhysicalLegIDRef = item.Attributes["id"].Name;
                        CoalPhysicalLeg ob = CoalPhysicalLeg();
                        IDManager.SetID(coalPhysicalLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        coalPhysicalLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        coalPhysicalLeg = new CoalPhysicalLeg(item);
                    }
                }
            }


            XmlNodeList electricityPhysicalLegNodeList = xmlNode.SelectNodes("electricityPhysicalLeg");

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

            foreach (XmlNode item in electricityPhysicalLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        electricityPhysicalLegIDRef = item.Attributes["id"].Name;
                        ElectricityPhysicalLeg ob = ElectricityPhysicalLeg();
                        IDManager.SetID(electricityPhysicalLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        electricityPhysicalLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        electricityPhysicalLeg = new ElectricityPhysicalLeg(item);
                    }
                }
            }


            XmlNodeList environmentalPhysicalLegNodeList = xmlNode.SelectNodes("environmentalPhysicalLeg");

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

            foreach (XmlNode item in environmentalPhysicalLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        environmentalPhysicalLegIDRef = item.Attributes["id"].Name;
                        EnvironmentalPhysicalLeg ob = EnvironmentalPhysicalLeg();
                        IDManager.SetID(environmentalPhysicalLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        environmentalPhysicalLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        environmentalPhysicalLeg = new EnvironmentalPhysicalLeg(item);
                    }
                }
            }


            XmlNodeList fixedLegNodeList = xmlNode.SelectNodes("fixedLeg");

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

            foreach (XmlNode item in fixedLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedLegIDRef = item.Attributes["id"].Name;
                        FixedPriceLeg ob = FixedPriceLeg();
                        IDManager.SetID(fixedLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedLeg = new FixedPriceLeg(item);
                    }
                }
            }


            XmlNodeList floatingLegNodeList = xmlNode.SelectNodes("floatingLeg");

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

            foreach (XmlNode item in floatingLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        floatingLegIDRef = item.Attributes["id"].Name;
                        FloatingPriceLeg ob = FloatingPriceLeg();
                        IDManager.SetID(floatingLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        floatingLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        floatingLeg = new FloatingPriceLeg(item);
                    }
                }
            }


            XmlNodeList gasPhysicalLegNodeList = xmlNode.SelectNodes("gasPhysicalLeg");

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

            foreach (XmlNode item in gasPhysicalLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        gasPhysicalLegIDRef = item.Attributes["id"].Name;
                        GasPhysicalLeg ob = GasPhysicalLeg();
                        IDManager.SetID(gasPhysicalLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        gasPhysicalLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        gasPhysicalLeg = new GasPhysicalLeg(item);
                    }
                }
            }


            XmlNodeList oilPhysicalLegNodeList = xmlNode.SelectNodes("oilPhysicalLeg");

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

            foreach (XmlNode item in oilPhysicalLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        oilPhysicalLegIDRef = item.Attributes["id"].Name;
                        OilPhysicalLeg ob = OilPhysicalLeg();
                        IDManager.SetID(oilPhysicalLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        oilPhysicalLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        oilPhysicalLeg = new OilPhysicalLeg(item);
                    }
                }
            }


            XmlNodeList weatherLegNodeList = xmlNode.SelectNodes("weatherLeg");

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


            XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing");

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

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


            XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption");

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

            foreach (XmlNode item in marketDisruptionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        marketDisruptionIDRef = item.Attributes["id"].Name;
                        CommodityMarketDisruption ob = CommodityMarketDisruption();
                        IDManager.SetID(marketDisruptionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        marketDisruptionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        marketDisruption = new CommodityMarketDisruption(item);
                    }
                }
            }


            XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption");

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

            foreach (XmlNode item in settlementDisruptionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementDisruptionIDRef = item.Attributes["id"].Name;
                        CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum();
                        IDManager.SetID(settlementDisruptionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementDisruptionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item);
                    }
                }
            }


            XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding");

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

            foreach (XmlNode item in roundingNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        roundingIDRef = item.Attributes["id"].Name;
                        Rounding ob = Rounding();
                        IDManager.SetID(roundingIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        roundingIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        rounding = new Rounding(item);
                    }
                }
            }
        }
        public CommoditySwaptionUnderlying(XmlNode xmlNode)
        {
            XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");

            if (effectiveDateNode != null)
            {
                if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null)
                {
                    if (effectiveDateNode.Attributes["id"] != null)
                    {
                        effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                        AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(effectiveDateNode);
                        IDManager.SetID(effectiveDateIDRef_, ob);
                    }
                    else if (effectiveDateNode.Attributes["href"] != null)
                    {
                        effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
                    }
                }
                else
                {
                    effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
                }
            }


            XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate");

            if (terminationDateNode != null)
            {
                if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null)
                {
                    if (terminationDateNode.Attributes["id"] != null)
                    {
                        terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value;
                        AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(terminationDateNode);
                        IDManager.SetID(terminationDateIDRef_, ob);
                    }
                    else if (terminationDateNode.Attributes["href"] != null)
                    {
                        terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode);
                    }
                }
                else
                {
                    terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode);
                }
            }


            XmlNode settlementCurrencyNode = xmlNode.SelectSingleNode("settlementCurrency");

            if (settlementCurrencyNode != null)
            {
                if (settlementCurrencyNode.Attributes["href"] != null || settlementCurrencyNode.Attributes["id"] != null)
                {
                    if (settlementCurrencyNode.Attributes["id"] != null)
                    {
                        settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["id"].Value;
                        IdentifiedCurrency ob = new IdentifiedCurrency(settlementCurrencyNode);
                        IDManager.SetID(settlementCurrencyIDRef_, ob);
                    }
                    else if (settlementCurrencyNode.Attributes["href"] != null)
                    {
                        settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
                    }
                }
                else
                {
                    settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
                }
            }


            XmlNode commoditySwapLegNode = xmlNode.SelectSingleNode("commoditySwapLeg");

            if (commoditySwapLegNode != null)
            {
                if (commoditySwapLegNode.Attributes["href"] != null || commoditySwapLegNode.Attributes["id"] != null)
                {
                    if (commoditySwapLegNode.Attributes["id"] != null)
                    {
                        commoditySwapLegIDRef_ = commoditySwapLegNode.Attributes["id"].Value;
                        CommoditySwapLeg ob = new CommoditySwapLeg(commoditySwapLegNode);
                        IDManager.SetID(commoditySwapLegIDRef_, ob);
                    }
                    else if (commoditySwapLegNode.Attributes["href"] != null)
                    {
                        commoditySwapLegIDRef_ = commoditySwapLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        commoditySwapLeg_ = new CommoditySwapLeg(commoditySwapLegNode);
                    }
                }
                else
                {
                    commoditySwapLeg_ = new CommoditySwapLeg(commoditySwapLegNode);
                }
            }


            XmlNode coalPhysicalLegNode = xmlNode.SelectSingleNode("coalPhysicalLeg");

            if (coalPhysicalLegNode != null)
            {
                if (coalPhysicalLegNode.Attributes["href"] != null || coalPhysicalLegNode.Attributes["id"] != null)
                {
                    if (coalPhysicalLegNode.Attributes["id"] != null)
                    {
                        coalPhysicalLegIDRef_ = coalPhysicalLegNode.Attributes["id"].Value;
                        CoalPhysicalLeg ob = new CoalPhysicalLeg(coalPhysicalLegNode);
                        IDManager.SetID(coalPhysicalLegIDRef_, ob);
                    }
                    else if (coalPhysicalLegNode.Attributes["href"] != null)
                    {
                        coalPhysicalLegIDRef_ = coalPhysicalLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        coalPhysicalLeg_ = new CoalPhysicalLeg(coalPhysicalLegNode);
                    }
                }
                else
                {
                    coalPhysicalLeg_ = new CoalPhysicalLeg(coalPhysicalLegNode);
                }
            }


            XmlNode electricityPhysicalLegNode = xmlNode.SelectSingleNode("electricityPhysicalLeg");

            if (electricityPhysicalLegNode != null)
            {
                if (electricityPhysicalLegNode.Attributes["href"] != null || electricityPhysicalLegNode.Attributes["id"] != null)
                {
                    if (electricityPhysicalLegNode.Attributes["id"] != null)
                    {
                        electricityPhysicalLegIDRef_ = electricityPhysicalLegNode.Attributes["id"].Value;
                        ElectricityPhysicalLeg ob = new ElectricityPhysicalLeg(electricityPhysicalLegNode);
                        IDManager.SetID(electricityPhysicalLegIDRef_, ob);
                    }
                    else if (electricityPhysicalLegNode.Attributes["href"] != null)
                    {
                        electricityPhysicalLegIDRef_ = electricityPhysicalLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        electricityPhysicalLeg_ = new ElectricityPhysicalLeg(electricityPhysicalLegNode);
                    }
                }
                else
                {
                    electricityPhysicalLeg_ = new ElectricityPhysicalLeg(electricityPhysicalLegNode);
                }
            }


            XmlNode environmentalPhysicalLegNode = xmlNode.SelectSingleNode("environmentalPhysicalLeg");

            if (environmentalPhysicalLegNode != null)
            {
                if (environmentalPhysicalLegNode.Attributes["href"] != null || environmentalPhysicalLegNode.Attributes["id"] != null)
                {
                    if (environmentalPhysicalLegNode.Attributes["id"] != null)
                    {
                        environmentalPhysicalLegIDRef_ = environmentalPhysicalLegNode.Attributes["id"].Value;
                        EnvironmentalPhysicalLeg ob = new EnvironmentalPhysicalLeg(environmentalPhysicalLegNode);
                        IDManager.SetID(environmentalPhysicalLegIDRef_, ob);
                    }
                    else if (environmentalPhysicalLegNode.Attributes["href"] != null)
                    {
                        environmentalPhysicalLegIDRef_ = environmentalPhysicalLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        environmentalPhysicalLeg_ = new EnvironmentalPhysicalLeg(environmentalPhysicalLegNode);
                    }
                }
                else
                {
                    environmentalPhysicalLeg_ = new EnvironmentalPhysicalLeg(environmentalPhysicalLegNode);
                }
            }


            XmlNode fixedLegNode = xmlNode.SelectSingleNode("fixedLeg");

            if (fixedLegNode != null)
            {
                if (fixedLegNode.Attributes["href"] != null || fixedLegNode.Attributes["id"] != null)
                {
                    if (fixedLegNode.Attributes["id"] != null)
                    {
                        fixedLegIDRef_ = fixedLegNode.Attributes["id"].Value;
                        FixedPriceLeg ob = new FixedPriceLeg(fixedLegNode);
                        IDManager.SetID(fixedLegIDRef_, ob);
                    }
                    else if (fixedLegNode.Attributes["href"] != null)
                    {
                        fixedLegIDRef_ = fixedLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixedLeg_ = new FixedPriceLeg(fixedLegNode);
                    }
                }
                else
                {
                    fixedLeg_ = new FixedPriceLeg(fixedLegNode);
                }
            }


            XmlNode floatingLegNode = xmlNode.SelectSingleNode("floatingLeg");

            if (floatingLegNode != null)
            {
                if (floatingLegNode.Attributes["href"] != null || floatingLegNode.Attributes["id"] != null)
                {
                    if (floatingLegNode.Attributes["id"] != null)
                    {
                        floatingLegIDRef_ = floatingLegNode.Attributes["id"].Value;
                        FloatingPriceLeg ob = new FloatingPriceLeg(floatingLegNode);
                        IDManager.SetID(floatingLegIDRef_, ob);
                    }
                    else if (floatingLegNode.Attributes["href"] != null)
                    {
                        floatingLegIDRef_ = floatingLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        floatingLeg_ = new FloatingPriceLeg(floatingLegNode);
                    }
                }
                else
                {
                    floatingLeg_ = new FloatingPriceLeg(floatingLegNode);
                }
            }


            XmlNode gasPhysicalLegNode = xmlNode.SelectSingleNode("gasPhysicalLeg");

            if (gasPhysicalLegNode != null)
            {
                if (gasPhysicalLegNode.Attributes["href"] != null || gasPhysicalLegNode.Attributes["id"] != null)
                {
                    if (gasPhysicalLegNode.Attributes["id"] != null)
                    {
                        gasPhysicalLegIDRef_ = gasPhysicalLegNode.Attributes["id"].Value;
                        GasPhysicalLeg ob = new GasPhysicalLeg(gasPhysicalLegNode);
                        IDManager.SetID(gasPhysicalLegIDRef_, ob);
                    }
                    else if (gasPhysicalLegNode.Attributes["href"] != null)
                    {
                        gasPhysicalLegIDRef_ = gasPhysicalLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        gasPhysicalLeg_ = new GasPhysicalLeg(gasPhysicalLegNode);
                    }
                }
                else
                {
                    gasPhysicalLeg_ = new GasPhysicalLeg(gasPhysicalLegNode);
                }
            }


            XmlNode oilPhysicalLegNode = xmlNode.SelectSingleNode("oilPhysicalLeg");

            if (oilPhysicalLegNode != null)
            {
                if (oilPhysicalLegNode.Attributes["href"] != null || oilPhysicalLegNode.Attributes["id"] != null)
                {
                    if (oilPhysicalLegNode.Attributes["id"] != null)
                    {
                        oilPhysicalLegIDRef_ = oilPhysicalLegNode.Attributes["id"].Value;
                        OilPhysicalLeg ob = new OilPhysicalLeg(oilPhysicalLegNode);
                        IDManager.SetID(oilPhysicalLegIDRef_, ob);
                    }
                    else if (oilPhysicalLegNode.Attributes["href"] != null)
                    {
                        oilPhysicalLegIDRef_ = oilPhysicalLegNode.Attributes["href"].Value;
                    }
                    else
                    {
                        oilPhysicalLeg_ = new OilPhysicalLeg(oilPhysicalLegNode);
                    }
                }
                else
                {
                    oilPhysicalLeg_ = new OilPhysicalLeg(oilPhysicalLegNode);
                }
            }


            XmlNodeList weatherLegNodeList = xmlNode.SelectNodes("weatherLeg");

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


            XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing");

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


            XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption");

            if (marketDisruptionNode != null)
            {
                if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null)
                {
                    if (marketDisruptionNode.Attributes["id"] != null)
                    {
                        marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value;
                        CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode);
                        IDManager.SetID(marketDisruptionIDRef_, ob);
                    }
                    else if (marketDisruptionNode.Attributes["href"] != null)
                    {
                        marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
                    }
                }
                else
                {
                    marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
                }
            }


            XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption");

            if (settlementDisruptionNode != null)
            {
                if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null)
                {
                    if (settlementDisruptionNode.Attributes["id"] != null)
                    {
                        settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value;
                        CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                        IDManager.SetID(settlementDisruptionIDRef_, ob);
                    }
                    else if (settlementDisruptionNode.Attributes["href"] != null)
                    {
                        settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                    }
                }
                else
                {
                    settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                }
            }


            XmlNode roundingNode = xmlNode.SelectSingleNode("rounding");

            if (roundingNode != null)
            {
                if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null)
                {
                    if (roundingNode.Attributes["id"] != null)
                    {
                        roundingIDRef_ = roundingNode.Attributes["id"].Value;
                        Rounding ob = new Rounding(roundingNode);
                        IDManager.SetID(roundingIDRef_, ob);
                    }
                    else if (roundingNode.Attributes["href"] != null)
                    {
                        roundingIDRef_ = roundingNode.Attributes["href"].Value;
                    }
                    else
                    {
                        rounding_ = new Rounding(roundingNode);
                    }
                }
                else
                {
                    rounding_ = new Rounding(roundingNode);
                }
            }
        }
Esempio n. 5
0
        public LegAmount(XmlNode xmlNode)
        {
            XmlNode currencyNode = xmlNode.SelectSingleNode("currency");

            if (currencyNode != null)
            {
                if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null)
                {
                    if (currencyNode.Attributes["id"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["id"].Value;
                        IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode);
                        IDManager.SetID(currencyIDRef_, ob);
                    }
                    else if (currencyNode.Attributes["href"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currency_ = new IdentifiedCurrency(currencyNode);
                    }
                }
                else
                {
                    currency_ = new IdentifiedCurrency(currencyNode);
                }
            }


            XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod");

            if (determinationMethodNode != null)
            {
                if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null)
                {
                    if (determinationMethodNode.Attributes["id"] != null)
                    {
                        determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value;
                        DeterminationMethod ob = new DeterminationMethod(determinationMethodNode);
                        IDManager.SetID(determinationMethodIDRef_, ob);
                    }
                    else if (determinationMethodNode.Attributes["href"] != null)
                    {
                        determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        determinationMethod_ = new DeterminationMethod(determinationMethodNode);
                    }
                }
                else
                {
                    determinationMethod_ = new DeterminationMethod(determinationMethodNode);
                }
            }


            XmlNode currencyReferenceNode = xmlNode.SelectSingleNode("currencyReference");

            if (currencyReferenceNode != null)
            {
                if (currencyReferenceNode.Attributes["href"] != null || currencyReferenceNode.Attributes["id"] != null)
                {
                    if (currencyReferenceNode.Attributes["id"] != null)
                    {
                        currencyReferenceIDRef_ = currencyReferenceNode.Attributes["id"].Value;
                        IdentifiedCurrencyReference ob = new IdentifiedCurrencyReference(currencyReferenceNode);
                        IDManager.SetID(currencyReferenceIDRef_, ob);
                    }
                    else if (currencyReferenceNode.Attributes["href"] != null)
                    {
                        currencyReferenceIDRef_ = currencyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
                    }
                }
                else
                {
                    currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
                }
            }


            XmlNode referenceAmountNode = xmlNode.SelectSingleNode("referenceAmount");

            if (referenceAmountNode != null)
            {
                if (referenceAmountNode.Attributes["href"] != null || referenceAmountNode.Attributes["id"] != null)
                {
                    if (referenceAmountNode.Attributes["id"] != null)
                    {
                        referenceAmountIDRef_ = referenceAmountNode.Attributes["id"].Value;
                        ReferenceAmount ob = new ReferenceAmount(referenceAmountNode);
                        IDManager.SetID(referenceAmountIDRef_, ob);
                    }
                    else if (referenceAmountNode.Attributes["href"] != null)
                    {
                        referenceAmountIDRef_ = referenceAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        referenceAmount_ = new ReferenceAmount(referenceAmountNode);
                    }
                }
                else
                {
                    referenceAmount_ = new ReferenceAmount(referenceAmountNode);
                }
            }


            XmlNode formulaNode = xmlNode.SelectSingleNode("formula");

            if (formulaNode != null)
            {
                if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null)
                {
                    if (formulaNode.Attributes["id"] != null)
                    {
                        formulaIDRef_ = formulaNode.Attributes["id"].Value;
                        Formula ob = new Formula(formulaNode);
                        IDManager.SetID(formulaIDRef_, ob);
                    }
                    else if (formulaNode.Attributes["href"] != null)
                    {
                        formulaIDRef_ = formulaNode.Attributes["href"].Value;
                    }
                    else
                    {
                        formula_ = new Formula(formulaNode);
                    }
                }
                else
                {
                    formula_ = new Formula(formulaNode);
                }
            }


            XmlNode encodedDescriptionNode = xmlNode.SelectSingleNode("encodedDescription");

            if (encodedDescriptionNode != null)
            {
                if (encodedDescriptionNode.Attributes["href"] != null || encodedDescriptionNode.Attributes["id"] != null)
                {
                    if (encodedDescriptionNode.Attributes["id"] != null)
                    {
                        encodedDescriptionIDRef_ = encodedDescriptionNode.Attributes["id"].Value;
                        XsdTypeBase64Binary ob = new XsdTypeBase64Binary(encodedDescriptionNode);
                        IDManager.SetID(encodedDescriptionIDRef_, ob);
                    }
                    else if (encodedDescriptionNode.Attributes["href"] != null)
                    {
                        encodedDescriptionIDRef_ = encodedDescriptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        encodedDescription_ = new XsdTypeBase64Binary(encodedDescriptionNode);
                    }
                }
                else
                {
                    encodedDescription_ = new XsdTypeBase64Binary(encodedDescriptionNode);
                }
            }


            XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates");

            if (calculationDatesNode != null)
            {
                if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null)
                {
                    if (calculationDatesNode.Attributes["id"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                        AdjustableRelativeOrPeriodicDates ob = new AdjustableRelativeOrPeriodicDates(calculationDatesNode);
                        IDManager.SetID(calculationDatesIDRef_, ob);
                    }
                    else if (calculationDatesNode.Attributes["href"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationDates_ = new AdjustableRelativeOrPeriodicDates(calculationDatesNode);
                    }
                }
                else
                {
                    calculationDates_ = new AdjustableRelativeOrPeriodicDates(calculationDatesNode);
                }
            }
        }
Esempio n. 6
0
        public CommodityExercise(XmlNode xmlNode)
        {
            XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");

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

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


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

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

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


            XmlNodeList automaticExerciseNodeList = xmlNode.SelectNodes("automaticExercise");

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

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


            XmlNodeList writtenConfirmationNodeList = xmlNode.SelectNodes("writtenConfirmation");

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

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


            XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");

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

            foreach (XmlNode item in settlementCurrencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementCurrencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(settlementCurrencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementCurrencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementCurrency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList fxNodeList = xmlNode.SelectNodes("fx");

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

            foreach (XmlNode item in fxNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxIDRef = item.Attributes["id"].Name;
                        CommodityFx ob = CommodityFx();
                        IDManager.SetID(fxIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fx = new CommodityFx(item);
                    }
                }
            }


            XmlNodeList conversionFactorNodeList = xmlNode.SelectNodes("conversionFactor");

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

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


            XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates");

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

            foreach (XmlNode item in relativePaymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        relativePaymentDatesIDRef = item.Attributes["id"].Name;
                        CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                        IDManager.SetID(relativePaymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        relativePaymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        relativePaymentDates = new CommodityRelativePaymentDates(item);
                    }
                }
            }


            XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates");

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

            foreach (XmlNode item in paymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentDatesIDRef = item.Attributes["id"].Name;
                        AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset();
                        IDManager.SetID(paymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDates = new AdjustableDatesOrRelativeDateOffset(item);
                    }
                }
            }


            XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates");

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

            foreach (XmlNode item in masterAgreementPaymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(masterAgreementPaymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        masterAgreementPaymentDates = new XsdTypeBoolean(item);
                    }
                }
            }
        }
        public CommodityExercise(XmlNode xmlNode)
        {
            XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");

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


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

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


            XmlNode automaticExerciseNode = xmlNode.SelectSingleNode("automaticExercise");

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


            XmlNode writtenConfirmationNode = xmlNode.SelectSingleNode("writtenConfirmation");

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


            XmlNode settlementCurrencyNode = xmlNode.SelectSingleNode("settlementCurrency");

            if (settlementCurrencyNode != null)
            {
                if (settlementCurrencyNode.Attributes["href"] != null || settlementCurrencyNode.Attributes["id"] != null)
                {
                    if (settlementCurrencyNode.Attributes["id"] != null)
                    {
                        settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["id"].Value;
                        IdentifiedCurrency ob = new IdentifiedCurrency(settlementCurrencyNode);
                        IDManager.SetID(settlementCurrencyIDRef_, ob);
                    }
                    else if (settlementCurrencyNode.Attributes["href"] != null)
                    {
                        settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
                    }
                }
                else
                {
                    settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
                }
            }


            XmlNode fxNode = xmlNode.SelectSingleNode("fx");

            if (fxNode != null)
            {
                if (fxNode.Attributes["href"] != null || fxNode.Attributes["id"] != null)
                {
                    if (fxNode.Attributes["id"] != null)
                    {
                        fxIDRef_ = fxNode.Attributes["id"].Value;
                        CommodityFx ob = new CommodityFx(fxNode);
                        IDManager.SetID(fxIDRef_, ob);
                    }
                    else if (fxNode.Attributes["href"] != null)
                    {
                        fxIDRef_ = fxNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fx_ = new CommodityFx(fxNode);
                    }
                }
                else
                {
                    fx_ = new CommodityFx(fxNode);
                }
            }


            XmlNode conversionFactorNode = xmlNode.SelectSingleNode("conversionFactor");

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


            XmlNode relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates");

            if (relativePaymentDatesNode != null)
            {
                if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null)
                {
                    if (relativePaymentDatesNode.Attributes["id"] != null)
                    {
                        relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value;
                        CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                        IDManager.SetID(relativePaymentDatesIDRef_, ob);
                    }
                    else if (relativePaymentDatesNode.Attributes["href"] != null)
                    {
                        relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                    }
                }
                else
                {
                    relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                }
            }


            XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates");

            if (paymentDatesNode != null)
            {
                if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null)
                {
                    if (paymentDatesNode.Attributes["id"] != null)
                    {
                        paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value;
                        AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                        IDManager.SetID(paymentDatesIDRef_, ob);
                    }
                    else if (paymentDatesNode.Attributes["href"] != null)
                    {
                        paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                    }
                }
                else
                {
                    paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                }
            }


            XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates");

            if (masterAgreementPaymentDatesNode != null)
            {
                if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null)
                {
                    if (masterAgreementPaymentDatesNode.Attributes["id"] != null)
                    {
                        masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                        IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob);
                    }
                    else if (masterAgreementPaymentDatesNode.Attributes["href"] != null)
                    {
                        masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                    }
                }
                else
                {
                    masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                }
            }
        }
 public LegAmount(XmlNode xmlNode)
 {
     XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");
     if (currencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(currencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod");
     if (determinationMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in determinationMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 determinationMethodIDRef = item.Attributes["id"].Name;
                 DeterminationMethod ob = DeterminationMethod();
                 IDManager.SetID(determinationMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 determinationMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 determinationMethod = new DeterminationMethod(item);
             }
         }
     }
     
 
     XmlNodeList currencyReferenceNodeList = xmlNode.SelectNodes("currencyReference");
     if (currencyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyReferenceIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrencyReference ob = IdentifiedCurrencyReference();
                 IDManager.SetID(currencyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currencyReference = new IdentifiedCurrencyReference(item);
             }
         }
     }
     
 
     XmlNodeList referenceAmountNodeList = xmlNode.SelectNodes("referenceAmount");
     if (referenceAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in referenceAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 referenceAmountIDRef = item.Attributes["id"].Name;
                 ReferenceAmount ob = ReferenceAmount();
                 IDManager.SetID(referenceAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 referenceAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 referenceAmount = new ReferenceAmount(item);
             }
         }
     }
     
 
     XmlNodeList formulaNodeList = xmlNode.SelectNodes("formula");
     if (formulaNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in formulaNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 formulaIDRef = item.Attributes["id"].Name;
                 Formula ob = Formula();
                 IDManager.SetID(formulaIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 formulaIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 formula = new Formula(item);
             }
         }
     }
     
 
     XmlNodeList encodedDescriptionNodeList = xmlNode.SelectNodes("encodedDescription");
     if (encodedDescriptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in encodedDescriptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 encodedDescriptionIDRef = item.Attributes["id"].Name;
                 XsdTypeBase64Binary ob = XsdTypeBase64Binary();
                 IDManager.SetID(encodedDescriptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 encodedDescriptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 encodedDescription = new XsdTypeBase64Binary(item);
             }
         }
     }
     
 
     XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates");
     if (calculationDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationDatesIDRef = item.Attributes["id"].Name;
                 AdjustableRelativeOrPeriodicDates ob = AdjustableRelativeOrPeriodicDates();
                 IDManager.SetID(calculationDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationDates = new AdjustableRelativeOrPeriodicDates(item);
             }
         }
     }
     
 
 }
 public DividendConditions(XmlNode xmlNode)
 {
     XmlNode dividendReinvestmentNode = xmlNode.SelectSingleNode("dividendReinvestment");
     
     if (dividendReinvestmentNode != null)
     {
         if (dividendReinvestmentNode.Attributes["href"] != null || dividendReinvestmentNode.Attributes["id"] != null) 
         {
             if (dividendReinvestmentNode.Attributes["id"] != null) 
             {
                 dividendReinvestmentIDRef_ = dividendReinvestmentNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(dividendReinvestmentNode);
                 IDManager.SetID(dividendReinvestmentIDRef_, ob);
             }
             else if (dividendReinvestmentNode.Attributes["href"] != null)
             {
                 dividendReinvestmentIDRef_ = dividendReinvestmentNode.Attributes["href"].Value;
             }
             else
             {
                 dividendReinvestment_ = new XsdTypeBoolean(dividendReinvestmentNode);
             }
         }
         else
         {
             dividendReinvestment_ = new XsdTypeBoolean(dividendReinvestmentNode);
         }
     }
     
 
     XmlNode dividendEntitlementNode = xmlNode.SelectSingleNode("dividendEntitlement");
     
     if (dividendEntitlementNode != null)
     {
         if (dividendEntitlementNode.Attributes["href"] != null || dividendEntitlementNode.Attributes["id"] != null) 
         {
             if (dividendEntitlementNode.Attributes["id"] != null) 
             {
                 dividendEntitlementIDRef_ = dividendEntitlementNode.Attributes["id"].Value;
                 DividendEntitlementEnum ob = new DividendEntitlementEnum(dividendEntitlementNode);
                 IDManager.SetID(dividendEntitlementIDRef_, ob);
             }
             else if (dividendEntitlementNode.Attributes["href"] != null)
             {
                 dividendEntitlementIDRef_ = dividendEntitlementNode.Attributes["href"].Value;
             }
             else
             {
                 dividendEntitlement_ = new DividendEntitlementEnum(dividendEntitlementNode);
             }
         }
         else
         {
             dividendEntitlement_ = new DividendEntitlementEnum(dividendEntitlementNode);
         }
     }
     
 
     XmlNode dividendAmountNode = xmlNode.SelectSingleNode("dividendAmount");
     
     if (dividendAmountNode != null)
     {
         if (dividendAmountNode.Attributes["href"] != null || dividendAmountNode.Attributes["id"] != null) 
         {
             if (dividendAmountNode.Attributes["id"] != null) 
             {
                 dividendAmountIDRef_ = dividendAmountNode.Attributes["id"].Value;
                 DividendAmountTypeEnum ob = new DividendAmountTypeEnum(dividendAmountNode);
                 IDManager.SetID(dividendAmountIDRef_, ob);
             }
             else if (dividendAmountNode.Attributes["href"] != null)
             {
                 dividendAmountIDRef_ = dividendAmountNode.Attributes["href"].Value;
             }
             else
             {
                 dividendAmount_ = new DividendAmountTypeEnum(dividendAmountNode);
             }
         }
         else
         {
             dividendAmount_ = new DividendAmountTypeEnum(dividendAmountNode);
         }
     }
     
 
     XmlNode dividendPaymentDateNode = xmlNode.SelectSingleNode("dividendPaymentDate");
     
     if (dividendPaymentDateNode != null)
     {
         if (dividendPaymentDateNode.Attributes["href"] != null || dividendPaymentDateNode.Attributes["id"] != null) 
         {
             if (dividendPaymentDateNode.Attributes["id"] != null) 
             {
                 dividendPaymentDateIDRef_ = dividendPaymentDateNode.Attributes["id"].Value;
                 DividendPaymentDate ob = new DividendPaymentDate(dividendPaymentDateNode);
                 IDManager.SetID(dividendPaymentDateIDRef_, ob);
             }
             else if (dividendPaymentDateNode.Attributes["href"] != null)
             {
                 dividendPaymentDateIDRef_ = dividendPaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 dividendPaymentDate_ = new DividendPaymentDate(dividendPaymentDateNode);
             }
         }
         else
         {
             dividendPaymentDate_ = new DividendPaymentDate(dividendPaymentDateNode);
         }
     }
     
 
     XmlNode dividendPeriodEffectiveDateNode = xmlNode.SelectSingleNode("dividendPeriodEffectiveDate");
     
     if (dividendPeriodEffectiveDateNode != null)
     {
         if (dividendPeriodEffectiveDateNode.Attributes["href"] != null || dividendPeriodEffectiveDateNode.Attributes["id"] != null) 
         {
             if (dividendPeriodEffectiveDateNode.Attributes["id"] != null) 
             {
                 dividendPeriodEffectiveDateIDRef_ = dividendPeriodEffectiveDateNode.Attributes["id"].Value;
                 DateReference ob = new DateReference(dividendPeriodEffectiveDateNode);
                 IDManager.SetID(dividendPeriodEffectiveDateIDRef_, ob);
             }
             else if (dividendPeriodEffectiveDateNode.Attributes["href"] != null)
             {
                 dividendPeriodEffectiveDateIDRef_ = dividendPeriodEffectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 dividendPeriodEffectiveDate_ = new DateReference(dividendPeriodEffectiveDateNode);
             }
         }
         else
         {
             dividendPeriodEffectiveDate_ = new DateReference(dividendPeriodEffectiveDateNode);
         }
     }
     
 
     XmlNode dividendPeriodEndDateNode = xmlNode.SelectSingleNode("dividendPeriodEndDate");
     
     if (dividendPeriodEndDateNode != null)
     {
         if (dividendPeriodEndDateNode.Attributes["href"] != null || dividendPeriodEndDateNode.Attributes["id"] != null) 
         {
             if (dividendPeriodEndDateNode.Attributes["id"] != null) 
             {
                 dividendPeriodEndDateIDRef_ = dividendPeriodEndDateNode.Attributes["id"].Value;
                 DateReference ob = new DateReference(dividendPeriodEndDateNode);
                 IDManager.SetID(dividendPeriodEndDateIDRef_, ob);
             }
             else if (dividendPeriodEndDateNode.Attributes["href"] != null)
             {
                 dividendPeriodEndDateIDRef_ = dividendPeriodEndDateNode.Attributes["href"].Value;
             }
             else
             {
                 dividendPeriodEndDate_ = new DateReference(dividendPeriodEndDateNode);
             }
         }
         else
         {
             dividendPeriodEndDate_ = new DateReference(dividendPeriodEndDateNode);
         }
     }
     
 
     XmlNode dividendPeriodNode = xmlNode.SelectSingleNode("dividendPeriod");
     
     if (dividendPeriodNode != null)
     {
         if (dividendPeriodNode.Attributes["href"] != null || dividendPeriodNode.Attributes["id"] != null) 
         {
             if (dividendPeriodNode.Attributes["id"] != null) 
             {
                 dividendPeriodIDRef_ = dividendPeriodNode.Attributes["id"].Value;
                 DividendPeriodEnum ob = new DividendPeriodEnum(dividendPeriodNode);
                 IDManager.SetID(dividendPeriodIDRef_, ob);
             }
             else if (dividendPeriodNode.Attributes["href"] != null)
             {
                 dividendPeriodIDRef_ = dividendPeriodNode.Attributes["href"].Value;
             }
             else
             {
                 dividendPeriod_ = new DividendPeriodEnum(dividendPeriodNode);
             }
         }
         else
         {
             dividendPeriod_ = new DividendPeriodEnum(dividendPeriodNode);
         }
     }
     
 
     XmlNode extraOrdinaryDividendsNode = xmlNode.SelectSingleNode("extraOrdinaryDividends");
     
     if (extraOrdinaryDividendsNode != null)
     {
         if (extraOrdinaryDividendsNode.Attributes["href"] != null || extraOrdinaryDividendsNode.Attributes["id"] != null) 
         {
             if (extraOrdinaryDividendsNode.Attributes["id"] != null) 
             {
                 extraOrdinaryDividendsIDRef_ = extraOrdinaryDividendsNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(extraOrdinaryDividendsNode);
                 IDManager.SetID(extraOrdinaryDividendsIDRef_, ob);
             }
             else if (extraOrdinaryDividendsNode.Attributes["href"] != null)
             {
                 extraOrdinaryDividendsIDRef_ = extraOrdinaryDividendsNode.Attributes["href"].Value;
             }
             else
             {
                 extraOrdinaryDividends_ = new PartyReference(extraOrdinaryDividendsNode);
             }
         }
         else
         {
             extraOrdinaryDividends_ = new PartyReference(extraOrdinaryDividendsNode);
         }
     }
     
 
     XmlNode excessDividendAmountNode = xmlNode.SelectSingleNode("excessDividendAmount");
     
     if (excessDividendAmountNode != null)
     {
         if (excessDividendAmountNode.Attributes["href"] != null || excessDividendAmountNode.Attributes["id"] != null) 
         {
             if (excessDividendAmountNode.Attributes["id"] != null) 
             {
                 excessDividendAmountIDRef_ = excessDividendAmountNode.Attributes["id"].Value;
                 DividendAmountTypeEnum ob = new DividendAmountTypeEnum(excessDividendAmountNode);
                 IDManager.SetID(excessDividendAmountIDRef_, ob);
             }
             else if (excessDividendAmountNode.Attributes["href"] != null)
             {
                 excessDividendAmountIDRef_ = excessDividendAmountNode.Attributes["href"].Value;
             }
             else
             {
                 excessDividendAmount_ = new DividendAmountTypeEnum(excessDividendAmountNode);
             }
         }
         else
         {
             excessDividendAmount_ = new DividendAmountTypeEnum(excessDividendAmountNode);
         }
     }
     
 
     XmlNode currencyNode = xmlNode.SelectSingleNode("currency");
     
     if (currencyNode != null)
     {
         if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) 
         {
             if (currencyNode.Attributes["id"] != null) 
             {
                 currencyIDRef_ = currencyNode.Attributes["id"].Value;
                 IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode);
                 IDManager.SetID(currencyIDRef_, ob);
             }
             else if (currencyNode.Attributes["href"] != null)
             {
                 currencyIDRef_ = currencyNode.Attributes["href"].Value;
             }
             else
             {
                 currency_ = new IdentifiedCurrency(currencyNode);
             }
         }
         else
         {
             currency_ = new IdentifiedCurrency(currencyNode);
         }
     }
     
 
     XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod");
     
     if (determinationMethodNode != null)
     {
         if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null) 
         {
             if (determinationMethodNode.Attributes["id"] != null) 
             {
                 determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value;
                 DeterminationMethod ob = new DeterminationMethod(determinationMethodNode);
                 IDManager.SetID(determinationMethodIDRef_, ob);
             }
             else if (determinationMethodNode.Attributes["href"] != null)
             {
                 determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value;
             }
             else
             {
                 determinationMethod_ = new DeterminationMethod(determinationMethodNode);
             }
         }
         else
         {
             determinationMethod_ = new DeterminationMethod(determinationMethodNode);
         }
     }
     
 
     XmlNode currencyReferenceNode = xmlNode.SelectSingleNode("currencyReference");
     
     if (currencyReferenceNode != null)
     {
         if (currencyReferenceNode.Attributes["href"] != null || currencyReferenceNode.Attributes["id"] != null) 
         {
             if (currencyReferenceNode.Attributes["id"] != null) 
             {
                 currencyReferenceIDRef_ = currencyReferenceNode.Attributes["id"].Value;
                 IdentifiedCurrencyReference ob = new IdentifiedCurrencyReference(currencyReferenceNode);
                 IDManager.SetID(currencyReferenceIDRef_, ob);
             }
             else if (currencyReferenceNode.Attributes["href"] != null)
             {
                 currencyReferenceIDRef_ = currencyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
             }
         }
         else
         {
             currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
         }
     }
     
 
     XmlNode dividendFxTriggerDateNode = xmlNode.SelectSingleNode("dividendFxTriggerDate");
     
     if (dividendFxTriggerDateNode != null)
     {
         if (dividendFxTriggerDateNode.Attributes["href"] != null || dividendFxTriggerDateNode.Attributes["id"] != null) 
         {
             if (dividendFxTriggerDateNode.Attributes["id"] != null) 
             {
                 dividendFxTriggerDateIDRef_ = dividendFxTriggerDateNode.Attributes["id"].Value;
                 DividendPaymentDate ob = new DividendPaymentDate(dividendFxTriggerDateNode);
                 IDManager.SetID(dividendFxTriggerDateIDRef_, ob);
             }
             else if (dividendFxTriggerDateNode.Attributes["href"] != null)
             {
                 dividendFxTriggerDateIDRef_ = dividendFxTriggerDateNode.Attributes["href"].Value;
             }
             else
             {
                 dividendFxTriggerDate_ = new DividendPaymentDate(dividendFxTriggerDateNode);
             }
         }
         else
         {
             dividendFxTriggerDate_ = new DividendPaymentDate(dividendFxTriggerDateNode);
         }
     }
     
 
     XmlNode interestAccrualsMethodNode = xmlNode.SelectSingleNode("interestAccrualsMethod");
     
     if (interestAccrualsMethodNode != null)
     {
         if (interestAccrualsMethodNode.Attributes["href"] != null || interestAccrualsMethodNode.Attributes["id"] != null) 
         {
             if (interestAccrualsMethodNode.Attributes["id"] != null) 
             {
                 interestAccrualsMethodIDRef_ = interestAccrualsMethodNode.Attributes["id"].Value;
                 InterestAccrualsCompoundingMethod ob = new InterestAccrualsCompoundingMethod(interestAccrualsMethodNode);
                 IDManager.SetID(interestAccrualsMethodIDRef_, ob);
             }
             else if (interestAccrualsMethodNode.Attributes["href"] != null)
             {
                 interestAccrualsMethodIDRef_ = interestAccrualsMethodNode.Attributes["href"].Value;
             }
             else
             {
                 interestAccrualsMethod_ = new InterestAccrualsCompoundingMethod(interestAccrualsMethodNode);
             }
         }
         else
         {
             interestAccrualsMethod_ = new InterestAccrualsCompoundingMethod(interestAccrualsMethodNode);
         }
     }
     
 
     XmlNode numberOfIndexUnitsNode = xmlNode.SelectSingleNode("numberOfIndexUnits");
     
     if (numberOfIndexUnitsNode != null)
     {
         if (numberOfIndexUnitsNode.Attributes["href"] != null || numberOfIndexUnitsNode.Attributes["id"] != null) 
         {
             if (numberOfIndexUnitsNode.Attributes["id"] != null) 
             {
                 numberOfIndexUnitsIDRef_ = numberOfIndexUnitsNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(numberOfIndexUnitsNode);
                 IDManager.SetID(numberOfIndexUnitsIDRef_, ob);
             }
             else if (numberOfIndexUnitsNode.Attributes["href"] != null)
             {
                 numberOfIndexUnitsIDRef_ = numberOfIndexUnitsNode.Attributes["href"].Value;
             }
             else
             {
                 numberOfIndexUnits_ = new NonNegativeDecimal(numberOfIndexUnitsNode);
             }
         }
         else
         {
             numberOfIndexUnits_ = new NonNegativeDecimal(numberOfIndexUnitsNode);
         }
     }
     
 
     XmlNode declaredCashDividendPercentageNode = xmlNode.SelectSingleNode("declaredCashDividendPercentage");
     
     if (declaredCashDividendPercentageNode != null)
     {
         if (declaredCashDividendPercentageNode.Attributes["href"] != null || declaredCashDividendPercentageNode.Attributes["id"] != null) 
         {
             if (declaredCashDividendPercentageNode.Attributes["id"] != null) 
             {
                 declaredCashDividendPercentageIDRef_ = declaredCashDividendPercentageNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(declaredCashDividendPercentageNode);
                 IDManager.SetID(declaredCashDividendPercentageIDRef_, ob);
             }
             else if (declaredCashDividendPercentageNode.Attributes["href"] != null)
             {
                 declaredCashDividendPercentageIDRef_ = declaredCashDividendPercentageNode.Attributes["href"].Value;
             }
             else
             {
                 declaredCashDividendPercentage_ = new NonNegativeDecimal(declaredCashDividendPercentageNode);
             }
         }
         else
         {
             declaredCashDividendPercentage_ = new NonNegativeDecimal(declaredCashDividendPercentageNode);
         }
     }
     
 
     XmlNode declaredCashEquivalentDividendPercentageNode = xmlNode.SelectSingleNode("declaredCashEquivalentDividendPercentage");
     
     if (declaredCashEquivalentDividendPercentageNode != null)
     {
         if (declaredCashEquivalentDividendPercentageNode.Attributes["href"] != null || declaredCashEquivalentDividendPercentageNode.Attributes["id"] != null) 
         {
             if (declaredCashEquivalentDividendPercentageNode.Attributes["id"] != null) 
             {
                 declaredCashEquivalentDividendPercentageIDRef_ = declaredCashEquivalentDividendPercentageNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(declaredCashEquivalentDividendPercentageNode);
                 IDManager.SetID(declaredCashEquivalentDividendPercentageIDRef_, ob);
             }
             else if (declaredCashEquivalentDividendPercentageNode.Attributes["href"] != null)
             {
                 declaredCashEquivalentDividendPercentageIDRef_ = declaredCashEquivalentDividendPercentageNode.Attributes["href"].Value;
             }
             else
             {
                 declaredCashEquivalentDividendPercentage_ = new NonNegativeDecimal(declaredCashEquivalentDividendPercentageNode);
             }
         }
         else
         {
             declaredCashEquivalentDividendPercentage_ = new NonNegativeDecimal(declaredCashEquivalentDividendPercentageNode);
         }
     }
     
 
     XmlNode nonCashDividendTreatmentNode = xmlNode.SelectSingleNode("nonCashDividendTreatment");
     
     if (nonCashDividendTreatmentNode != null)
     {
         if (nonCashDividendTreatmentNode.Attributes["href"] != null || nonCashDividendTreatmentNode.Attributes["id"] != null) 
         {
             if (nonCashDividendTreatmentNode.Attributes["id"] != null) 
             {
                 nonCashDividendTreatmentIDRef_ = nonCashDividendTreatmentNode.Attributes["id"].Value;
                 NonCashDividendTreatmentEnum ob = new NonCashDividendTreatmentEnum(nonCashDividendTreatmentNode);
                 IDManager.SetID(nonCashDividendTreatmentIDRef_, ob);
             }
             else if (nonCashDividendTreatmentNode.Attributes["href"] != null)
             {
                 nonCashDividendTreatmentIDRef_ = nonCashDividendTreatmentNode.Attributes["href"].Value;
             }
             else
             {
                 nonCashDividendTreatment_ = new NonCashDividendTreatmentEnum(nonCashDividendTreatmentNode);
             }
         }
         else
         {
             nonCashDividendTreatment_ = new NonCashDividendTreatmentEnum(nonCashDividendTreatmentNode);
         }
     }
     
 
     XmlNode dividendCompositionNode = xmlNode.SelectSingleNode("dividendComposition");
     
     if (dividendCompositionNode != null)
     {
         if (dividendCompositionNode.Attributes["href"] != null || dividendCompositionNode.Attributes["id"] != null) 
         {
             if (dividendCompositionNode.Attributes["id"] != null) 
             {
                 dividendCompositionIDRef_ = dividendCompositionNode.Attributes["id"].Value;
                 DividendCompositionEnum ob = new DividendCompositionEnum(dividendCompositionNode);
                 IDManager.SetID(dividendCompositionIDRef_, ob);
             }
             else if (dividendCompositionNode.Attributes["href"] != null)
             {
                 dividendCompositionIDRef_ = dividendCompositionNode.Attributes["href"].Value;
             }
             else
             {
                 dividendComposition_ = new DividendCompositionEnum(dividendCompositionNode);
             }
         }
         else
         {
             dividendComposition_ = new DividendCompositionEnum(dividendCompositionNode);
         }
     }
     
 
     XmlNode specialDividendsNode = xmlNode.SelectSingleNode("specialDividends");
     
     if (specialDividendsNode != null)
     {
         if (specialDividendsNode.Attributes["href"] != null || specialDividendsNode.Attributes["id"] != null) 
         {
             if (specialDividendsNode.Attributes["id"] != null) 
             {
                 specialDividendsIDRef_ = specialDividendsNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(specialDividendsNode);
                 IDManager.SetID(specialDividendsIDRef_, ob);
             }
             else if (specialDividendsNode.Attributes["href"] != null)
             {
                 specialDividendsIDRef_ = specialDividendsNode.Attributes["href"].Value;
             }
             else
             {
                 specialDividends_ = new XsdTypeBoolean(specialDividendsNode);
             }
         }
         else
         {
             specialDividends_ = new XsdTypeBoolean(specialDividendsNode);
         }
     }
     
 
 }
 public FxFeature(XmlNode xmlNode)
 {
     XmlNodeList referenceCurrencyNodeList = xmlNode.SelectNodes("referenceCurrency");
     if (referenceCurrencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in referenceCurrencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 referenceCurrencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(referenceCurrencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 referenceCurrencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 referenceCurrency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList compositeNodeList = xmlNode.SelectNodes("composite");
     if (compositeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in compositeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 compositeIDRef = item.Attributes["id"].Name;
                 Composite ob = Composite();
                 IDManager.SetID(compositeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 compositeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 composite = new Composite(item);
             }
         }
     }
     
 
     XmlNodeList quantoNodeList = xmlNode.SelectNodes("quanto");
     if (quantoNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in quantoNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quantoIDRef = item.Attributes["id"].Name;
                 Quanto ob = Quanto();
                 IDManager.SetID(quantoIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quantoIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 quanto = new Quanto(item);
             }
         }
     }
     
 
     XmlNodeList crossCurrencyNodeList = xmlNode.SelectNodes("crossCurrency");
     if (crossCurrencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in crossCurrencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 crossCurrencyIDRef = item.Attributes["id"].Name;
                 Composite ob = Composite();
                 IDManager.SetID(crossCurrencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 crossCurrencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 crossCurrency = new Composite(item);
             }
         }
     }
     
 
 }
        public FxFeature(XmlNode xmlNode)
        {
            XmlNode referenceCurrencyNode = xmlNode.SelectSingleNode("referenceCurrency");

            if (referenceCurrencyNode != null)
            {
                if (referenceCurrencyNode.Attributes["href"] != null || referenceCurrencyNode.Attributes["id"] != null)
                {
                    if (referenceCurrencyNode.Attributes["id"] != null)
                    {
                        referenceCurrencyIDRef_ = referenceCurrencyNode.Attributes["id"].Value;
                        IdentifiedCurrency ob = new IdentifiedCurrency(referenceCurrencyNode);
                        IDManager.SetID(referenceCurrencyIDRef_, ob);
                    }
                    else if (referenceCurrencyNode.Attributes["href"] != null)
                    {
                        referenceCurrencyIDRef_ = referenceCurrencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        referenceCurrency_ = new IdentifiedCurrency(referenceCurrencyNode);
                    }
                }
                else
                {
                    referenceCurrency_ = new IdentifiedCurrency(referenceCurrencyNode);
                }
            }


            XmlNode compositeNode = xmlNode.SelectSingleNode("composite");

            if (compositeNode != null)
            {
                if (compositeNode.Attributes["href"] != null || compositeNode.Attributes["id"] != null)
                {
                    if (compositeNode.Attributes["id"] != null)
                    {
                        compositeIDRef_ = compositeNode.Attributes["id"].Value;
                        Composite ob = new Composite(compositeNode);
                        IDManager.SetID(compositeIDRef_, ob);
                    }
                    else if (compositeNode.Attributes["href"] != null)
                    {
                        compositeIDRef_ = compositeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        composite_ = new Composite(compositeNode);
                    }
                }
                else
                {
                    composite_ = new Composite(compositeNode);
                }
            }


            XmlNode quantoNode = xmlNode.SelectSingleNode("quanto");

            if (quantoNode != null)
            {
                if (quantoNode.Attributes["href"] != null || quantoNode.Attributes["id"] != null)
                {
                    if (quantoNode.Attributes["id"] != null)
                    {
                        quantoIDRef_ = quantoNode.Attributes["id"].Value;
                        Quanto ob = new Quanto(quantoNode);
                        IDManager.SetID(quantoIDRef_, ob);
                    }
                    else if (quantoNode.Attributes["href"] != null)
                    {
                        quantoIDRef_ = quantoNode.Attributes["href"].Value;
                    }
                    else
                    {
                        quanto_ = new Quanto(quantoNode);
                    }
                }
                else
                {
                    quanto_ = new Quanto(quantoNode);
                }
            }


            XmlNode crossCurrencyNode = xmlNode.SelectSingleNode("crossCurrency");

            if (crossCurrencyNode != null)
            {
                if (crossCurrencyNode.Attributes["href"] != null || crossCurrencyNode.Attributes["id"] != null)
                {
                    if (crossCurrencyNode.Attributes["id"] != null)
                    {
                        crossCurrencyIDRef_ = crossCurrencyNode.Attributes["id"].Value;
                        Composite ob = new Composite(crossCurrencyNode);
                        IDManager.SetID(crossCurrencyIDRef_, ob);
                    }
                    else if (crossCurrencyNode.Attributes["href"] != null)
                    {
                        crossCurrencyIDRef_ = crossCurrencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        crossCurrency_ = new Composite(crossCurrencyNode);
                    }
                }
                else
                {
                    crossCurrency_ = new Composite(crossCurrencyNode);
                }
            }
        }
Esempio n. 12
0
        public FxFeature(XmlNode xmlNode)
        {
            XmlNodeList referenceCurrencyNodeList = xmlNode.SelectNodes("referenceCurrency");

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

            foreach (XmlNode item in referenceCurrencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        referenceCurrencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(referenceCurrencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        referenceCurrencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        referenceCurrency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList compositeNodeList = xmlNode.SelectNodes("composite");

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

            foreach (XmlNode item in compositeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        compositeIDRef = item.Attributes["id"].Name;
                        Composite ob = Composite();
                        IDManager.SetID(compositeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        compositeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        composite = new Composite(item);
                    }
                }
            }


            XmlNodeList quantoNodeList = xmlNode.SelectNodes("quanto");

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

            foreach (XmlNode item in quantoNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quantoIDRef = item.Attributes["id"].Name;
                        Quanto ob = Quanto();
                        IDManager.SetID(quantoIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quantoIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quanto = new Quanto(item);
                    }
                }
            }


            XmlNodeList crossCurrencyNodeList = xmlNode.SelectNodes("crossCurrency");

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

            foreach (XmlNode item in crossCurrencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        crossCurrencyIDRef = item.Attributes["id"].Name;
                        Composite ob = Composite();
                        IDManager.SetID(crossCurrencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        crossCurrencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        crossCurrency = new Composite(item);
                    }
                }
            }
        }
 public LegAmount(XmlNode xmlNode)
 {
     XmlNode currencyNode = xmlNode.SelectSingleNode("currency");
     
     if (currencyNode != null)
     {
         if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) 
         {
             if (currencyNode.Attributes["id"] != null) 
             {
                 currencyIDRef_ = currencyNode.Attributes["id"].Value;
                 IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode);
                 IDManager.SetID(currencyIDRef_, ob);
             }
             else if (currencyNode.Attributes["href"] != null)
             {
                 currencyIDRef_ = currencyNode.Attributes["href"].Value;
             }
             else
             {
                 currency_ = new IdentifiedCurrency(currencyNode);
             }
         }
         else
         {
             currency_ = new IdentifiedCurrency(currencyNode);
         }
     }
     
 
     XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod");
     
     if (determinationMethodNode != null)
     {
         if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null) 
         {
             if (determinationMethodNode.Attributes["id"] != null) 
             {
                 determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value;
                 DeterminationMethod ob = new DeterminationMethod(determinationMethodNode);
                 IDManager.SetID(determinationMethodIDRef_, ob);
             }
             else if (determinationMethodNode.Attributes["href"] != null)
             {
                 determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value;
             }
             else
             {
                 determinationMethod_ = new DeterminationMethod(determinationMethodNode);
             }
         }
         else
         {
             determinationMethod_ = new DeterminationMethod(determinationMethodNode);
         }
     }
     
 
     XmlNode currencyReferenceNode = xmlNode.SelectSingleNode("currencyReference");
     
     if (currencyReferenceNode != null)
     {
         if (currencyReferenceNode.Attributes["href"] != null || currencyReferenceNode.Attributes["id"] != null) 
         {
             if (currencyReferenceNode.Attributes["id"] != null) 
             {
                 currencyReferenceIDRef_ = currencyReferenceNode.Attributes["id"].Value;
                 IdentifiedCurrencyReference ob = new IdentifiedCurrencyReference(currencyReferenceNode);
                 IDManager.SetID(currencyReferenceIDRef_, ob);
             }
             else if (currencyReferenceNode.Attributes["href"] != null)
             {
                 currencyReferenceIDRef_ = currencyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
             }
         }
         else
         {
             currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
         }
     }
     
 
     XmlNode referenceAmountNode = xmlNode.SelectSingleNode("referenceAmount");
     
     if (referenceAmountNode != null)
     {
         if (referenceAmountNode.Attributes["href"] != null || referenceAmountNode.Attributes["id"] != null) 
         {
             if (referenceAmountNode.Attributes["id"] != null) 
             {
                 referenceAmountIDRef_ = referenceAmountNode.Attributes["id"].Value;
                 ReferenceAmount ob = new ReferenceAmount(referenceAmountNode);
                 IDManager.SetID(referenceAmountIDRef_, ob);
             }
             else if (referenceAmountNode.Attributes["href"] != null)
             {
                 referenceAmountIDRef_ = referenceAmountNode.Attributes["href"].Value;
             }
             else
             {
                 referenceAmount_ = new ReferenceAmount(referenceAmountNode);
             }
         }
         else
         {
             referenceAmount_ = new ReferenceAmount(referenceAmountNode);
         }
     }
     
 
     XmlNode formulaNode = xmlNode.SelectSingleNode("formula");
     
     if (formulaNode != null)
     {
         if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null) 
         {
             if (formulaNode.Attributes["id"] != null) 
             {
                 formulaIDRef_ = formulaNode.Attributes["id"].Value;
                 Formula ob = new Formula(formulaNode);
                 IDManager.SetID(formulaIDRef_, ob);
             }
             else if (formulaNode.Attributes["href"] != null)
             {
                 formulaIDRef_ = formulaNode.Attributes["href"].Value;
             }
             else
             {
                 formula_ = new Formula(formulaNode);
             }
         }
         else
         {
             formula_ = new Formula(formulaNode);
         }
     }
     
 
     XmlNode encodedDescriptionNode = xmlNode.SelectSingleNode("encodedDescription");
     
     if (encodedDescriptionNode != null)
     {
         if (encodedDescriptionNode.Attributes["href"] != null || encodedDescriptionNode.Attributes["id"] != null) 
         {
             if (encodedDescriptionNode.Attributes["id"] != null) 
             {
                 encodedDescriptionIDRef_ = encodedDescriptionNode.Attributes["id"].Value;
                 XsdTypeBase64Binary ob = new XsdTypeBase64Binary(encodedDescriptionNode);
                 IDManager.SetID(encodedDescriptionIDRef_, ob);
             }
             else if (encodedDescriptionNode.Attributes["href"] != null)
             {
                 encodedDescriptionIDRef_ = encodedDescriptionNode.Attributes["href"].Value;
             }
             else
             {
                 encodedDescription_ = new XsdTypeBase64Binary(encodedDescriptionNode);
             }
         }
         else
         {
             encodedDescription_ = new XsdTypeBase64Binary(encodedDescriptionNode);
         }
     }
     
 
     XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates");
     
     if (calculationDatesNode != null)
     {
         if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null) 
         {
             if (calculationDatesNode.Attributes["id"] != null) 
             {
                 calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                 AdjustableRelativeOrPeriodicDates ob = new AdjustableRelativeOrPeriodicDates(calculationDatesNode);
                 IDManager.SetID(calculationDatesIDRef_, ob);
             }
             else if (calculationDatesNode.Attributes["href"] != null)
             {
                 calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
             }
             else
             {
                 calculationDates_ = new AdjustableRelativeOrPeriodicDates(calculationDatesNode);
             }
         }
         else
         {
             calculationDates_ = new AdjustableRelativeOrPeriodicDates(calculationDatesNode);
         }
     }
     
 
 }
 public DividendConditions(XmlNode xmlNode)
 {
     XmlNodeList dividendReinvestmentNodeList = xmlNode.SelectNodes("dividendReinvestment");
     if (dividendReinvestmentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendReinvestmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendReinvestmentIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(dividendReinvestmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendReinvestmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendReinvestment = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList dividendEntitlementNodeList = xmlNode.SelectNodes("dividendEntitlement");
     if (dividendEntitlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendEntitlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendEntitlementIDRef = item.Attributes["id"].Name;
                 DividendEntitlementEnum ob = DividendEntitlementEnum();
                 IDManager.SetID(dividendEntitlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendEntitlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendEntitlement = new DividendEntitlementEnum(item);
             }
         }
     }
     
 
     XmlNodeList dividendAmountNodeList = xmlNode.SelectNodes("dividendAmount");
     if (dividendAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendAmountIDRef = item.Attributes["id"].Name;
                 DividendAmountTypeEnum ob = DividendAmountTypeEnum();
                 IDManager.SetID(dividendAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendAmount = new DividendAmountTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList dividendPaymentDateNodeList = xmlNode.SelectNodes("dividendPaymentDate");
     if (dividendPaymentDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendPaymentDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendPaymentDateIDRef = item.Attributes["id"].Name;
                 DividendPaymentDate ob = DividendPaymentDate();
                 IDManager.SetID(dividendPaymentDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendPaymentDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendPaymentDate = new DividendPaymentDate(item);
             }
         }
     }
     
 
     XmlNodeList dividendPeriodEffectiveDateNodeList = xmlNode.SelectNodes("dividendPeriodEffectiveDate");
     if (dividendPeriodEffectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendPeriodEffectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendPeriodEffectiveDateIDRef = item.Attributes["id"].Name;
                 DateReference ob = DateReference();
                 IDManager.SetID(dividendPeriodEffectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendPeriodEffectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendPeriodEffectiveDate = new DateReference(item);
             }
         }
     }
     
 
     XmlNodeList dividendPeriodEndDateNodeList = xmlNode.SelectNodes("dividendPeriodEndDate");
     if (dividendPeriodEndDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendPeriodEndDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendPeriodEndDateIDRef = item.Attributes["id"].Name;
                 DateReference ob = DateReference();
                 IDManager.SetID(dividendPeriodEndDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendPeriodEndDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendPeriodEndDate = new DateReference(item);
             }
         }
     }
     
 
     XmlNodeList dividendPeriodNodeList = xmlNode.SelectNodes("dividendPeriod");
     if (dividendPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendPeriodIDRef = item.Attributes["id"].Name;
                 DividendPeriodEnum ob = DividendPeriodEnum();
                 IDManager.SetID(dividendPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendPeriod = new DividendPeriodEnum(item);
             }
         }
     }
     
 
     XmlNodeList extraOrdinaryDividendsNodeList = xmlNode.SelectNodes("extraOrdinaryDividends");
     if (extraOrdinaryDividendsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in extraOrdinaryDividendsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 extraOrdinaryDividendsIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(extraOrdinaryDividendsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 extraOrdinaryDividendsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 extraOrdinaryDividends = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList excessDividendAmountNodeList = xmlNode.SelectNodes("excessDividendAmount");
     if (excessDividendAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in excessDividendAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 excessDividendAmountIDRef = item.Attributes["id"].Name;
                 DividendAmountTypeEnum ob = DividendAmountTypeEnum();
                 IDManager.SetID(excessDividendAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 excessDividendAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 excessDividendAmount = new DividendAmountTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");
     if (currencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(currencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod");
     if (determinationMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in determinationMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 determinationMethodIDRef = item.Attributes["id"].Name;
                 DeterminationMethod ob = DeterminationMethod();
                 IDManager.SetID(determinationMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 determinationMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 determinationMethod = new DeterminationMethod(item);
             }
         }
     }
     
 
     XmlNodeList currencyReferenceNodeList = xmlNode.SelectNodes("currencyReference");
     if (currencyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyReferenceIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrencyReference ob = IdentifiedCurrencyReference();
                 IDManager.SetID(currencyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currencyReference = new IdentifiedCurrencyReference(item);
             }
         }
     }
     
 
     XmlNodeList dividendFxTriggerDateNodeList = xmlNode.SelectNodes("dividendFxTriggerDate");
     if (dividendFxTriggerDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendFxTriggerDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendFxTriggerDateIDRef = item.Attributes["id"].Name;
                 DividendPaymentDate ob = DividendPaymentDate();
                 IDManager.SetID(dividendFxTriggerDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendFxTriggerDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendFxTriggerDate = new DividendPaymentDate(item);
             }
         }
     }
     
 
     XmlNodeList interestAccrualsMethodNodeList = xmlNode.SelectNodes("interestAccrualsMethod");
     if (interestAccrualsMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in interestAccrualsMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 interestAccrualsMethodIDRef = item.Attributes["id"].Name;
                 InterestAccrualsCompoundingMethod ob = InterestAccrualsCompoundingMethod();
                 IDManager.SetID(interestAccrualsMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 interestAccrualsMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 interestAccrualsMethod = new InterestAccrualsCompoundingMethod(item);
             }
         }
     }
     
 
     XmlNodeList numberOfIndexUnitsNodeList = xmlNode.SelectNodes("numberOfIndexUnits");
     if (numberOfIndexUnitsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in numberOfIndexUnitsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 numberOfIndexUnitsIDRef = item.Attributes["id"].Name;
                 NonNegativeDecimal ob = NonNegativeDecimal();
                 IDManager.SetID(numberOfIndexUnitsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 numberOfIndexUnitsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 numberOfIndexUnits = new NonNegativeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList declaredCashDividendPercentageNodeList = xmlNode.SelectNodes("declaredCashDividendPercentage");
     if (declaredCashDividendPercentageNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in declaredCashDividendPercentageNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 declaredCashDividendPercentageIDRef = item.Attributes["id"].Name;
                 NonNegativeDecimal ob = NonNegativeDecimal();
                 IDManager.SetID(declaredCashDividendPercentageIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 declaredCashDividendPercentageIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 declaredCashDividendPercentage = new NonNegativeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList declaredCashEquivalentDividendPercentageNodeList = xmlNode.SelectNodes("declaredCashEquivalentDividendPercentage");
     if (declaredCashEquivalentDividendPercentageNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in declaredCashEquivalentDividendPercentageNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 declaredCashEquivalentDividendPercentageIDRef = item.Attributes["id"].Name;
                 NonNegativeDecimal ob = NonNegativeDecimal();
                 IDManager.SetID(declaredCashEquivalentDividendPercentageIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 declaredCashEquivalentDividendPercentageIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 declaredCashEquivalentDividendPercentage = new NonNegativeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList nonCashDividendTreatmentNodeList = xmlNode.SelectNodes("nonCashDividendTreatment");
     if (nonCashDividendTreatmentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in nonCashDividendTreatmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 nonCashDividendTreatmentIDRef = item.Attributes["id"].Name;
                 NonCashDividendTreatmentEnum ob = NonCashDividendTreatmentEnum();
                 IDManager.SetID(nonCashDividendTreatmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 nonCashDividendTreatmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 nonCashDividendTreatment = new NonCashDividendTreatmentEnum(item);
             }
         }
     }
     
 
     XmlNodeList dividendCompositionNodeList = xmlNode.SelectNodes("dividendComposition");
     if (dividendCompositionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendCompositionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendCompositionIDRef = item.Attributes["id"].Name;
                 DividendCompositionEnum ob = DividendCompositionEnum();
                 IDManager.SetID(dividendCompositionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendCompositionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividendComposition = new DividendCompositionEnum(item);
             }
         }
     }
     
 
     XmlNodeList specialDividendsNodeList = xmlNode.SelectNodes("specialDividends");
     if (specialDividendsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in specialDividendsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 specialDividendsIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(specialDividendsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 specialDividendsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 specialDividends = new XsdTypeBoolean(item);
             }
         }
     }
     
 
 }
 public CommoditySwap(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");
     if (effectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in effectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 effectiveDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(effectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 effectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 effectiveDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
     XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate");
     if (terminationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminationDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(terminationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 terminationDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
     XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");
     if (settlementCurrencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementCurrencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementCurrencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(settlementCurrencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementCurrencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementCurrency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList commoditySwapLegNodeList = xmlNode.SelectNodes("commoditySwapLeg");
     if (commoditySwapLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commoditySwapLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commoditySwapLegIDRef = item.Attributes["id"].Name;
                 CommoditySwapLeg ob = CommoditySwapLeg();
                 IDManager.SetID(commoditySwapLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commoditySwapLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commoditySwapLeg = new CommoditySwapLeg(item);
             }
         }
     }
     
 
     XmlNodeList coalPhysicalLegNodeList = xmlNode.SelectNodes("coalPhysicalLeg");
     if (coalPhysicalLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in coalPhysicalLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 coalPhysicalLegIDRef = item.Attributes["id"].Name;
                 CoalPhysicalLeg ob = CoalPhysicalLeg();
                 IDManager.SetID(coalPhysicalLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 coalPhysicalLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 coalPhysicalLeg = new CoalPhysicalLeg(item);
             }
         }
     }
     
 
     XmlNodeList electricityPhysicalLegNodeList = xmlNode.SelectNodes("electricityPhysicalLeg");
     if (electricityPhysicalLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in electricityPhysicalLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 electricityPhysicalLegIDRef = item.Attributes["id"].Name;
                 ElectricityPhysicalLeg ob = ElectricityPhysicalLeg();
                 IDManager.SetID(electricityPhysicalLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 electricityPhysicalLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 electricityPhysicalLeg = new ElectricityPhysicalLeg(item);
             }
         }
     }
     
 
     XmlNodeList environmentalPhysicalLegNodeList = xmlNode.SelectNodes("environmentalPhysicalLeg");
     if (environmentalPhysicalLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in environmentalPhysicalLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 environmentalPhysicalLegIDRef = item.Attributes["id"].Name;
                 EnvironmentalPhysicalLeg ob = EnvironmentalPhysicalLeg();
                 IDManager.SetID(environmentalPhysicalLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 environmentalPhysicalLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 environmentalPhysicalLeg = new EnvironmentalPhysicalLeg(item);
             }
         }
     }
     
 
     XmlNodeList fixedLegNodeList = xmlNode.SelectNodes("fixedLeg");
     if (fixedLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedLegIDRef = item.Attributes["id"].Name;
                 FixedPriceLeg ob = FixedPriceLeg();
                 IDManager.SetID(fixedLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedLeg = new FixedPriceLeg(item);
             }
         }
     }
     
 
     XmlNodeList floatingLegNodeList = xmlNode.SelectNodes("floatingLeg");
     if (floatingLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingLegIDRef = item.Attributes["id"].Name;
                 FloatingPriceLeg ob = FloatingPriceLeg();
                 IDManager.SetID(floatingLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingLeg = new FloatingPriceLeg(item);
             }
         }
     }
     
 
     XmlNodeList gasPhysicalLegNodeList = xmlNode.SelectNodes("gasPhysicalLeg");
     if (gasPhysicalLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in gasPhysicalLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 gasPhysicalLegIDRef = item.Attributes["id"].Name;
                 GasPhysicalLeg ob = GasPhysicalLeg();
                 IDManager.SetID(gasPhysicalLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 gasPhysicalLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 gasPhysicalLeg = new GasPhysicalLeg(item);
             }
         }
     }
     
 
     XmlNodeList oilPhysicalLegNodeList = xmlNode.SelectNodes("oilPhysicalLeg");
     if (oilPhysicalLegNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in oilPhysicalLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 oilPhysicalLegIDRef = item.Attributes["id"].Name;
                 OilPhysicalLeg ob = OilPhysicalLeg();
                 IDManager.SetID(oilPhysicalLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 oilPhysicalLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 oilPhysicalLeg = new OilPhysicalLeg(item);
             }
         }
     }
     
 
     XmlNodeList weatherLegNodeList = xmlNode.SelectNodes("weatherLeg");
     
     foreach (XmlNode item in weatherLegNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherLegIDRef = item.Attributes["id"].Name;
                 List<WeatherLeg> ob = new List<WeatherLeg>();
                 ob.Add(new WeatherLeg(item));
                 IDManager.SetID(weatherLegIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherLegIDRef = item.Attributes["href"].Name;
             }
             else
             {
             weatherLeg.Add(new WeatherLeg(item));
             }
         }
     }
     
 
     XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing");
     if (commonPricingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commonPricingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commonPricingIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(commonPricingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commonPricingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commonPricing = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption");
     if (marketDisruptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in marketDisruptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 marketDisruptionIDRef = item.Attributes["id"].Name;
                 CommodityMarketDisruption ob = CommodityMarketDisruption();
                 IDManager.SetID(marketDisruptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 marketDisruptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 marketDisruption = new CommodityMarketDisruption(item);
             }
         }
     }
     
 
     XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption");
     if (settlementDisruptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementDisruptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementDisruptionIDRef = item.Attributes["id"].Name;
                 CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum();
                 IDManager.SetID(settlementDisruptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementDisruptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item);
             }
         }
     }
     
 
     XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding");
     if (roundingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in roundingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 roundingIDRef = item.Attributes["id"].Name;
                 Rounding ob = Rounding();
                 IDManager.SetID(roundingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 roundingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 rounding = new Rounding(item);
             }
         }
     }
     
 
 }
Esempio n. 16
0
        public DividendConditions(XmlNode xmlNode)
        {
            XmlNode dividendReinvestmentNode = xmlNode.SelectSingleNode("dividendReinvestment");

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


            XmlNode dividendEntitlementNode = xmlNode.SelectSingleNode("dividendEntitlement");

            if (dividendEntitlementNode != null)
            {
                if (dividendEntitlementNode.Attributes["href"] != null || dividendEntitlementNode.Attributes["id"] != null)
                {
                    if (dividendEntitlementNode.Attributes["id"] != null)
                    {
                        dividendEntitlementIDRef_ = dividendEntitlementNode.Attributes["id"].Value;
                        DividendEntitlementEnum ob = new DividendEntitlementEnum(dividendEntitlementNode);
                        IDManager.SetID(dividendEntitlementIDRef_, ob);
                    }
                    else if (dividendEntitlementNode.Attributes["href"] != null)
                    {
                        dividendEntitlementIDRef_ = dividendEntitlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendEntitlement_ = new DividendEntitlementEnum(dividendEntitlementNode);
                    }
                }
                else
                {
                    dividendEntitlement_ = new DividendEntitlementEnum(dividendEntitlementNode);
                }
            }


            XmlNode dividendAmountNode = xmlNode.SelectSingleNode("dividendAmount");

            if (dividendAmountNode != null)
            {
                if (dividendAmountNode.Attributes["href"] != null || dividendAmountNode.Attributes["id"] != null)
                {
                    if (dividendAmountNode.Attributes["id"] != null)
                    {
                        dividendAmountIDRef_ = dividendAmountNode.Attributes["id"].Value;
                        DividendAmountTypeEnum ob = new DividendAmountTypeEnum(dividendAmountNode);
                        IDManager.SetID(dividendAmountIDRef_, ob);
                    }
                    else if (dividendAmountNode.Attributes["href"] != null)
                    {
                        dividendAmountIDRef_ = dividendAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendAmount_ = new DividendAmountTypeEnum(dividendAmountNode);
                    }
                }
                else
                {
                    dividendAmount_ = new DividendAmountTypeEnum(dividendAmountNode);
                }
            }


            XmlNode dividendPaymentDateNode = xmlNode.SelectSingleNode("dividendPaymentDate");

            if (dividendPaymentDateNode != null)
            {
                if (dividendPaymentDateNode.Attributes["href"] != null || dividendPaymentDateNode.Attributes["id"] != null)
                {
                    if (dividendPaymentDateNode.Attributes["id"] != null)
                    {
                        dividendPaymentDateIDRef_ = dividendPaymentDateNode.Attributes["id"].Value;
                        DividendPaymentDate ob = new DividendPaymentDate(dividendPaymentDateNode);
                        IDManager.SetID(dividendPaymentDateIDRef_, ob);
                    }
                    else if (dividendPaymentDateNode.Attributes["href"] != null)
                    {
                        dividendPaymentDateIDRef_ = dividendPaymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendPaymentDate_ = new DividendPaymentDate(dividendPaymentDateNode);
                    }
                }
                else
                {
                    dividendPaymentDate_ = new DividendPaymentDate(dividendPaymentDateNode);
                }
            }


            XmlNode dividendPeriodEffectiveDateNode = xmlNode.SelectSingleNode("dividendPeriodEffectiveDate");

            if (dividendPeriodEffectiveDateNode != null)
            {
                if (dividendPeriodEffectiveDateNode.Attributes["href"] != null || dividendPeriodEffectiveDateNode.Attributes["id"] != null)
                {
                    if (dividendPeriodEffectiveDateNode.Attributes["id"] != null)
                    {
                        dividendPeriodEffectiveDateIDRef_ = dividendPeriodEffectiveDateNode.Attributes["id"].Value;
                        DateReference ob = new DateReference(dividendPeriodEffectiveDateNode);
                        IDManager.SetID(dividendPeriodEffectiveDateIDRef_, ob);
                    }
                    else if (dividendPeriodEffectiveDateNode.Attributes["href"] != null)
                    {
                        dividendPeriodEffectiveDateIDRef_ = dividendPeriodEffectiveDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendPeriodEffectiveDate_ = new DateReference(dividendPeriodEffectiveDateNode);
                    }
                }
                else
                {
                    dividendPeriodEffectiveDate_ = new DateReference(dividendPeriodEffectiveDateNode);
                }
            }


            XmlNode dividendPeriodEndDateNode = xmlNode.SelectSingleNode("dividendPeriodEndDate");

            if (dividendPeriodEndDateNode != null)
            {
                if (dividendPeriodEndDateNode.Attributes["href"] != null || dividendPeriodEndDateNode.Attributes["id"] != null)
                {
                    if (dividendPeriodEndDateNode.Attributes["id"] != null)
                    {
                        dividendPeriodEndDateIDRef_ = dividendPeriodEndDateNode.Attributes["id"].Value;
                        DateReference ob = new DateReference(dividendPeriodEndDateNode);
                        IDManager.SetID(dividendPeriodEndDateIDRef_, ob);
                    }
                    else if (dividendPeriodEndDateNode.Attributes["href"] != null)
                    {
                        dividendPeriodEndDateIDRef_ = dividendPeriodEndDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendPeriodEndDate_ = new DateReference(dividendPeriodEndDateNode);
                    }
                }
                else
                {
                    dividendPeriodEndDate_ = new DateReference(dividendPeriodEndDateNode);
                }
            }


            XmlNode dividendPeriodNode = xmlNode.SelectSingleNode("dividendPeriod");

            if (dividendPeriodNode != null)
            {
                if (dividendPeriodNode.Attributes["href"] != null || dividendPeriodNode.Attributes["id"] != null)
                {
                    if (dividendPeriodNode.Attributes["id"] != null)
                    {
                        dividendPeriodIDRef_ = dividendPeriodNode.Attributes["id"].Value;
                        DividendPeriodEnum ob = new DividendPeriodEnum(dividendPeriodNode);
                        IDManager.SetID(dividendPeriodIDRef_, ob);
                    }
                    else if (dividendPeriodNode.Attributes["href"] != null)
                    {
                        dividendPeriodIDRef_ = dividendPeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendPeriod_ = new DividendPeriodEnum(dividendPeriodNode);
                    }
                }
                else
                {
                    dividendPeriod_ = new DividendPeriodEnum(dividendPeriodNode);
                }
            }


            XmlNode extraOrdinaryDividendsNode = xmlNode.SelectSingleNode("extraOrdinaryDividends");

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


            XmlNode excessDividendAmountNode = xmlNode.SelectSingleNode("excessDividendAmount");

            if (excessDividendAmountNode != null)
            {
                if (excessDividendAmountNode.Attributes["href"] != null || excessDividendAmountNode.Attributes["id"] != null)
                {
                    if (excessDividendAmountNode.Attributes["id"] != null)
                    {
                        excessDividendAmountIDRef_ = excessDividendAmountNode.Attributes["id"].Value;
                        DividendAmountTypeEnum ob = new DividendAmountTypeEnum(excessDividendAmountNode);
                        IDManager.SetID(excessDividendAmountIDRef_, ob);
                    }
                    else if (excessDividendAmountNode.Attributes["href"] != null)
                    {
                        excessDividendAmountIDRef_ = excessDividendAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        excessDividendAmount_ = new DividendAmountTypeEnum(excessDividendAmountNode);
                    }
                }
                else
                {
                    excessDividendAmount_ = new DividendAmountTypeEnum(excessDividendAmountNode);
                }
            }


            XmlNode currencyNode = xmlNode.SelectSingleNode("currency");

            if (currencyNode != null)
            {
                if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null)
                {
                    if (currencyNode.Attributes["id"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["id"].Value;
                        IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode);
                        IDManager.SetID(currencyIDRef_, ob);
                    }
                    else if (currencyNode.Attributes["href"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currency_ = new IdentifiedCurrency(currencyNode);
                    }
                }
                else
                {
                    currency_ = new IdentifiedCurrency(currencyNode);
                }
            }


            XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod");

            if (determinationMethodNode != null)
            {
                if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null)
                {
                    if (determinationMethodNode.Attributes["id"] != null)
                    {
                        determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value;
                        DeterminationMethod ob = new DeterminationMethod(determinationMethodNode);
                        IDManager.SetID(determinationMethodIDRef_, ob);
                    }
                    else if (determinationMethodNode.Attributes["href"] != null)
                    {
                        determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        determinationMethod_ = new DeterminationMethod(determinationMethodNode);
                    }
                }
                else
                {
                    determinationMethod_ = new DeterminationMethod(determinationMethodNode);
                }
            }


            XmlNode currencyReferenceNode = xmlNode.SelectSingleNode("currencyReference");

            if (currencyReferenceNode != null)
            {
                if (currencyReferenceNode.Attributes["href"] != null || currencyReferenceNode.Attributes["id"] != null)
                {
                    if (currencyReferenceNode.Attributes["id"] != null)
                    {
                        currencyReferenceIDRef_ = currencyReferenceNode.Attributes["id"].Value;
                        IdentifiedCurrencyReference ob = new IdentifiedCurrencyReference(currencyReferenceNode);
                        IDManager.SetID(currencyReferenceIDRef_, ob);
                    }
                    else if (currencyReferenceNode.Attributes["href"] != null)
                    {
                        currencyReferenceIDRef_ = currencyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
                    }
                }
                else
                {
                    currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode);
                }
            }


            XmlNode dividendFxTriggerDateNode = xmlNode.SelectSingleNode("dividendFxTriggerDate");

            if (dividendFxTriggerDateNode != null)
            {
                if (dividendFxTriggerDateNode.Attributes["href"] != null || dividendFxTriggerDateNode.Attributes["id"] != null)
                {
                    if (dividendFxTriggerDateNode.Attributes["id"] != null)
                    {
                        dividendFxTriggerDateIDRef_ = dividendFxTriggerDateNode.Attributes["id"].Value;
                        DividendPaymentDate ob = new DividendPaymentDate(dividendFxTriggerDateNode);
                        IDManager.SetID(dividendFxTriggerDateIDRef_, ob);
                    }
                    else if (dividendFxTriggerDateNode.Attributes["href"] != null)
                    {
                        dividendFxTriggerDateIDRef_ = dividendFxTriggerDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendFxTriggerDate_ = new DividendPaymentDate(dividendFxTriggerDateNode);
                    }
                }
                else
                {
                    dividendFxTriggerDate_ = new DividendPaymentDate(dividendFxTriggerDateNode);
                }
            }


            XmlNode interestAccrualsMethodNode = xmlNode.SelectSingleNode("interestAccrualsMethod");

            if (interestAccrualsMethodNode != null)
            {
                if (interestAccrualsMethodNode.Attributes["href"] != null || interestAccrualsMethodNode.Attributes["id"] != null)
                {
                    if (interestAccrualsMethodNode.Attributes["id"] != null)
                    {
                        interestAccrualsMethodIDRef_ = interestAccrualsMethodNode.Attributes["id"].Value;
                        InterestAccrualsCompoundingMethod ob = new InterestAccrualsCompoundingMethod(interestAccrualsMethodNode);
                        IDManager.SetID(interestAccrualsMethodIDRef_, ob);
                    }
                    else if (interestAccrualsMethodNode.Attributes["href"] != null)
                    {
                        interestAccrualsMethodIDRef_ = interestAccrualsMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        interestAccrualsMethod_ = new InterestAccrualsCompoundingMethod(interestAccrualsMethodNode);
                    }
                }
                else
                {
                    interestAccrualsMethod_ = new InterestAccrualsCompoundingMethod(interestAccrualsMethodNode);
                }
            }


            XmlNode numberOfIndexUnitsNode = xmlNode.SelectSingleNode("numberOfIndexUnits");

            if (numberOfIndexUnitsNode != null)
            {
                if (numberOfIndexUnitsNode.Attributes["href"] != null || numberOfIndexUnitsNode.Attributes["id"] != null)
                {
                    if (numberOfIndexUnitsNode.Attributes["id"] != null)
                    {
                        numberOfIndexUnitsIDRef_ = numberOfIndexUnitsNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(numberOfIndexUnitsNode);
                        IDManager.SetID(numberOfIndexUnitsIDRef_, ob);
                    }
                    else if (numberOfIndexUnitsNode.Attributes["href"] != null)
                    {
                        numberOfIndexUnitsIDRef_ = numberOfIndexUnitsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        numberOfIndexUnits_ = new NonNegativeDecimal(numberOfIndexUnitsNode);
                    }
                }
                else
                {
                    numberOfIndexUnits_ = new NonNegativeDecimal(numberOfIndexUnitsNode);
                }
            }


            XmlNode declaredCashDividendPercentageNode = xmlNode.SelectSingleNode("declaredCashDividendPercentage");

            if (declaredCashDividendPercentageNode != null)
            {
                if (declaredCashDividendPercentageNode.Attributes["href"] != null || declaredCashDividendPercentageNode.Attributes["id"] != null)
                {
                    if (declaredCashDividendPercentageNode.Attributes["id"] != null)
                    {
                        declaredCashDividendPercentageIDRef_ = declaredCashDividendPercentageNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(declaredCashDividendPercentageNode);
                        IDManager.SetID(declaredCashDividendPercentageIDRef_, ob);
                    }
                    else if (declaredCashDividendPercentageNode.Attributes["href"] != null)
                    {
                        declaredCashDividendPercentageIDRef_ = declaredCashDividendPercentageNode.Attributes["href"].Value;
                    }
                    else
                    {
                        declaredCashDividendPercentage_ = new NonNegativeDecimal(declaredCashDividendPercentageNode);
                    }
                }
                else
                {
                    declaredCashDividendPercentage_ = new NonNegativeDecimal(declaredCashDividendPercentageNode);
                }
            }


            XmlNode declaredCashEquivalentDividendPercentageNode = xmlNode.SelectSingleNode("declaredCashEquivalentDividendPercentage");

            if (declaredCashEquivalentDividendPercentageNode != null)
            {
                if (declaredCashEquivalentDividendPercentageNode.Attributes["href"] != null || declaredCashEquivalentDividendPercentageNode.Attributes["id"] != null)
                {
                    if (declaredCashEquivalentDividendPercentageNode.Attributes["id"] != null)
                    {
                        declaredCashEquivalentDividendPercentageIDRef_ = declaredCashEquivalentDividendPercentageNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(declaredCashEquivalentDividendPercentageNode);
                        IDManager.SetID(declaredCashEquivalentDividendPercentageIDRef_, ob);
                    }
                    else if (declaredCashEquivalentDividendPercentageNode.Attributes["href"] != null)
                    {
                        declaredCashEquivalentDividendPercentageIDRef_ = declaredCashEquivalentDividendPercentageNode.Attributes["href"].Value;
                    }
                    else
                    {
                        declaredCashEquivalentDividendPercentage_ = new NonNegativeDecimal(declaredCashEquivalentDividendPercentageNode);
                    }
                }
                else
                {
                    declaredCashEquivalentDividendPercentage_ = new NonNegativeDecimal(declaredCashEquivalentDividendPercentageNode);
                }
            }


            XmlNode nonCashDividendTreatmentNode = xmlNode.SelectSingleNode("nonCashDividendTreatment");

            if (nonCashDividendTreatmentNode != null)
            {
                if (nonCashDividendTreatmentNode.Attributes["href"] != null || nonCashDividendTreatmentNode.Attributes["id"] != null)
                {
                    if (nonCashDividendTreatmentNode.Attributes["id"] != null)
                    {
                        nonCashDividendTreatmentIDRef_ = nonCashDividendTreatmentNode.Attributes["id"].Value;
                        NonCashDividendTreatmentEnum ob = new NonCashDividendTreatmentEnum(nonCashDividendTreatmentNode);
                        IDManager.SetID(nonCashDividendTreatmentIDRef_, ob);
                    }
                    else if (nonCashDividendTreatmentNode.Attributes["href"] != null)
                    {
                        nonCashDividendTreatmentIDRef_ = nonCashDividendTreatmentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        nonCashDividendTreatment_ = new NonCashDividendTreatmentEnum(nonCashDividendTreatmentNode);
                    }
                }
                else
                {
                    nonCashDividendTreatment_ = new NonCashDividendTreatmentEnum(nonCashDividendTreatmentNode);
                }
            }


            XmlNode dividendCompositionNode = xmlNode.SelectSingleNode("dividendComposition");

            if (dividendCompositionNode != null)
            {
                if (dividendCompositionNode.Attributes["href"] != null || dividendCompositionNode.Attributes["id"] != null)
                {
                    if (dividendCompositionNode.Attributes["id"] != null)
                    {
                        dividendCompositionIDRef_ = dividendCompositionNode.Attributes["id"].Value;
                        DividendCompositionEnum ob = new DividendCompositionEnum(dividendCompositionNode);
                        IDManager.SetID(dividendCompositionIDRef_, ob);
                    }
                    else if (dividendCompositionNode.Attributes["href"] != null)
                    {
                        dividendCompositionIDRef_ = dividendCompositionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dividendComposition_ = new DividendCompositionEnum(dividendCompositionNode);
                    }
                }
                else
                {
                    dividendComposition_ = new DividendCompositionEnum(dividendCompositionNode);
                }
            }


            XmlNode specialDividendsNode = xmlNode.SelectSingleNode("specialDividends");

            if (specialDividendsNode != null)
            {
                if (specialDividendsNode.Attributes["href"] != null || specialDividendsNode.Attributes["id"] != null)
                {
                    if (specialDividendsNode.Attributes["id"] != null)
                    {
                        specialDividendsIDRef_ = specialDividendsNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(specialDividendsNode);
                        IDManager.SetID(specialDividendsIDRef_, ob);
                    }
                    else if (specialDividendsNode.Attributes["href"] != null)
                    {
                        specialDividendsIDRef_ = specialDividendsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        specialDividends_ = new XsdTypeBoolean(specialDividendsNode);
                    }
                }
                else
                {
                    specialDividends_ = new XsdTypeBoolean(specialDividendsNode);
                }
            }
        }
 public CommodityExercise(XmlNode xmlNode)
 {
     XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");
     if (americanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in americanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 americanExerciseIDRef = item.Attributes["id"].Name;
                 CommodityAmericanExercise ob = CommodityAmericanExercise();
                 IDManager.SetID(americanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 americanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 americanExercise = new CommodityAmericanExercise(item);
             }
         }
     }
     
 
     XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");
     if (europeanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in europeanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef = item.Attributes["id"].Name;
                 CommodityEuropeanExercise ob = CommodityEuropeanExercise();
                 IDManager.SetID(europeanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 europeanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 europeanExercise = new CommodityEuropeanExercise(item);
             }
         }
     }
     
 
     XmlNodeList automaticExerciseNodeList = xmlNode.SelectNodes("automaticExercise");
     if (automaticExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in automaticExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 automaticExerciseIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(automaticExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 automaticExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 automaticExercise = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList writtenConfirmationNodeList = xmlNode.SelectNodes("writtenConfirmation");
     if (writtenConfirmationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in writtenConfirmationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 writtenConfirmationIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(writtenConfirmationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 writtenConfirmationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 writtenConfirmation = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");
     if (settlementCurrencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementCurrencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementCurrencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(settlementCurrencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementCurrencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementCurrency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList fxNodeList = xmlNode.SelectNodes("fx");
     if (fxNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxIDRef = item.Attributes["id"].Name;
                 CommodityFx ob = CommodityFx();
                 IDManager.SetID(fxIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fx = new CommodityFx(item);
             }
         }
     }
     
 
     XmlNodeList conversionFactorNodeList = xmlNode.SelectNodes("conversionFactor");
     if (conversionFactorNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in conversionFactorNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 conversionFactorIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(conversionFactorIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 conversionFactorIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 conversionFactor = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates");
     if (relativePaymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in relativePaymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 relativePaymentDatesIDRef = item.Attributes["id"].Name;
                 CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                 IDManager.SetID(relativePaymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 relativePaymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 relativePaymentDates = new CommodityRelativePaymentDates(item);
             }
         }
     }
     
 
     XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates");
     if (paymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDatesIDRef = item.Attributes["id"].Name;
                 AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset();
                 IDManager.SetID(paymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDates = new AdjustableDatesOrRelativeDateOffset(item);
             }
         }
     }
     
 
     XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates");
     if (masterAgreementPaymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in masterAgreementPaymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(masterAgreementPaymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 masterAgreementPaymentDates = new XsdTypeBoolean(item);
             }
         }
     }
     
 
 }
 public UnderlyingAsset(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");
     if (currencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(currencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId");
     if (exchangeIdNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeIdIDRef = item.Attributes["id"].Name;
                 ExchangeId ob = ExchangeId();
                 IDManager.SetID(exchangeIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeId = new ExchangeId(item);
             }
         }
     }
     
 
     XmlNodeList clearanceSystemNodeList = xmlNode.SelectNodes("clearanceSystem");
     if (clearanceSystemNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in clearanceSystemNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 clearanceSystemIDRef = item.Attributes["id"].Name;
                 ClearanceSystem ob = ClearanceSystem();
                 IDManager.SetID(clearanceSystemIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 clearanceSystemIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 clearanceSystem = new ClearanceSystem(item);
             }
         }
     }
     
 
     XmlNodeList definitionNodeList = xmlNode.SelectNodes("definition");
     if (definitionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in definitionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 definitionIDRef = item.Attributes["id"].Name;
                 ProductReference ob = ProductReference();
                 IDManager.SetID(definitionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 definitionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 definition = new ProductReference(item);
             }
         }
     }
     
 
 }
        public UnderlyingAsset(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");

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

            foreach (XmlNode item in currencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(currencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId");

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

            foreach (XmlNode item in exchangeIdNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangeIdIDRef = item.Attributes["id"].Name;
                        ExchangeId ob = ExchangeId();
                        IDManager.SetID(exchangeIdIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangeIdIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangeId = new ExchangeId(item);
                    }
                }
            }


            XmlNodeList clearanceSystemNodeList = xmlNode.SelectNodes("clearanceSystem");

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

            foreach (XmlNode item in clearanceSystemNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        clearanceSystemIDRef = item.Attributes["id"].Name;
                        ClearanceSystem ob = ClearanceSystem();
                        IDManager.SetID(clearanceSystemIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        clearanceSystemIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        clearanceSystem = new ClearanceSystem(item);
                    }
                }
            }


            XmlNodeList definitionNodeList = xmlNode.SelectNodes("definition");

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

            foreach (XmlNode item in definitionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        definitionIDRef = item.Attributes["id"].Name;
                        ProductReference ob = ProductReference();
                        IDManager.SetID(definitionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        definitionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        definition = new ProductReference(item);
                    }
                }
            }
        }
 public CommoditySwap(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");
     
     if (effectiveDateNode != null)
     {
         if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) 
         {
             if (effectiveDateNode.Attributes["id"] != null) 
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(effectiveDateNode);
                 IDManager.SetID(effectiveDateIDRef_, ob);
             }
             else if (effectiveDateNode.Attributes["href"] != null)
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
             }
         }
         else
         {
             effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
         }
     }
     
 
     XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate");
     
     if (terminationDateNode != null)
     {
         if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null) 
         {
             if (terminationDateNode.Attributes["id"] != null) 
             {
                 terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(terminationDateNode);
                 IDManager.SetID(terminationDateIDRef_, ob);
             }
             else if (terminationDateNode.Attributes["href"] != null)
             {
                 terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value;
             }
             else
             {
                 terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode);
             }
         }
         else
         {
             terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode);
         }
     }
     
 
     XmlNode settlementCurrencyNode = xmlNode.SelectSingleNode("settlementCurrency");
     
     if (settlementCurrencyNode != null)
     {
         if (settlementCurrencyNode.Attributes["href"] != null || settlementCurrencyNode.Attributes["id"] != null) 
         {
             if (settlementCurrencyNode.Attributes["id"] != null) 
             {
                 settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["id"].Value;
                 IdentifiedCurrency ob = new IdentifiedCurrency(settlementCurrencyNode);
                 IDManager.SetID(settlementCurrencyIDRef_, ob);
             }
             else if (settlementCurrencyNode.Attributes["href"] != null)
             {
                 settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["href"].Value;
             }
             else
             {
                 settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
             }
         }
         else
         {
             settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
         }
     }
     
 
     XmlNode commoditySwapLegNode = xmlNode.SelectSingleNode("commoditySwapLeg");
     
     if (commoditySwapLegNode != null)
     {
         if (commoditySwapLegNode.Attributes["href"] != null || commoditySwapLegNode.Attributes["id"] != null) 
         {
             if (commoditySwapLegNode.Attributes["id"] != null) 
             {
                 commoditySwapLegIDRef_ = commoditySwapLegNode.Attributes["id"].Value;
                 CommoditySwapLeg ob = new CommoditySwapLeg(commoditySwapLegNode);
                 IDManager.SetID(commoditySwapLegIDRef_, ob);
             }
             else if (commoditySwapLegNode.Attributes["href"] != null)
             {
                 commoditySwapLegIDRef_ = commoditySwapLegNode.Attributes["href"].Value;
             }
             else
             {
                 commoditySwapLeg_ = new CommoditySwapLeg(commoditySwapLegNode);
             }
         }
         else
         {
             commoditySwapLeg_ = new CommoditySwapLeg(commoditySwapLegNode);
         }
     }
     
 
     XmlNode coalPhysicalLegNode = xmlNode.SelectSingleNode("coalPhysicalLeg");
     
     if (coalPhysicalLegNode != null)
     {
         if (coalPhysicalLegNode.Attributes["href"] != null || coalPhysicalLegNode.Attributes["id"] != null) 
         {
             if (coalPhysicalLegNode.Attributes["id"] != null) 
             {
                 coalPhysicalLegIDRef_ = coalPhysicalLegNode.Attributes["id"].Value;
                 CoalPhysicalLeg ob = new CoalPhysicalLeg(coalPhysicalLegNode);
                 IDManager.SetID(coalPhysicalLegIDRef_, ob);
             }
             else if (coalPhysicalLegNode.Attributes["href"] != null)
             {
                 coalPhysicalLegIDRef_ = coalPhysicalLegNode.Attributes["href"].Value;
             }
             else
             {
                 coalPhysicalLeg_ = new CoalPhysicalLeg(coalPhysicalLegNode);
             }
         }
         else
         {
             coalPhysicalLeg_ = new CoalPhysicalLeg(coalPhysicalLegNode);
         }
     }
     
 
     XmlNode electricityPhysicalLegNode = xmlNode.SelectSingleNode("electricityPhysicalLeg");
     
     if (electricityPhysicalLegNode != null)
     {
         if (electricityPhysicalLegNode.Attributes["href"] != null || electricityPhysicalLegNode.Attributes["id"] != null) 
         {
             if (electricityPhysicalLegNode.Attributes["id"] != null) 
             {
                 electricityPhysicalLegIDRef_ = electricityPhysicalLegNode.Attributes["id"].Value;
                 ElectricityPhysicalLeg ob = new ElectricityPhysicalLeg(electricityPhysicalLegNode);
                 IDManager.SetID(electricityPhysicalLegIDRef_, ob);
             }
             else if (electricityPhysicalLegNode.Attributes["href"] != null)
             {
                 electricityPhysicalLegIDRef_ = electricityPhysicalLegNode.Attributes["href"].Value;
             }
             else
             {
                 electricityPhysicalLeg_ = new ElectricityPhysicalLeg(electricityPhysicalLegNode);
             }
         }
         else
         {
             electricityPhysicalLeg_ = new ElectricityPhysicalLeg(electricityPhysicalLegNode);
         }
     }
     
 
     XmlNode environmentalPhysicalLegNode = xmlNode.SelectSingleNode("environmentalPhysicalLeg");
     
     if (environmentalPhysicalLegNode != null)
     {
         if (environmentalPhysicalLegNode.Attributes["href"] != null || environmentalPhysicalLegNode.Attributes["id"] != null) 
         {
             if (environmentalPhysicalLegNode.Attributes["id"] != null) 
             {
                 environmentalPhysicalLegIDRef_ = environmentalPhysicalLegNode.Attributes["id"].Value;
                 EnvironmentalPhysicalLeg ob = new EnvironmentalPhysicalLeg(environmentalPhysicalLegNode);
                 IDManager.SetID(environmentalPhysicalLegIDRef_, ob);
             }
             else if (environmentalPhysicalLegNode.Attributes["href"] != null)
             {
                 environmentalPhysicalLegIDRef_ = environmentalPhysicalLegNode.Attributes["href"].Value;
             }
             else
             {
                 environmentalPhysicalLeg_ = new EnvironmentalPhysicalLeg(environmentalPhysicalLegNode);
             }
         }
         else
         {
             environmentalPhysicalLeg_ = new EnvironmentalPhysicalLeg(environmentalPhysicalLegNode);
         }
     }
     
 
     XmlNode fixedLegNode = xmlNode.SelectSingleNode("fixedLeg");
     
     if (fixedLegNode != null)
     {
         if (fixedLegNode.Attributes["href"] != null || fixedLegNode.Attributes["id"] != null) 
         {
             if (fixedLegNode.Attributes["id"] != null) 
             {
                 fixedLegIDRef_ = fixedLegNode.Attributes["id"].Value;
                 FixedPriceLeg ob = new FixedPriceLeg(fixedLegNode);
                 IDManager.SetID(fixedLegIDRef_, ob);
             }
             else if (fixedLegNode.Attributes["href"] != null)
             {
                 fixedLegIDRef_ = fixedLegNode.Attributes["href"].Value;
             }
             else
             {
                 fixedLeg_ = new FixedPriceLeg(fixedLegNode);
             }
         }
         else
         {
             fixedLeg_ = new FixedPriceLeg(fixedLegNode);
         }
     }
     
 
     XmlNode floatingLegNode = xmlNode.SelectSingleNode("floatingLeg");
     
     if (floatingLegNode != null)
     {
         if (floatingLegNode.Attributes["href"] != null || floatingLegNode.Attributes["id"] != null) 
         {
             if (floatingLegNode.Attributes["id"] != null) 
             {
                 floatingLegIDRef_ = floatingLegNode.Attributes["id"].Value;
                 FloatingPriceLeg ob = new FloatingPriceLeg(floatingLegNode);
                 IDManager.SetID(floatingLegIDRef_, ob);
             }
             else if (floatingLegNode.Attributes["href"] != null)
             {
                 floatingLegIDRef_ = floatingLegNode.Attributes["href"].Value;
             }
             else
             {
                 floatingLeg_ = new FloatingPriceLeg(floatingLegNode);
             }
         }
         else
         {
             floatingLeg_ = new FloatingPriceLeg(floatingLegNode);
         }
     }
     
 
     XmlNode gasPhysicalLegNode = xmlNode.SelectSingleNode("gasPhysicalLeg");
     
     if (gasPhysicalLegNode != null)
     {
         if (gasPhysicalLegNode.Attributes["href"] != null || gasPhysicalLegNode.Attributes["id"] != null) 
         {
             if (gasPhysicalLegNode.Attributes["id"] != null) 
             {
                 gasPhysicalLegIDRef_ = gasPhysicalLegNode.Attributes["id"].Value;
                 GasPhysicalLeg ob = new GasPhysicalLeg(gasPhysicalLegNode);
                 IDManager.SetID(gasPhysicalLegIDRef_, ob);
             }
             else if (gasPhysicalLegNode.Attributes["href"] != null)
             {
                 gasPhysicalLegIDRef_ = gasPhysicalLegNode.Attributes["href"].Value;
             }
             else
             {
                 gasPhysicalLeg_ = new GasPhysicalLeg(gasPhysicalLegNode);
             }
         }
         else
         {
             gasPhysicalLeg_ = new GasPhysicalLeg(gasPhysicalLegNode);
         }
     }
     
 
     XmlNode oilPhysicalLegNode = xmlNode.SelectSingleNode("oilPhysicalLeg");
     
     if (oilPhysicalLegNode != null)
     {
         if (oilPhysicalLegNode.Attributes["href"] != null || oilPhysicalLegNode.Attributes["id"] != null) 
         {
             if (oilPhysicalLegNode.Attributes["id"] != null) 
             {
                 oilPhysicalLegIDRef_ = oilPhysicalLegNode.Attributes["id"].Value;
                 OilPhysicalLeg ob = new OilPhysicalLeg(oilPhysicalLegNode);
                 IDManager.SetID(oilPhysicalLegIDRef_, ob);
             }
             else if (oilPhysicalLegNode.Attributes["href"] != null)
             {
                 oilPhysicalLegIDRef_ = oilPhysicalLegNode.Attributes["href"].Value;
             }
             else
             {
                 oilPhysicalLeg_ = new OilPhysicalLeg(oilPhysicalLegNode);
             }
         }
         else
         {
             oilPhysicalLeg_ = new OilPhysicalLeg(oilPhysicalLegNode);
         }
     }
     
 
     XmlNodeList weatherLegNodeList = xmlNode.SelectNodes("weatherLeg");
     
     if (weatherLegNodeList != null)
     {
         this.weatherLeg_ = new List<WeatherLeg>();
         foreach (XmlNode item in weatherLegNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     weatherLegIDRef_ = item.Attributes["id"].Value;
                     weatherLeg_.Add(new WeatherLeg(item));
                     IDManager.SetID(weatherLegIDRef_, weatherLeg_[weatherLeg_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     weatherLegIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 weatherLeg_.Add(new WeatherLeg(item));
                 }
             }
             else
             {
                 weatherLeg_.Add(new WeatherLeg(item));
             }
         }
     }
     
 
     XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing");
     
     if (commonPricingNode != null)
     {
         if (commonPricingNode.Attributes["href"] != null || commonPricingNode.Attributes["id"] != null) 
         {
             if (commonPricingNode.Attributes["id"] != null) 
             {
                 commonPricingIDRef_ = commonPricingNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(commonPricingNode);
                 IDManager.SetID(commonPricingIDRef_, ob);
             }
             else if (commonPricingNode.Attributes["href"] != null)
             {
                 commonPricingIDRef_ = commonPricingNode.Attributes["href"].Value;
             }
             else
             {
                 commonPricing_ = new XsdTypeBoolean(commonPricingNode);
             }
         }
         else
         {
             commonPricing_ = new XsdTypeBoolean(commonPricingNode);
         }
     }
     
 
     XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption");
     
     if (marketDisruptionNode != null)
     {
         if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) 
         {
             if (marketDisruptionNode.Attributes["id"] != null) 
             {
                 marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value;
                 CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode);
                 IDManager.SetID(marketDisruptionIDRef_, ob);
             }
             else if (marketDisruptionNode.Attributes["href"] != null)
             {
                 marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value;
             }
             else
             {
                 marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
             }
         }
         else
         {
             marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
         }
     }
     
 
     XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption");
     
     if (settlementDisruptionNode != null)
     {
         if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null) 
         {
             if (settlementDisruptionNode.Attributes["id"] != null) 
             {
                 settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value;
                 CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                 IDManager.SetID(settlementDisruptionIDRef_, ob);
             }
             else if (settlementDisruptionNode.Attributes["href"] != null)
             {
                 settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value;
             }
             else
             {
                 settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
             }
         }
         else
         {
             settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
         }
     }
     
 
     XmlNode roundingNode = xmlNode.SelectSingleNode("rounding");
     
     if (roundingNode != null)
     {
         if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null) 
         {
             if (roundingNode.Attributes["id"] != null) 
             {
                 roundingIDRef_ = roundingNode.Attributes["id"].Value;
                 Rounding ob = new Rounding(roundingNode);
                 IDManager.SetID(roundingIDRef_, ob);
             }
             else if (roundingNode.Attributes["href"] != null)
             {
                 roundingIDRef_ = roundingNode.Attributes["href"].Value;
             }
             else
             {
                 rounding_ = new Rounding(roundingNode);
             }
         }
         else
         {
             rounding_ = new Rounding(roundingNode);
         }
     }
     
 
 }
        public UnderlyingAsset(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode currencyNode = xmlNode.SelectSingleNode("currency");

            if (currencyNode != null)
            {
                if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null)
                {
                    if (currencyNode.Attributes["id"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["id"].Value;
                        IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode);
                        IDManager.SetID(currencyIDRef_, ob);
                    }
                    else if (currencyNode.Attributes["href"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currency_ = new IdentifiedCurrency(currencyNode);
                    }
                }
                else
                {
                    currency_ = new IdentifiedCurrency(currencyNode);
                }
            }


            XmlNode exchangeIdNode = xmlNode.SelectSingleNode("exchangeId");

            if (exchangeIdNode != null)
            {
                if (exchangeIdNode.Attributes["href"] != null || exchangeIdNode.Attributes["id"] != null)
                {
                    if (exchangeIdNode.Attributes["id"] != null)
                    {
                        exchangeIdIDRef_ = exchangeIdNode.Attributes["id"].Value;
                        ExchangeId ob = new ExchangeId(exchangeIdNode);
                        IDManager.SetID(exchangeIdIDRef_, ob);
                    }
                    else if (exchangeIdNode.Attributes["href"] != null)
                    {
                        exchangeIdIDRef_ = exchangeIdNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangeId_ = new ExchangeId(exchangeIdNode);
                    }
                }
                else
                {
                    exchangeId_ = new ExchangeId(exchangeIdNode);
                }
            }


            XmlNode clearanceSystemNode = xmlNode.SelectSingleNode("clearanceSystem");

            if (clearanceSystemNode != null)
            {
                if (clearanceSystemNode.Attributes["href"] != null || clearanceSystemNode.Attributes["id"] != null)
                {
                    if (clearanceSystemNode.Attributes["id"] != null)
                    {
                        clearanceSystemIDRef_ = clearanceSystemNode.Attributes["id"].Value;
                        ClearanceSystem ob = new ClearanceSystem(clearanceSystemNode);
                        IDManager.SetID(clearanceSystemIDRef_, ob);
                    }
                    else if (clearanceSystemNode.Attributes["href"] != null)
                    {
                        clearanceSystemIDRef_ = clearanceSystemNode.Attributes["href"].Value;
                    }
                    else
                    {
                        clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
                    }
                }
                else
                {
                    clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
                }
            }


            XmlNode definitionNode = xmlNode.SelectSingleNode("definition");

            if (definitionNode != null)
            {
                if (definitionNode.Attributes["href"] != null || definitionNode.Attributes["id"] != null)
                {
                    if (definitionNode.Attributes["id"] != null)
                    {
                        definitionIDRef_ = definitionNode.Attributes["id"].Value;
                        ProductReference ob = new ProductReference(definitionNode);
                        IDManager.SetID(definitionIDRef_, ob);
                    }
                    else if (definitionNode.Attributes["href"] != null)
                    {
                        definitionIDRef_ = definitionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        definition_ = new ProductReference(definitionNode);
                    }
                }
                else
                {
                    definition_ = new ProductReference(definitionNode);
                }
            }
        }
 public CommodityExercise(XmlNode xmlNode)
 {
     XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");
     
     if (americanExerciseNode != null)
     {
         if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) 
         {
             if (americanExerciseNode.Attributes["id"] != null) 
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                 CommodityAmericanExercise ob = new CommodityAmericanExercise(americanExerciseNode);
                 IDManager.SetID(americanExerciseIDRef_, ob);
             }
             else if (americanExerciseNode.Attributes["href"] != null)
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 americanExercise_ = new CommodityAmericanExercise(americanExerciseNode);
             }
         }
         else
         {
             americanExercise_ = new CommodityAmericanExercise(americanExerciseNode);
         }
     }
     
 
     XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");
     
     if (europeanExerciseNode != null)
     {
         if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) 
         {
             if (europeanExerciseNode.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                 CommodityEuropeanExercise ob = new CommodityEuropeanExercise(europeanExerciseNode);
                 IDManager.SetID(europeanExerciseIDRef_, ob);
             }
             else if (europeanExerciseNode.Attributes["href"] != null)
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 europeanExercise_ = new CommodityEuropeanExercise(europeanExerciseNode);
             }
         }
         else
         {
             europeanExercise_ = new CommodityEuropeanExercise(europeanExerciseNode);
         }
     }
     
 
     XmlNode automaticExerciseNode = xmlNode.SelectSingleNode("automaticExercise");
     
     if (automaticExerciseNode != null)
     {
         if (automaticExerciseNode.Attributes["href"] != null || automaticExerciseNode.Attributes["id"] != null) 
         {
             if (automaticExerciseNode.Attributes["id"] != null) 
             {
                 automaticExerciseIDRef_ = automaticExerciseNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(automaticExerciseNode);
                 IDManager.SetID(automaticExerciseIDRef_, ob);
             }
             else if (automaticExerciseNode.Attributes["href"] != null)
             {
                 automaticExerciseIDRef_ = automaticExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 automaticExercise_ = new XsdTypeBoolean(automaticExerciseNode);
             }
         }
         else
         {
             automaticExercise_ = new XsdTypeBoolean(automaticExerciseNode);
         }
     }
     
 
     XmlNode writtenConfirmationNode = xmlNode.SelectSingleNode("writtenConfirmation");
     
     if (writtenConfirmationNode != null)
     {
         if (writtenConfirmationNode.Attributes["href"] != null || writtenConfirmationNode.Attributes["id"] != null) 
         {
             if (writtenConfirmationNode.Attributes["id"] != null) 
             {
                 writtenConfirmationIDRef_ = writtenConfirmationNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(writtenConfirmationNode);
                 IDManager.SetID(writtenConfirmationIDRef_, ob);
             }
             else if (writtenConfirmationNode.Attributes["href"] != null)
             {
                 writtenConfirmationIDRef_ = writtenConfirmationNode.Attributes["href"].Value;
             }
             else
             {
                 writtenConfirmation_ = new XsdTypeBoolean(writtenConfirmationNode);
             }
         }
         else
         {
             writtenConfirmation_ = new XsdTypeBoolean(writtenConfirmationNode);
         }
     }
     
 
     XmlNode settlementCurrencyNode = xmlNode.SelectSingleNode("settlementCurrency");
     
     if (settlementCurrencyNode != null)
     {
         if (settlementCurrencyNode.Attributes["href"] != null || settlementCurrencyNode.Attributes["id"] != null) 
         {
             if (settlementCurrencyNode.Attributes["id"] != null) 
             {
                 settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["id"].Value;
                 IdentifiedCurrency ob = new IdentifiedCurrency(settlementCurrencyNode);
                 IDManager.SetID(settlementCurrencyIDRef_, ob);
             }
             else if (settlementCurrencyNode.Attributes["href"] != null)
             {
                 settlementCurrencyIDRef_ = settlementCurrencyNode.Attributes["href"].Value;
             }
             else
             {
                 settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
             }
         }
         else
         {
             settlementCurrency_ = new IdentifiedCurrency(settlementCurrencyNode);
         }
     }
     
 
     XmlNode fxNode = xmlNode.SelectSingleNode("fx");
     
     if (fxNode != null)
     {
         if (fxNode.Attributes["href"] != null || fxNode.Attributes["id"] != null) 
         {
             if (fxNode.Attributes["id"] != null) 
             {
                 fxIDRef_ = fxNode.Attributes["id"].Value;
                 CommodityFx ob = new CommodityFx(fxNode);
                 IDManager.SetID(fxIDRef_, ob);
             }
             else if (fxNode.Attributes["href"] != null)
             {
                 fxIDRef_ = fxNode.Attributes["href"].Value;
             }
             else
             {
                 fx_ = new CommodityFx(fxNode);
             }
         }
         else
         {
             fx_ = new CommodityFx(fxNode);
         }
     }
     
 
     XmlNode conversionFactorNode = xmlNode.SelectSingleNode("conversionFactor");
     
     if (conversionFactorNode != null)
     {
         if (conversionFactorNode.Attributes["href"] != null || conversionFactorNode.Attributes["id"] != null) 
         {
             if (conversionFactorNode.Attributes["id"] != null) 
             {
                 conversionFactorIDRef_ = conversionFactorNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(conversionFactorNode);
                 IDManager.SetID(conversionFactorIDRef_, ob);
             }
             else if (conversionFactorNode.Attributes["href"] != null)
             {
                 conversionFactorIDRef_ = conversionFactorNode.Attributes["href"].Value;
             }
             else
             {
                 conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
             }
         }
         else
         {
             conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
         }
     }
     
 
     XmlNode relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates");
     
     if (relativePaymentDatesNode != null)
     {
         if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null) 
         {
             if (relativePaymentDatesNode.Attributes["id"] != null) 
             {
                 relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value;
                 CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                 IDManager.SetID(relativePaymentDatesIDRef_, ob);
             }
             else if (relativePaymentDatesNode.Attributes["href"] != null)
             {
                 relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
             }
         }
         else
         {
             relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
         }
     }
     
 
     XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates");
     
     if (paymentDatesNode != null)
     {
         if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null) 
         {
             if (paymentDatesNode.Attributes["id"] != null) 
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value;
                 AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                 IDManager.SetID(paymentDatesIDRef_, ob);
             }
             else if (paymentDatesNode.Attributes["href"] != null)
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
             }
         }
         else
         {
             paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
         }
     }
     
 
     XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates");
     
     if (masterAgreementPaymentDatesNode != null)
     {
         if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null) 
         {
             if (masterAgreementPaymentDatesNode.Attributes["id"] != null) 
             {
                 masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                 IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob);
             }
             else if (masterAgreementPaymentDatesNode.Attributes["href"] != null)
             {
                 masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
             }
         }
         else
         {
             masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
         }
     }
     
 
 }
Esempio n. 23
0
        public DividendConditions(XmlNode xmlNode)
        {
            XmlNodeList dividendReinvestmentNodeList = xmlNode.SelectNodes("dividendReinvestment");

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

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


            XmlNodeList dividendEntitlementNodeList = xmlNode.SelectNodes("dividendEntitlement");

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

            foreach (XmlNode item in dividendEntitlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendEntitlementIDRef = item.Attributes["id"].Name;
                        DividendEntitlementEnum ob = DividendEntitlementEnum();
                        IDManager.SetID(dividendEntitlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendEntitlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendEntitlement = new DividendEntitlementEnum(item);
                    }
                }
            }


            XmlNodeList dividendAmountNodeList = xmlNode.SelectNodes("dividendAmount");

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

            foreach (XmlNode item in dividendAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendAmountIDRef = item.Attributes["id"].Name;
                        DividendAmountTypeEnum ob = DividendAmountTypeEnum();
                        IDManager.SetID(dividendAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendAmount = new DividendAmountTypeEnum(item);
                    }
                }
            }


            XmlNodeList dividendPaymentDateNodeList = xmlNode.SelectNodes("dividendPaymentDate");

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

            foreach (XmlNode item in dividendPaymentDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendPaymentDateIDRef = item.Attributes["id"].Name;
                        DividendPaymentDate ob = DividendPaymentDate();
                        IDManager.SetID(dividendPaymentDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendPaymentDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendPaymentDate = new DividendPaymentDate(item);
                    }
                }
            }


            XmlNodeList dividendPeriodEffectiveDateNodeList = xmlNode.SelectNodes("dividendPeriodEffectiveDate");

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

            foreach (XmlNode item in dividendPeriodEffectiveDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendPeriodEffectiveDateIDRef = item.Attributes["id"].Name;
                        DateReference ob = DateReference();
                        IDManager.SetID(dividendPeriodEffectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendPeriodEffectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendPeriodEffectiveDate = new DateReference(item);
                    }
                }
            }


            XmlNodeList dividendPeriodEndDateNodeList = xmlNode.SelectNodes("dividendPeriodEndDate");

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

            foreach (XmlNode item in dividendPeriodEndDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendPeriodEndDateIDRef = item.Attributes["id"].Name;
                        DateReference ob = DateReference();
                        IDManager.SetID(dividendPeriodEndDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendPeriodEndDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendPeriodEndDate = new DateReference(item);
                    }
                }
            }


            XmlNodeList dividendPeriodNodeList = xmlNode.SelectNodes("dividendPeriod");

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

            foreach (XmlNode item in dividendPeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendPeriodIDRef = item.Attributes["id"].Name;
                        DividendPeriodEnum ob = DividendPeriodEnum();
                        IDManager.SetID(dividendPeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendPeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendPeriod = new DividendPeriodEnum(item);
                    }
                }
            }


            XmlNodeList extraOrdinaryDividendsNodeList = xmlNode.SelectNodes("extraOrdinaryDividends");

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

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


            XmlNodeList excessDividendAmountNodeList = xmlNode.SelectNodes("excessDividendAmount");

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

            foreach (XmlNode item in excessDividendAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        excessDividendAmountIDRef = item.Attributes["id"].Name;
                        DividendAmountTypeEnum ob = DividendAmountTypeEnum();
                        IDManager.SetID(excessDividendAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        excessDividendAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        excessDividendAmount = new DividendAmountTypeEnum(item);
                    }
                }
            }


            XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");

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

            foreach (XmlNode item in currencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(currencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod");

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

            foreach (XmlNode item in determinationMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        determinationMethodIDRef = item.Attributes["id"].Name;
                        DeterminationMethod ob = DeterminationMethod();
                        IDManager.SetID(determinationMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        determinationMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        determinationMethod = new DeterminationMethod(item);
                    }
                }
            }


            XmlNodeList currencyReferenceNodeList = xmlNode.SelectNodes("currencyReference");

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

            foreach (XmlNode item in currencyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyReferenceIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrencyReference ob = IdentifiedCurrencyReference();
                        IDManager.SetID(currencyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currencyReference = new IdentifiedCurrencyReference(item);
                    }
                }
            }


            XmlNodeList dividendFxTriggerDateNodeList = xmlNode.SelectNodes("dividendFxTriggerDate");

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

            foreach (XmlNode item in dividendFxTriggerDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendFxTriggerDateIDRef = item.Attributes["id"].Name;
                        DividendPaymentDate ob = DividendPaymentDate();
                        IDManager.SetID(dividendFxTriggerDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendFxTriggerDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendFxTriggerDate = new DividendPaymentDate(item);
                    }
                }
            }


            XmlNodeList interestAccrualsMethodNodeList = xmlNode.SelectNodes("interestAccrualsMethod");

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

            foreach (XmlNode item in interestAccrualsMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        interestAccrualsMethodIDRef = item.Attributes["id"].Name;
                        InterestAccrualsCompoundingMethod ob = InterestAccrualsCompoundingMethod();
                        IDManager.SetID(interestAccrualsMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        interestAccrualsMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        interestAccrualsMethod = new InterestAccrualsCompoundingMethod(item);
                    }
                }
            }


            XmlNodeList numberOfIndexUnitsNodeList = xmlNode.SelectNodes("numberOfIndexUnits");

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

            foreach (XmlNode item in numberOfIndexUnitsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        numberOfIndexUnitsIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(numberOfIndexUnitsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        numberOfIndexUnitsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        numberOfIndexUnits = new NonNegativeDecimal(item);
                    }
                }
            }


            XmlNodeList declaredCashDividendPercentageNodeList = xmlNode.SelectNodes("declaredCashDividendPercentage");

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

            foreach (XmlNode item in declaredCashDividendPercentageNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        declaredCashDividendPercentageIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(declaredCashDividendPercentageIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        declaredCashDividendPercentageIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        declaredCashDividendPercentage = new NonNegativeDecimal(item);
                    }
                }
            }


            XmlNodeList declaredCashEquivalentDividendPercentageNodeList = xmlNode.SelectNodes("declaredCashEquivalentDividendPercentage");

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

            foreach (XmlNode item in declaredCashEquivalentDividendPercentageNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        declaredCashEquivalentDividendPercentageIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(declaredCashEquivalentDividendPercentageIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        declaredCashEquivalentDividendPercentageIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        declaredCashEquivalentDividendPercentage = new NonNegativeDecimal(item);
                    }
                }
            }


            XmlNodeList nonCashDividendTreatmentNodeList = xmlNode.SelectNodes("nonCashDividendTreatment");

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

            foreach (XmlNode item in nonCashDividendTreatmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        nonCashDividendTreatmentIDRef = item.Attributes["id"].Name;
                        NonCashDividendTreatmentEnum ob = NonCashDividendTreatmentEnum();
                        IDManager.SetID(nonCashDividendTreatmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        nonCashDividendTreatmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        nonCashDividendTreatment = new NonCashDividendTreatmentEnum(item);
                    }
                }
            }


            XmlNodeList dividendCompositionNodeList = xmlNode.SelectNodes("dividendComposition");

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

            foreach (XmlNode item in dividendCompositionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dividendCompositionIDRef = item.Attributes["id"].Name;
                        DividendCompositionEnum ob = DividendCompositionEnum();
                        IDManager.SetID(dividendCompositionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dividendCompositionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dividendComposition = new DividendCompositionEnum(item);
                    }
                }
            }


            XmlNodeList specialDividendsNodeList = xmlNode.SelectNodes("specialDividends");

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

            foreach (XmlNode item in specialDividendsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        specialDividendsIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(specialDividendsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        specialDividendsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        specialDividends = new XsdTypeBoolean(item);
                    }
                }
            }
        }
 public UnderlyingAsset(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode currencyNode = xmlNode.SelectSingleNode("currency");
     
     if (currencyNode != null)
     {
         if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) 
         {
             if (currencyNode.Attributes["id"] != null) 
             {
                 currencyIDRef_ = currencyNode.Attributes["id"].Value;
                 IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode);
                 IDManager.SetID(currencyIDRef_, ob);
             }
             else if (currencyNode.Attributes["href"] != null)
             {
                 currencyIDRef_ = currencyNode.Attributes["href"].Value;
             }
             else
             {
                 currency_ = new IdentifiedCurrency(currencyNode);
             }
         }
         else
         {
             currency_ = new IdentifiedCurrency(currencyNode);
         }
     }
     
 
     XmlNode exchangeIdNode = xmlNode.SelectSingleNode("exchangeId");
     
     if (exchangeIdNode != null)
     {
         if (exchangeIdNode.Attributes["href"] != null || exchangeIdNode.Attributes["id"] != null) 
         {
             if (exchangeIdNode.Attributes["id"] != null) 
             {
                 exchangeIdIDRef_ = exchangeIdNode.Attributes["id"].Value;
                 ExchangeId ob = new ExchangeId(exchangeIdNode);
                 IDManager.SetID(exchangeIdIDRef_, ob);
             }
             else if (exchangeIdNode.Attributes["href"] != null)
             {
                 exchangeIdIDRef_ = exchangeIdNode.Attributes["href"].Value;
             }
             else
             {
                 exchangeId_ = new ExchangeId(exchangeIdNode);
             }
         }
         else
         {
             exchangeId_ = new ExchangeId(exchangeIdNode);
         }
     }
     
 
     XmlNode clearanceSystemNode = xmlNode.SelectSingleNode("clearanceSystem");
     
     if (clearanceSystemNode != null)
     {
         if (clearanceSystemNode.Attributes["href"] != null || clearanceSystemNode.Attributes["id"] != null) 
         {
             if (clearanceSystemNode.Attributes["id"] != null) 
             {
                 clearanceSystemIDRef_ = clearanceSystemNode.Attributes["id"].Value;
                 ClearanceSystem ob = new ClearanceSystem(clearanceSystemNode);
                 IDManager.SetID(clearanceSystemIDRef_, ob);
             }
             else if (clearanceSystemNode.Attributes["href"] != null)
             {
                 clearanceSystemIDRef_ = clearanceSystemNode.Attributes["href"].Value;
             }
             else
             {
                 clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
             }
         }
         else
         {
             clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
         }
     }
     
 
     XmlNode definitionNode = xmlNode.SelectSingleNode("definition");
     
     if (definitionNode != null)
     {
         if (definitionNode.Attributes["href"] != null || definitionNode.Attributes["id"] != null) 
         {
             if (definitionNode.Attributes["id"] != null) 
             {
                 definitionIDRef_ = definitionNode.Attributes["id"].Value;
                 ProductReference ob = new ProductReference(definitionNode);
                 IDManager.SetID(definitionIDRef_, ob);
             }
             else if (definitionNode.Attributes["href"] != null)
             {
                 definitionIDRef_ = definitionNode.Attributes["href"].Value;
             }
             else
             {
                 definition_ = new ProductReference(definitionNode);
             }
         }
         else
         {
             definition_ = new ProductReference(definitionNode);
         }
     }
     
 
 }