public FloatingLegCalculation(XmlNode xmlNode)
 {
     XmlNode pricingDatesNode = xmlNode.SelectSingleNode("pricingDates");
     
     if (pricingDatesNode != null)
     {
         if (pricingDatesNode.Attributes["href"] != null || pricingDatesNode.Attributes["id"] != null) 
         {
             if (pricingDatesNode.Attributes["id"] != null) 
             {
                 pricingDatesIDRef_ = pricingDatesNode.Attributes["id"].Value;
                 CommodityPricingDates ob = new CommodityPricingDates(pricingDatesNode);
                 IDManager.SetID(pricingDatesIDRef_, ob);
             }
             else if (pricingDatesNode.Attributes["href"] != null)
             {
                 pricingDatesIDRef_ = pricingDatesNode.Attributes["href"].Value;
             }
             else
             {
                 pricingDates_ = new CommodityPricingDates(pricingDatesNode);
             }
         }
         else
         {
             pricingDates_ = new CommodityPricingDates(pricingDatesNode);
         }
     }
     
 
     XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");
     
     if (averagingMethodNode != null)
     {
         if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null) 
         {
             if (averagingMethodNode.Attributes["id"] != null) 
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                 AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                 IDManager.SetID(averagingMethodIDRef_, ob);
             }
             else if (averagingMethodNode.Attributes["href"] != null)
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
             }
             else
             {
                 averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
             }
         }
         else
         {
             averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
         }
     }
     
 
     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 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);
         }
     }
     
 
     XmlNode spreadNode = xmlNode.SelectSingleNode("spread");
     
     if (spreadNode != null)
     {
         if (spreadNode.Attributes["href"] != null || spreadNode.Attributes["id"] != null) 
         {
             if (spreadNode.Attributes["id"] != null) 
             {
                 spreadIDRef_ = spreadNode.Attributes["id"].Value;
                 CommoditySpread ob = new CommoditySpread(spreadNode);
                 IDManager.SetID(spreadIDRef_, ob);
             }
             else if (spreadNode.Attributes["href"] != null)
             {
                 spreadIDRef_ = spreadNode.Attributes["href"].Value;
             }
             else
             {
                 spread_ = new CommoditySpread(spreadNode);
             }
         }
         else
         {
             spread_ = new CommoditySpread(spreadNode);
         }
     }
     
 
     XmlNodeList spreadScheduleNodeList = xmlNode.SelectNodes("spreadSchedule");
     
     if (spreadScheduleNodeList != null)
     {
         this.spreadSchedule_ = new List<CommoditySpreadSchedule>();
         foreach (XmlNode item in spreadScheduleNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     spreadScheduleIDRef_ = item.Attributes["id"].Value;
                     spreadSchedule_.Add(new CommoditySpreadSchedule(item));
                     IDManager.SetID(spreadScheduleIDRef_, spreadSchedule_[spreadSchedule_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     spreadScheduleIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 spreadSchedule_.Add(new CommoditySpreadSchedule(item));
                 }
             }
             else
             {
                 spreadSchedule_.Add(new CommoditySpreadSchedule(item));
             }
         }
     }
     
 
     XmlNode spreadPercentageNode = xmlNode.SelectSingleNode("spreadPercentage");
     
     if (spreadPercentageNode != null)
     {
         if (spreadPercentageNode.Attributes["href"] != null || spreadPercentageNode.Attributes["id"] != null) 
         {
             if (spreadPercentageNode.Attributes["id"] != null) 
             {
                 spreadPercentageIDRef_ = spreadPercentageNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(spreadPercentageNode);
                 IDManager.SetID(spreadPercentageIDRef_, ob);
             }
             else if (spreadPercentageNode.Attributes["href"] != null)
             {
                 spreadPercentageIDRef_ = spreadPercentageNode.Attributes["href"].Value;
             }
             else
             {
                 spreadPercentage_ = new XsdTypeDecimal(spreadPercentageNode);
             }
         }
         else
         {
             spreadPercentage_ = new XsdTypeDecimal(spreadPercentageNode);
         }
     }
     
 
     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);
         }
     }
     
 
 }
Esempio n. 2
0
        public FloatingLegCalculation(XmlNode xmlNode)
        {
            XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates");

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

            foreach (XmlNode item in pricingDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pricingDatesIDRef = item.Attributes["id"].Name;
                        CommodityPricingDates ob = CommodityPricingDates();
                        IDManager.SetID(pricingDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pricingDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pricingDates = new CommodityPricingDates(item);
                    }
                }
            }


            XmlNodeList averagingMethodNodeList = xmlNode.SelectNodes("averagingMethod");

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

            foreach (XmlNode item in averagingMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        averagingMethodIDRef = item.Attributes["id"].Name;
                        AveragingMethodEnum ob = AveragingMethodEnum();
                        IDManager.SetID(averagingMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        averagingMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        averagingMethod = new AveragingMethodEnum(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 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);
                    }
                }
            }


            XmlNodeList spreadNodeList = xmlNode.SelectNodes("spread");

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

            foreach (XmlNode item in spreadNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        spreadIDRef = item.Attributes["id"].Name;
                        CommoditySpread ob = CommoditySpread();
                        IDManager.SetID(spreadIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        spreadIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        spread = new CommoditySpread(item);
                    }
                }
            }


            XmlNodeList spreadScheduleNodeList = xmlNode.SelectNodes("spreadSchedule");

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


            XmlNodeList spreadPercentageNodeList = xmlNode.SelectNodes("spreadPercentage");

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

            foreach (XmlNode item in spreadPercentageNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        spreadPercentageIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(spreadPercentageIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        spreadPercentageIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        spreadPercentage = new XsdTypeDecimal(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);
                    }
                }
            }
        }
 public CommodityOption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType");
     
     if (optionTypeNode != null)
     {
         if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) 
         {
             if (optionTypeNode.Attributes["id"] != null) 
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value;
                 PutCallEnum ob = new PutCallEnum(optionTypeNode);
                 IDManager.SetID(optionTypeIDRef_, ob);
             }
             else if (optionTypeNode.Attributes["href"] != null)
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
             }
             else
             {
                 optionType_ = new PutCallEnum(optionTypeNode);
             }
         }
         else
         {
             optionType_ = new PutCallEnum(optionTypeNode);
         }
     }
     
 
     XmlNode commodityNode = xmlNode.SelectSingleNode("commodity");
     
     if (commodityNode != null)
     {
         if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) 
         {
             if (commodityNode.Attributes["id"] != null) 
             {
                 commodityIDRef_ = commodityNode.Attributes["id"].Value;
                 Commodity ob = new Commodity(commodityNode);
                 IDManager.SetID(commodityIDRef_, ob);
             }
             else if (commodityNode.Attributes["href"] != null)
             {
                 commodityIDRef_ = commodityNode.Attributes["href"].Value;
             }
             else
             {
                 commodity_ = new Commodity(commodityNode);
             }
         }
         else
         {
             commodity_ = new Commodity(commodityNode);
         }
     }
     
 
     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 calculationPeriodsScheduleNode = xmlNode.SelectSingleNode("calculationPeriodsSchedule");
     
     if (calculationPeriodsScheduleNode != null)
     {
         if (calculationPeriodsScheduleNode.Attributes["href"] != null || calculationPeriodsScheduleNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsScheduleNode.Attributes["id"] != null) 
             {
                 calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["id"].Value;
                 CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode);
                 IDManager.SetID(calculationPeriodsScheduleIDRef_, ob);
             }
             else if (calculationPeriodsScheduleNode.Attributes["href"] != null)
             {
                 calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode);
             }
         }
         else
         {
             calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode);
         }
     }
     
 
     XmlNode calculationPeriodsNode = xmlNode.SelectSingleNode("calculationPeriods");
     
     if (calculationPeriodsNode != null)
     {
         if (calculationPeriodsNode.Attributes["href"] != null || calculationPeriodsNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsNode.Attributes["id"] != null) 
             {
                 calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["id"].Value;
                 AdjustableDates ob = new AdjustableDates(calculationPeriodsNode);
                 IDManager.SetID(calculationPeriodsIDRef_, ob);
             }
             else if (calculationPeriodsNode.Attributes["href"] != null)
             {
                 calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriods_ = new AdjustableDates(calculationPeriodsNode);
             }
         }
         else
         {
             calculationPeriods_ = new AdjustableDates(calculationPeriodsNode);
         }
     }
     
 
     XmlNode pricingDatesNode = xmlNode.SelectSingleNode("pricingDates");
     
     if (pricingDatesNode != null)
     {
         if (pricingDatesNode.Attributes["href"] != null || pricingDatesNode.Attributes["id"] != null) 
         {
             if (pricingDatesNode.Attributes["id"] != null) 
             {
                 pricingDatesIDRef_ = pricingDatesNode.Attributes["id"].Value;
                 CommodityPricingDates ob = new CommodityPricingDates(pricingDatesNode);
                 IDManager.SetID(pricingDatesIDRef_, ob);
             }
             else if (pricingDatesNode.Attributes["href"] != null)
             {
                 pricingDatesIDRef_ = pricingDatesNode.Attributes["href"].Value;
             }
             else
             {
                 pricingDates_ = new CommodityPricingDates(pricingDatesNode);
             }
         }
         else
         {
             pricingDates_ = new CommodityPricingDates(pricingDatesNode);
         }
     }
     
 
     XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");
     
     if (averagingMethodNode != null)
     {
         if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null) 
         {
             if (averagingMethodNode.Attributes["id"] != null) 
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                 AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                 IDManager.SetID(averagingMethodIDRef_, ob);
             }
             else if (averagingMethodNode.Attributes["href"] != null)
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
             }
             else
             {
                 averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
             }
         }
         else
         {
             averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
         }
     }
     
 
     XmlNode notionalQuantityScheduleNode = xmlNode.SelectSingleNode("notionalQuantitySchedule");
     
     if (notionalQuantityScheduleNode != null)
     {
         if (notionalQuantityScheduleNode.Attributes["href"] != null || notionalQuantityScheduleNode.Attributes["id"] != null) 
         {
             if (notionalQuantityScheduleNode.Attributes["id"] != null) 
             {
                 notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["id"].Value;
                 CommodityNotionalQuantitySchedule ob = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode);
                 IDManager.SetID(notionalQuantityScheduleIDRef_, ob);
             }
             else if (notionalQuantityScheduleNode.Attributes["href"] != null)
             {
                 notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode);
             }
         }
         else
         {
             notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode);
         }
     }
     
 
     XmlNode notionalQuantityNode = xmlNode.SelectSingleNode("notionalQuantity");
     
     if (notionalQuantityNode != null)
     {
         if (notionalQuantityNode.Attributes["href"] != null || notionalQuantityNode.Attributes["id"] != null) 
         {
             if (notionalQuantityNode.Attributes["id"] != null) 
             {
                 notionalQuantityIDRef_ = notionalQuantityNode.Attributes["id"].Value;
                 CommodityNotionalQuantity ob = new CommodityNotionalQuantity(notionalQuantityNode);
                 IDManager.SetID(notionalQuantityIDRef_, ob);
             }
             else if (notionalQuantityNode.Attributes["href"] != null)
             {
                 notionalQuantityIDRef_ = notionalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode);
             }
         }
         else
         {
             notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode);
         }
     }
     
 
     XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity");
     
     if (settlementPeriodsNotionalQuantityNodeList != null)
     {
         this.settlementPeriodsNotionalQuantity_ = new List<CommoditySettlementPeriodsNotionalQuantity>();
         foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
                     IDManager.SetID(settlementPeriodsNotionalQuantityIDRef_, settlementPeriodsNotionalQuantity_[settlementPeriodsNotionalQuantity_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
                 }
             }
             else
             {
                 settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNode totalNotionalQuantityNode = xmlNode.SelectSingleNode("totalNotionalQuantity");
     
     if (totalNotionalQuantityNode != null)
     {
         if (totalNotionalQuantityNode.Attributes["href"] != null || totalNotionalQuantityNode.Attributes["id"] != null) 
         {
             if (totalNotionalQuantityNode.Attributes["id"] != null) 
             {
                 totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(totalNotionalQuantityNode);
                 IDManager.SetID(totalNotionalQuantityIDRef_, ob);
             }
             else if (totalNotionalQuantityNode.Attributes["href"] != null)
             {
                 totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode);
             }
         }
         else
         {
             totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode);
         }
     }
     
 
     XmlNode quantityReferenceNode = xmlNode.SelectSingleNode("quantityReference");
     
     if (quantityReferenceNode != null)
     {
         if (quantityReferenceNode.Attributes["href"] != null || quantityReferenceNode.Attributes["id"] != null) 
         {
             if (quantityReferenceNode.Attributes["id"] != null) 
             {
                 quantityReferenceIDRef_ = quantityReferenceNode.Attributes["id"].Value;
                 QuantityReference ob = new QuantityReference(quantityReferenceNode);
                 IDManager.SetID(quantityReferenceIDRef_, ob);
             }
             else if (quantityReferenceNode.Attributes["href"] != null)
             {
                 quantityReferenceIDRef_ = quantityReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 quantityReference_ = new QuantityReference(quantityReferenceNode);
             }
         }
         else
         {
             quantityReference_ = new QuantityReference(quantityReferenceNode);
         }
     }
     
 
     XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise");
     
     if (exerciseNode != null)
     {
         if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) 
         {
             if (exerciseNode.Attributes["id"] != null) 
             {
                 exerciseIDRef_ = exerciseNode.Attributes["id"].Value;
                 CommodityExercise ob = new CommodityExercise(exerciseNode);
                 IDManager.SetID(exerciseIDRef_, ob);
             }
             else if (exerciseNode.Attributes["href"] != null)
             {
                 exerciseIDRef_ = exerciseNode.Attributes["href"].Value;
             }
             else
             {
                 exercise_ = new CommodityExercise(exerciseNode);
             }
         }
         else
         {
             exercise_ = new CommodityExercise(exerciseNode);
         }
     }
     
 
     XmlNode strikePricePerUnitNode = xmlNode.SelectSingleNode("strikePricePerUnit");
     
     if (strikePricePerUnitNode != null)
     {
         if (strikePricePerUnitNode.Attributes["href"] != null || strikePricePerUnitNode.Attributes["id"] != null) 
         {
             if (strikePricePerUnitNode.Attributes["id"] != null) 
             {
                 strikePricePerUnitIDRef_ = strikePricePerUnitNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(strikePricePerUnitNode);
                 IDManager.SetID(strikePricePerUnitIDRef_, ob);
             }
             else if (strikePricePerUnitNode.Attributes["href"] != null)
             {
                 strikePricePerUnitIDRef_ = strikePricePerUnitNode.Attributes["href"].Value;
             }
             else
             {
                 strikePricePerUnit_ = new NonNegativeMoney(strikePricePerUnitNode);
             }
         }
         else
         {
             strikePricePerUnit_ = new NonNegativeMoney(strikePricePerUnitNode);
         }
     }
     
 
     XmlNode strikePricePerUnitScheduleNode = xmlNode.SelectSingleNode("strikePricePerUnitSchedule");
     
     if (strikePricePerUnitScheduleNode != null)
     {
         if (strikePricePerUnitScheduleNode.Attributes["href"] != null || strikePricePerUnitScheduleNode.Attributes["id"] != null) 
         {
             if (strikePricePerUnitScheduleNode.Attributes["id"] != null) 
             {
                 strikePricePerUnitScheduleIDRef_ = strikePricePerUnitScheduleNode.Attributes["id"].Value;
                 CommodityStrikeSchedule ob = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode);
                 IDManager.SetID(strikePricePerUnitScheduleIDRef_, ob);
             }
             else if (strikePricePerUnitScheduleNode.Attributes["href"] != null)
             {
                 strikePricePerUnitScheduleIDRef_ = strikePricePerUnitScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 strikePricePerUnitSchedule_ = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode);
             }
         }
         else
         {
             strikePricePerUnitSchedule_ = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode);
         }
     }
     
 
     XmlNode floatingStrikePricePerUnitNode = xmlNode.SelectSingleNode("floatingStrikePricePerUnit");
     
     if (floatingStrikePricePerUnitNode != null)
     {
         if (floatingStrikePricePerUnitNode.Attributes["href"] != null || floatingStrikePricePerUnitNode.Attributes["id"] != null) 
         {
             if (floatingStrikePricePerUnitNode.Attributes["id"] != null) 
             {
                 floatingStrikePricePerUnitIDRef_ = floatingStrikePricePerUnitNode.Attributes["id"].Value;
                 FloatingStrikePrice ob = new FloatingStrikePrice(floatingStrikePricePerUnitNode);
                 IDManager.SetID(floatingStrikePricePerUnitIDRef_, ob);
             }
             else if (floatingStrikePricePerUnitNode.Attributes["href"] != null)
             {
                 floatingStrikePricePerUnitIDRef_ = floatingStrikePricePerUnitNode.Attributes["href"].Value;
             }
             else
             {
                 floatingStrikePricePerUnit_ = new FloatingStrikePrice(floatingStrikePricePerUnitNode);
             }
         }
         else
         {
             floatingStrikePricePerUnit_ = new FloatingStrikePrice(floatingStrikePricePerUnitNode);
         }
     }
     
 
     XmlNode floatingStrikePricePerUnitScheduleNode = xmlNode.SelectSingleNode("floatingStrikePricePerUnitSchedule");
     
     if (floatingStrikePricePerUnitScheduleNode != null)
     {
         if (floatingStrikePricePerUnitScheduleNode.Attributes["href"] != null || floatingStrikePricePerUnitScheduleNode.Attributes["id"] != null) 
         {
             if (floatingStrikePricePerUnitScheduleNode.Attributes["id"] != null) 
             {
                 floatingStrikePricePerUnitScheduleIDRef_ = floatingStrikePricePerUnitScheduleNode.Attributes["id"].Value;
                 CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode);
                 IDManager.SetID(floatingStrikePricePerUnitScheduleIDRef_, ob);
             }
             else if (floatingStrikePricePerUnitScheduleNode.Attributes["href"] != null)
             {
                 floatingStrikePricePerUnitScheduleIDRef_ = floatingStrikePricePerUnitScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 floatingStrikePricePerUnitSchedule_ = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode);
             }
         }
         else
         {
             floatingStrikePricePerUnitSchedule_ = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode);
         }
     }
     
 
     XmlNode commoditySwapNode = xmlNode.SelectSingleNode("commoditySwap");
     
     if (commoditySwapNode != null)
     {
         if (commoditySwapNode.Attributes["href"] != null || commoditySwapNode.Attributes["id"] != null) 
         {
             if (commoditySwapNode.Attributes["id"] != null) 
             {
                 commoditySwapIDRef_ = commoditySwapNode.Attributes["id"].Value;
                 CommoditySwap ob = new CommoditySwap(commoditySwapNode);
                 IDManager.SetID(commoditySwapIDRef_, ob);
             }
             else if (commoditySwapNode.Attributes["href"] != null)
             {
                 commoditySwapIDRef_ = commoditySwapNode.Attributes["href"].Value;
             }
             else
             {
                 commoditySwap_ = new CommoditySwap(commoditySwapNode);
             }
         }
         else
         {
             commoditySwap_ = new CommoditySwap(commoditySwapNode);
         }
     }
     
 
     XmlNode commodityForwardNode = xmlNode.SelectSingleNode("commodityForward");
     
     if (commodityForwardNode != null)
     {
         if (commodityForwardNode.Attributes["href"] != null || commodityForwardNode.Attributes["id"] != null) 
         {
             if (commodityForwardNode.Attributes["id"] != null) 
             {
                 commodityForwardIDRef_ = commodityForwardNode.Attributes["id"].Value;
                 CommodityForward ob = new CommodityForward(commodityForwardNode);
                 IDManager.SetID(commodityForwardIDRef_, ob);
             }
             else if (commodityForwardNode.Attributes["href"] != null)
             {
                 commodityForwardIDRef_ = commodityForwardNode.Attributes["href"].Value;
             }
             else
             {
                 commodityForward_ = new CommodityForward(commodityForwardNode);
             }
         }
         else
         {
             commodityForward_ = new CommodityForward(commodityForwardNode);
         }
     }
     
 
     XmlNode physicalExerciseNode = xmlNode.SelectSingleNode("physicalExercise");
     
     if (physicalExerciseNode != null)
     {
         if (physicalExerciseNode.Attributes["href"] != null || physicalExerciseNode.Attributes["id"] != null) 
         {
             if (physicalExerciseNode.Attributes["id"] != null) 
             {
                 physicalExerciseIDRef_ = physicalExerciseNode.Attributes["id"].Value;
                 CommodityPhysicalExercise ob = new CommodityPhysicalExercise(physicalExerciseNode);
                 IDManager.SetID(physicalExerciseIDRef_, ob);
             }
             else if (physicalExerciseNode.Attributes["href"] != null)
             {
                 physicalExerciseIDRef_ = physicalExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode);
             }
         }
         else
         {
             physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode);
         }
     }
     
 
     XmlNode weatherCalculationPeriodsNode = xmlNode.SelectSingleNode("weatherCalculationPeriods");
     
     if (weatherCalculationPeriodsNode != null)
     {
         if (weatherCalculationPeriodsNode.Attributes["href"] != null || weatherCalculationPeriodsNode.Attributes["id"] != null) 
         {
             if (weatherCalculationPeriodsNode.Attributes["id"] != null) 
             {
                 weatherCalculationPeriodsIDRef_ = weatherCalculationPeriodsNode.Attributes["id"].Value;
                 WeatherCalculationPeriods ob = new WeatherCalculationPeriods(weatherCalculationPeriodsNode);
                 IDManager.SetID(weatherCalculationPeriodsIDRef_, ob);
             }
             else if (weatherCalculationPeriodsNode.Attributes["href"] != null)
             {
                 weatherCalculationPeriodsIDRef_ = weatherCalculationPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 weatherCalculationPeriods_ = new WeatherCalculationPeriods(weatherCalculationPeriodsNode);
             }
         }
         else
         {
             weatherCalculationPeriods_ = new WeatherCalculationPeriods(weatherCalculationPeriodsNode);
         }
     }
     
 
     XmlNode weatherCalculationPeriodsReferenceNode = xmlNode.SelectSingleNode("weatherCalculationPeriodsReference");
     
     if (weatherCalculationPeriodsReferenceNode != null)
     {
         if (weatherCalculationPeriodsReferenceNode.Attributes["href"] != null || weatherCalculationPeriodsReferenceNode.Attributes["id"] != null) 
         {
             if (weatherCalculationPeriodsReferenceNode.Attributes["id"] != null) 
             {
                 weatherCalculationPeriodsReferenceIDRef_ = weatherCalculationPeriodsReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsReference ob = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode);
                 IDManager.SetID(weatherCalculationPeriodsReferenceIDRef_, ob);
             }
             else if (weatherCalculationPeriodsReferenceNode.Attributes["href"] != null)
             {
                 weatherCalculationPeriodsReferenceIDRef_ = weatherCalculationPeriodsReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 weatherCalculationPeriodsReference_ = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode);
             }
         }
         else
         {
             weatherCalculationPeriodsReference_ = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode);
         }
     }
     
 
     XmlNode weatherNotionalAmountNode = xmlNode.SelectSingleNode("weatherNotionalAmount");
     
     if (weatherNotionalAmountNode != null)
     {
         if (weatherNotionalAmountNode.Attributes["href"] != null || weatherNotionalAmountNode.Attributes["id"] != null) 
         {
             if (weatherNotionalAmountNode.Attributes["id"] != null) 
             {
                 weatherNotionalAmountIDRef_ = weatherNotionalAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(weatherNotionalAmountNode);
                 IDManager.SetID(weatherNotionalAmountIDRef_, ob);
             }
             else if (weatherNotionalAmountNode.Attributes["href"] != null)
             {
                 weatherNotionalAmountIDRef_ = weatherNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 weatherNotionalAmount_ = new NonNegativeMoney(weatherNotionalAmountNode);
             }
         }
         else
         {
             weatherNotionalAmount_ = new NonNegativeMoney(weatherNotionalAmountNode);
         }
     }
     
 
     XmlNode weatherIndexStrikeLevelNode = xmlNode.SelectSingleNode("weatherIndexStrikeLevel");
     
     if (weatherIndexStrikeLevelNode != null)
     {
         if (weatherIndexStrikeLevelNode.Attributes["href"] != null || weatherIndexStrikeLevelNode.Attributes["id"] != null) 
         {
             if (weatherIndexStrikeLevelNode.Attributes["id"] != null) 
             {
                 weatherIndexStrikeLevelIDRef_ = weatherIndexStrikeLevelNode.Attributes["id"].Value;
                 WeatherIndex ob = new WeatherIndex(weatherIndexStrikeLevelNode);
                 IDManager.SetID(weatherIndexStrikeLevelIDRef_, ob);
             }
             else if (weatherIndexStrikeLevelNode.Attributes["href"] != null)
             {
                 weatherIndexStrikeLevelIDRef_ = weatherIndexStrikeLevelNode.Attributes["href"].Value;
             }
             else
             {
                 weatherIndexStrikeLevel_ = new WeatherIndex(weatherIndexStrikeLevelNode);
             }
         }
         else
         {
             weatherIndexStrikeLevel_ = new WeatherIndex(weatherIndexStrikeLevelNode);
         }
     }
     
 
     XmlNode calculationNode = xmlNode.SelectSingleNode("calculation");
     
     if (calculationNode != null)
     {
         if (calculationNode.Attributes["href"] != null || calculationNode.Attributes["id"] != null) 
         {
             if (calculationNode.Attributes["id"] != null) 
             {
                 calculationIDRef_ = calculationNode.Attributes["id"].Value;
                 WeatherLegCalculation ob = new WeatherLegCalculation(calculationNode);
                 IDManager.SetID(calculationIDRef_, ob);
             }
             else if (calculationNode.Attributes["href"] != null)
             {
                 calculationIDRef_ = calculationNode.Attributes["href"].Value;
             }
             else
             {
                 calculation_ = new WeatherLegCalculation(calculationNode);
             }
         }
         else
         {
             calculation_ = new WeatherLegCalculation(calculationNode);
         }
     }
     
 
     XmlNode weatherIndexDataNode = xmlNode.SelectSingleNode("weatherIndexData");
     
     if (weatherIndexDataNode != null)
     {
         if (weatherIndexDataNode.Attributes["href"] != null || weatherIndexDataNode.Attributes["id"] != null) 
         {
             if (weatherIndexDataNode.Attributes["id"] != null) 
             {
                 weatherIndexDataIDRef_ = weatherIndexDataNode.Attributes["id"].Value;
                 WeatherIndexData ob = new WeatherIndexData(weatherIndexDataNode);
                 IDManager.SetID(weatherIndexDataIDRef_, ob);
             }
             else if (weatherIndexDataNode.Attributes["href"] != null)
             {
                 weatherIndexDataIDRef_ = weatherIndexDataNode.Attributes["href"].Value;
             }
             else
             {
                 weatherIndexData_ = new WeatherIndexData(weatherIndexDataNode);
             }
         }
         else
         {
             weatherIndexData_ = new WeatherIndexData(weatherIndexDataNode);
         }
     }
     
 
     XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");
     
     if (premiumNodeList != null)
     {
         this.premium_ = new List<CommodityPremium>();
         foreach (XmlNode item in premiumNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     premiumIDRef_ = item.Attributes["id"].Value;
                     premium_.Add(new CommodityPremium(item));
                     IDManager.SetID(premiumIDRef_, premium_[premium_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     premiumIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 premium_.Add(new CommodityPremium(item));
                 }
             }
             else
             {
                 premium_.Add(new CommodityPremium(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. 4
0
        public CommodityFx(XmlNode xmlNode)
        {
            XmlNode primaryRateSourceNode = xmlNode.SelectSingleNode("primaryRateSource");

            if (primaryRateSourceNode != null)
            {
                if (primaryRateSourceNode.Attributes["href"] != null || primaryRateSourceNode.Attributes["id"] != null)
                {
                    if (primaryRateSourceNode.Attributes["id"] != null)
                    {
                        primaryRateSourceIDRef_ = primaryRateSourceNode.Attributes["id"].Value;
                        InformationSource ob = new InformationSource(primaryRateSourceNode);
                        IDManager.SetID(primaryRateSourceIDRef_, ob);
                    }
                    else if (primaryRateSourceNode.Attributes["href"] != null)
                    {
                        primaryRateSourceIDRef_ = primaryRateSourceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        primaryRateSource_ = new InformationSource(primaryRateSourceNode);
                    }
                }
                else
                {
                    primaryRateSource_ = new InformationSource(primaryRateSourceNode);
                }
            }


            XmlNode secondaryRateSourceNode = xmlNode.SelectSingleNode("secondaryRateSource");

            if (secondaryRateSourceNode != null)
            {
                if (secondaryRateSourceNode.Attributes["href"] != null || secondaryRateSourceNode.Attributes["id"] != null)
                {
                    if (secondaryRateSourceNode.Attributes["id"] != null)
                    {
                        secondaryRateSourceIDRef_ = secondaryRateSourceNode.Attributes["id"].Value;
                        InformationSource ob = new InformationSource(secondaryRateSourceNode);
                        IDManager.SetID(secondaryRateSourceIDRef_, ob);
                    }
                    else if (secondaryRateSourceNode.Attributes["href"] != null)
                    {
                        secondaryRateSourceIDRef_ = secondaryRateSourceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        secondaryRateSource_ = new InformationSource(secondaryRateSourceNode);
                    }
                }
                else
                {
                    secondaryRateSource_ = new InformationSource(secondaryRateSourceNode);
                }
            }


            XmlNode fxTypeNode = xmlNode.SelectSingleNode("fxType");

            if (fxTypeNode != null)
            {
                if (fxTypeNode.Attributes["href"] != null || fxTypeNode.Attributes["id"] != null)
                {
                    if (fxTypeNode.Attributes["id"] != null)
                    {
                        fxTypeIDRef_ = fxTypeNode.Attributes["id"].Value;
                        CommodityFxType ob = new CommodityFxType(fxTypeNode);
                        IDManager.SetID(fxTypeIDRef_, ob);
                    }
                    else if (fxTypeNode.Attributes["href"] != null)
                    {
                        fxTypeIDRef_ = fxTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fxType_ = new CommodityFxType(fxTypeNode);
                    }
                }
                else
                {
                    fxType_ = new CommodityFxType(fxTypeNode);
                }
            }


            XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");

            if (averagingMethodNode != null)
            {
                if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null)
                {
                    if (averagingMethodNode.Attributes["id"] != null)
                    {
                        averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                        AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                        IDManager.SetID(averagingMethodIDRef_, ob);
                    }
                    else if (averagingMethodNode.Attributes["href"] != null)
                    {
                        averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
                    }
                }
                else
                {
                    averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
                }
            }


            XmlNode fixingTimeNode = xmlNode.SelectSingleNode("fixingTime");

            if (fixingTimeNode != null)
            {
                if (fixingTimeNode.Attributes["href"] != null || fixingTimeNode.Attributes["id"] != null)
                {
                    if (fixingTimeNode.Attributes["id"] != null)
                    {
                        fixingTimeIDRef_ = fixingTimeNode.Attributes["id"].Value;
                        BusinessCenterTime ob = new BusinessCenterTime(fixingTimeNode);
                        IDManager.SetID(fixingTimeIDRef_, ob);
                    }
                    else if (fixingTimeNode.Attributes["href"] != null)
                    {
                        fixingTimeIDRef_ = fixingTimeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixingTime_ = new BusinessCenterTime(fixingTimeNode);
                    }
                }
                else
                {
                    fixingTime_ = new BusinessCenterTime(fixingTimeNode);
                }
            }


            XmlNodeList fxObservationDatesNodeList = xmlNode.SelectNodes("fxObservationDates");

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


            XmlNode dayTypeNode = xmlNode.SelectSingleNode("dayType");

            if (dayTypeNode != null)
            {
                if (dayTypeNode.Attributes["href"] != null || dayTypeNode.Attributes["id"] != null)
                {
                    if (dayTypeNode.Attributes["id"] != null)
                    {
                        dayTypeIDRef_ = dayTypeNode.Attributes["id"].Value;
                        CommodityDayTypeEnum ob = new CommodityDayTypeEnum(dayTypeNode);
                        IDManager.SetID(dayTypeIDRef_, ob);
                    }
                    else if (dayTypeNode.Attributes["href"] != null)
                    {
                        dayTypeIDRef_ = dayTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayType_ = new CommodityDayTypeEnum(dayTypeNode);
                    }
                }
                else
                {
                    dayType_ = new CommodityDayTypeEnum(dayTypeNode);
                }
            }


            XmlNode dayDistributionNode = xmlNode.SelectSingleNode("dayDistribution");

            if (dayDistributionNode != null)
            {
                if (dayDistributionNode.Attributes["href"] != null || dayDistributionNode.Attributes["id"] != null)
                {
                    if (dayDistributionNode.Attributes["id"] != null)
                    {
                        dayDistributionIDRef_ = dayDistributionNode.Attributes["id"].Value;
                        CommodityFrequencyType ob = new CommodityFrequencyType(dayDistributionNode);
                        IDManager.SetID(dayDistributionIDRef_, ob);
                    }
                    else if (dayDistributionNode.Attributes["href"] != null)
                    {
                        dayDistributionIDRef_ = dayDistributionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayDistribution_ = new CommodityFrequencyType(dayDistributionNode);
                    }
                }
                else
                {
                    dayDistribution_ = new CommodityFrequencyType(dayDistributionNode);
                }
            }


            XmlNode dayCountNode = xmlNode.SelectSingleNode("dayCount");

            if (dayCountNode != null)
            {
                if (dayCountNode.Attributes["href"] != null || dayCountNode.Attributes["id"] != null)
                {
                    if (dayCountNode.Attributes["id"] != null)
                    {
                        dayCountIDRef_ = dayCountNode.Attributes["id"].Value;
                        XsdTypePositiveInteger ob = new XsdTypePositiveInteger(dayCountNode);
                        IDManager.SetID(dayCountIDRef_, ob);
                    }
                    else if (dayCountNode.Attributes["href"] != null)
                    {
                        dayCountIDRef_ = dayCountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCount_ = new XsdTypePositiveInteger(dayCountNode);
                    }
                }
                else
                {
                    dayCount_ = new XsdTypePositiveInteger(dayCountNode);
                }
            }


            XmlNodeList dayOfWeekNodeList = xmlNode.SelectNodes("dayOfWeek");

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


            XmlNode dayNumberNode = xmlNode.SelectSingleNode("dayNumber");

            if (dayNumberNode != null)
            {
                if (dayNumberNode.Attributes["href"] != null || dayNumberNode.Attributes["id"] != null)
                {
                    if (dayNumberNode.Attributes["id"] != null)
                    {
                        dayNumberIDRef_ = dayNumberNode.Attributes["id"].Value;
                        XsdTypeInteger ob = new XsdTypeInteger(dayNumberNode);
                        IDManager.SetID(dayNumberIDRef_, ob);
                    }
                    else if (dayNumberNode.Attributes["href"] != null)
                    {
                        dayNumberIDRef_ = dayNumberNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayNumber_ = new XsdTypeInteger(dayNumberNode);
                    }
                }
                else
                {
                    dayNumber_ = new XsdTypeInteger(dayNumberNode);
                }
            }


            XmlNode lagNode = xmlNode.SelectSingleNode("lag");

            if (lagNode != null)
            {
                if (lagNode.Attributes["href"] != null || lagNode.Attributes["id"] != null)
                {
                    if (lagNode.Attributes["id"] != null)
                    {
                        lagIDRef_ = lagNode.Attributes["id"].Value;
                        Lag ob = new Lag(lagNode);
                        IDManager.SetID(lagIDRef_, ob);
                    }
                    else if (lagNode.Attributes["href"] != null)
                    {
                        lagIDRef_ = lagNode.Attributes["href"].Value;
                    }
                    else
                    {
                        lag_ = new Lag(lagNode);
                    }
                }
                else
                {
                    lag_ = new Lag(lagNode);
                }
            }


            XmlNode lagReferenceNode = xmlNode.SelectSingleNode("lagReference");

            if (lagReferenceNode != null)
            {
                if (lagReferenceNode.Attributes["href"] != null || lagReferenceNode.Attributes["id"] != null)
                {
                    if (lagReferenceNode.Attributes["id"] != null)
                    {
                        lagReferenceIDRef_ = lagReferenceNode.Attributes["id"].Value;
                        LagReference ob = new LagReference(lagReferenceNode);
                        IDManager.SetID(lagReferenceIDRef_, ob);
                    }
                    else if (lagReferenceNode.Attributes["href"] != null)
                    {
                        lagReferenceIDRef_ = lagReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        lagReference_ = new LagReference(lagReferenceNode);
                    }
                }
                else
                {
                    lagReference_ = new LagReference(lagReferenceNode);
                }
            }


            XmlNode calculationPeriodsReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsReference");

            if (calculationPeriodsReferenceNode != null)
            {
                if (calculationPeriodsReferenceNode.Attributes["href"] != null || calculationPeriodsReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodsReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsReference ob = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                        IDManager.SetID(calculationPeriodsReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodsReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                }
            }


            XmlNode calculationPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsScheduleReference");

            if (calculationPeriodsScheduleReferenceNode != null)
            {
                if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null || calculationPeriodsScheduleReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodsScheduleReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                        IDManager.SetID(calculationPeriodsScheduleReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                }
            }


            XmlNode calculationPeriodsDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsDatesReference");

            if (calculationPeriodsDatesReferenceNode != null)
            {
                if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null || calculationPeriodsDatesReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodsDatesReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsDatesReference ob = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                        IDManager.SetID(calculationPeriodsDatesReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                }
            }
        }
        public FloatingRateCalculation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode initialRateNode = xmlNode.SelectSingleNode("initialRate");

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


            XmlNode finalRateRoundingNode = xmlNode.SelectSingleNode("finalRateRounding");

            if (finalRateRoundingNode != null)
            {
                if (finalRateRoundingNode.Attributes["href"] != null || finalRateRoundingNode.Attributes["id"] != null)
                {
                    if (finalRateRoundingNode.Attributes["id"] != null)
                    {
                        finalRateRoundingIDRef_ = finalRateRoundingNode.Attributes["id"].Value;
                        Rounding ob = new Rounding(finalRateRoundingNode);
                        IDManager.SetID(finalRateRoundingIDRef_, ob);
                    }
                    else if (finalRateRoundingNode.Attributes["href"] != null)
                    {
                        finalRateRoundingIDRef_ = finalRateRoundingNode.Attributes["href"].Value;
                    }
                    else
                    {
                        finalRateRounding_ = new Rounding(finalRateRoundingNode);
                    }
                }
                else
                {
                    finalRateRounding_ = new Rounding(finalRateRoundingNode);
                }
            }


            XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");

            if (averagingMethodNode != null)
            {
                if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null)
                {
                    if (averagingMethodNode.Attributes["id"] != null)
                    {
                        averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                        AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                        IDManager.SetID(averagingMethodIDRef_, ob);
                    }
                    else if (averagingMethodNode.Attributes["href"] != null)
                    {
                        averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
                    }
                }
                else
                {
                    averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
                }
            }


            XmlNode negativeInterestRateTreatmentNode = xmlNode.SelectSingleNode("negativeInterestRateTreatment");

            if (negativeInterestRateTreatmentNode != null)
            {
                if (negativeInterestRateTreatmentNode.Attributes["href"] != null || negativeInterestRateTreatmentNode.Attributes["id"] != null)
                {
                    if (negativeInterestRateTreatmentNode.Attributes["id"] != null)
                    {
                        negativeInterestRateTreatmentIDRef_ = negativeInterestRateTreatmentNode.Attributes["id"].Value;
                        NegativeInterestRateTreatmentEnum ob = new NegativeInterestRateTreatmentEnum(negativeInterestRateTreatmentNode);
                        IDManager.SetID(negativeInterestRateTreatmentIDRef_, ob);
                    }
                    else if (negativeInterestRateTreatmentNode.Attributes["href"] != null)
                    {
                        negativeInterestRateTreatmentIDRef_ = negativeInterestRateTreatmentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        negativeInterestRateTreatment_ = new NegativeInterestRateTreatmentEnum(negativeInterestRateTreatmentNode);
                    }
                }
                else
                {
                    negativeInterestRateTreatment_ = new NegativeInterestRateTreatmentEnum(negativeInterestRateTreatmentNode);
                }
            }
        }
 public FloatingRateCalculation(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode initialRateNode = xmlNode.SelectSingleNode("initialRate");
     
     if (initialRateNode != null)
     {
         if (initialRateNode.Attributes["href"] != null || initialRateNode.Attributes["id"] != null) 
         {
             if (initialRateNode.Attributes["id"] != null) 
             {
                 initialRateIDRef_ = initialRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(initialRateNode);
                 IDManager.SetID(initialRateIDRef_, ob);
             }
             else if (initialRateNode.Attributes["href"] != null)
             {
                 initialRateIDRef_ = initialRateNode.Attributes["href"].Value;
             }
             else
             {
                 initialRate_ = new XsdTypeDecimal(initialRateNode);
             }
         }
         else
         {
             initialRate_ = new XsdTypeDecimal(initialRateNode);
         }
     }
     
 
     XmlNode finalRateRoundingNode = xmlNode.SelectSingleNode("finalRateRounding");
     
     if (finalRateRoundingNode != null)
     {
         if (finalRateRoundingNode.Attributes["href"] != null || finalRateRoundingNode.Attributes["id"] != null) 
         {
             if (finalRateRoundingNode.Attributes["id"] != null) 
             {
                 finalRateRoundingIDRef_ = finalRateRoundingNode.Attributes["id"].Value;
                 Rounding ob = new Rounding(finalRateRoundingNode);
                 IDManager.SetID(finalRateRoundingIDRef_, ob);
             }
             else if (finalRateRoundingNode.Attributes["href"] != null)
             {
                 finalRateRoundingIDRef_ = finalRateRoundingNode.Attributes["href"].Value;
             }
             else
             {
                 finalRateRounding_ = new Rounding(finalRateRoundingNode);
             }
         }
         else
         {
             finalRateRounding_ = new Rounding(finalRateRoundingNode);
         }
     }
     
 
     XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");
     
     if (averagingMethodNode != null)
     {
         if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null) 
         {
             if (averagingMethodNode.Attributes["id"] != null) 
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                 AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                 IDManager.SetID(averagingMethodIDRef_, ob);
             }
             else if (averagingMethodNode.Attributes["href"] != null)
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
             }
             else
             {
                 averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
             }
         }
         else
         {
             averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
         }
     }
     
 
     XmlNode negativeInterestRateTreatmentNode = xmlNode.SelectSingleNode("negativeInterestRateTreatment");
     
     if (negativeInterestRateTreatmentNode != null)
     {
         if (negativeInterestRateTreatmentNode.Attributes["href"] != null || negativeInterestRateTreatmentNode.Attributes["id"] != null) 
         {
             if (negativeInterestRateTreatmentNode.Attributes["id"] != null) 
             {
                 negativeInterestRateTreatmentIDRef_ = negativeInterestRateTreatmentNode.Attributes["id"].Value;
                 NegativeInterestRateTreatmentEnum ob = new NegativeInterestRateTreatmentEnum(negativeInterestRateTreatmentNode);
                 IDManager.SetID(negativeInterestRateTreatmentIDRef_, ob);
             }
             else if (negativeInterestRateTreatmentNode.Attributes["href"] != null)
             {
                 negativeInterestRateTreatmentIDRef_ = negativeInterestRateTreatmentNode.Attributes["href"].Value;
             }
             else
             {
                 negativeInterestRateTreatment_ = new NegativeInterestRateTreatmentEnum(negativeInterestRateTreatmentNode);
             }
         }
         else
         {
             negativeInterestRateTreatment_ = new NegativeInterestRateTreatmentEnum(negativeInterestRateTreatmentNode);
         }
     }
     
 
 }
        public CommodityFx(XmlNode xmlNode)
        {
            XmlNodeList primaryRateSourceNodeList = xmlNode.SelectNodes("primaryRateSource");

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

            foreach (XmlNode item in primaryRateSourceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        primaryRateSourceIDRef = item.Attributes["id"].Name;
                        InformationSource ob = InformationSource();
                        IDManager.SetID(primaryRateSourceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        primaryRateSourceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        primaryRateSource = new InformationSource(item);
                    }
                }
            }


            XmlNodeList secondaryRateSourceNodeList = xmlNode.SelectNodes("secondaryRateSource");

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

            foreach (XmlNode item in secondaryRateSourceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        secondaryRateSourceIDRef = item.Attributes["id"].Name;
                        InformationSource ob = InformationSource();
                        IDManager.SetID(secondaryRateSourceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        secondaryRateSourceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        secondaryRateSource = new InformationSource(item);
                    }
                }
            }


            XmlNodeList fxTypeNodeList = xmlNode.SelectNodes("fxType");

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

            foreach (XmlNode item in fxTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxTypeIDRef = item.Attributes["id"].Name;
                        CommodityFxType ob = CommodityFxType();
                        IDManager.SetID(fxTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fxType = new CommodityFxType(item);
                    }
                }
            }


            XmlNodeList averagingMethodNodeList = xmlNode.SelectNodes("averagingMethod");

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

            foreach (XmlNode item in averagingMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        averagingMethodIDRef = item.Attributes["id"].Name;
                        AveragingMethodEnum ob = AveragingMethodEnum();
                        IDManager.SetID(averagingMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        averagingMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        averagingMethod = new AveragingMethodEnum(item);
                    }
                }
            }


            XmlNodeList fixingTimeNodeList = xmlNode.SelectNodes("fixingTime");

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

            foreach (XmlNode item in fixingTimeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixingTimeIDRef = item.Attributes["id"].Name;
                        BusinessCenterTime ob = BusinessCenterTime();
                        IDManager.SetID(fixingTimeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixingTimeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixingTime = new BusinessCenterTime(item);
                    }
                }
            }


            XmlNodeList fxObservationDatesNodeList = xmlNode.SelectNodes("fxObservationDates");

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


            XmlNodeList dayTypeNodeList = xmlNode.SelectNodes("dayType");

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

            foreach (XmlNode item in dayTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayTypeIDRef = item.Attributes["id"].Name;
                        CommodityDayTypeEnum ob = CommodityDayTypeEnum();
                        IDManager.SetID(dayTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayType = new CommodityDayTypeEnum(item);
                    }
                }
            }


            XmlNodeList dayDistributionNodeList = xmlNode.SelectNodes("dayDistribution");

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

            foreach (XmlNode item in dayDistributionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayDistributionIDRef = item.Attributes["id"].Name;
                        CommodityFrequencyType ob = CommodityFrequencyType();
                        IDManager.SetID(dayDistributionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayDistributionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayDistribution = new CommodityFrequencyType(item);
                    }
                }
            }


            XmlNodeList dayCountNodeList = xmlNode.SelectNodes("dayCount");

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

            foreach (XmlNode item in dayCountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountIDRef = item.Attributes["id"].Name;
                        XsdTypePositiveInteger ob = XsdTypePositiveInteger();
                        IDManager.SetID(dayCountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCount = new XsdTypePositiveInteger(item);
                    }
                }
            }


            XmlNodeList dayOfWeekNodeList = xmlNode.SelectNodes("dayOfWeek");

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


            XmlNodeList dayNumberNodeList = xmlNode.SelectNodes("dayNumber");

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

            foreach (XmlNode item in dayNumberNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayNumberIDRef = item.Attributes["id"].Name;
                        XsdTypeInteger ob = XsdTypeInteger();
                        IDManager.SetID(dayNumberIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayNumberIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayNumber = new XsdTypeInteger(item);
                    }
                }
            }


            XmlNodeList lagNodeList = xmlNode.SelectNodes("lag");

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

            foreach (XmlNode item in lagNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        lagIDRef = item.Attributes["id"].Name;
                        Lag ob = Lag();
                        IDManager.SetID(lagIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        lagIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        lag = new Lag(item);
                    }
                }
            }


            XmlNodeList lagReferenceNodeList = xmlNode.SelectNodes("lagReference");

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

            foreach (XmlNode item in lagReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        lagReferenceIDRef = item.Attributes["id"].Name;
                        LagReference ob = LagReference();
                        IDManager.SetID(lagReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        lagReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        lagReference = new LagReference(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsReference");

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

            foreach (XmlNode item in calculationPeriodsReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsReference ob = CalculationPeriodsReference();
                        IDManager.SetID(calculationPeriodsReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsReference = new CalculationPeriodsReference(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsScheduleReference");

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

            foreach (XmlNode item in calculationPeriodsScheduleReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference();
                        IDManager.SetID(calculationPeriodsScheduleReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsDatesReference");

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

            foreach (XmlNode item in calculationPeriodsDatesReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsDatesReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsDatesReference ob = CalculationPeriodsDatesReference();
                        IDManager.SetID(calculationPeriodsDatesReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsDatesReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsDatesReference = new CalculationPeriodsDatesReference(item);
                    }
                }
            }
        }
        public FloatingLegCalculation(XmlNode xmlNode)
        {
            XmlNode pricingDatesNode = xmlNode.SelectSingleNode("pricingDates");

            if (pricingDatesNode != null)
            {
                if (pricingDatesNode.Attributes["href"] != null || pricingDatesNode.Attributes["id"] != null)
                {
                    if (pricingDatesNode.Attributes["id"] != null)
                    {
                        pricingDatesIDRef_ = pricingDatesNode.Attributes["id"].Value;
                        CommodityPricingDates ob = new CommodityPricingDates(pricingDatesNode);
                        IDManager.SetID(pricingDatesIDRef_, ob);
                    }
                    else if (pricingDatesNode.Attributes["href"] != null)
                    {
                        pricingDatesIDRef_ = pricingDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pricingDates_ = new CommodityPricingDates(pricingDatesNode);
                    }
                }
                else
                {
                    pricingDates_ = new CommodityPricingDates(pricingDatesNode);
                }
            }


            XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");

            if (averagingMethodNode != null)
            {
                if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null)
                {
                    if (averagingMethodNode.Attributes["id"] != null)
                    {
                        averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                        AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                        IDManager.SetID(averagingMethodIDRef_, ob);
                    }
                    else if (averagingMethodNode.Attributes["href"] != null)
                    {
                        averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
                    }
                }
                else
                {
                    averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
                }
            }


            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 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);
                }
            }


            XmlNode spreadNode = xmlNode.SelectSingleNode("spread");

            if (spreadNode != null)
            {
                if (spreadNode.Attributes["href"] != null || spreadNode.Attributes["id"] != null)
                {
                    if (spreadNode.Attributes["id"] != null)
                    {
                        spreadIDRef_ = spreadNode.Attributes["id"].Value;
                        CommoditySpread ob = new CommoditySpread(spreadNode);
                        IDManager.SetID(spreadIDRef_, ob);
                    }
                    else if (spreadNode.Attributes["href"] != null)
                    {
                        spreadIDRef_ = spreadNode.Attributes["href"].Value;
                    }
                    else
                    {
                        spread_ = new CommoditySpread(spreadNode);
                    }
                }
                else
                {
                    spread_ = new CommoditySpread(spreadNode);
                }
            }


            XmlNodeList spreadScheduleNodeList = xmlNode.SelectNodes("spreadSchedule");

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


            XmlNode spreadPercentageNode = xmlNode.SelectSingleNode("spreadPercentage");

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


            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);
                }
            }
        }
 public CommodityFx(XmlNode xmlNode)
 {
     XmlNode primaryRateSourceNode = xmlNode.SelectSingleNode("primaryRateSource");
     
     if (primaryRateSourceNode != null)
     {
         if (primaryRateSourceNode.Attributes["href"] != null || primaryRateSourceNode.Attributes["id"] != null) 
         {
             if (primaryRateSourceNode.Attributes["id"] != null) 
             {
                 primaryRateSourceIDRef_ = primaryRateSourceNode.Attributes["id"].Value;
                 InformationSource ob = new InformationSource(primaryRateSourceNode);
                 IDManager.SetID(primaryRateSourceIDRef_, ob);
             }
             else if (primaryRateSourceNode.Attributes["href"] != null)
             {
                 primaryRateSourceIDRef_ = primaryRateSourceNode.Attributes["href"].Value;
             }
             else
             {
                 primaryRateSource_ = new InformationSource(primaryRateSourceNode);
             }
         }
         else
         {
             primaryRateSource_ = new InformationSource(primaryRateSourceNode);
         }
     }
     
 
     XmlNode secondaryRateSourceNode = xmlNode.SelectSingleNode("secondaryRateSource");
     
     if (secondaryRateSourceNode != null)
     {
         if (secondaryRateSourceNode.Attributes["href"] != null || secondaryRateSourceNode.Attributes["id"] != null) 
         {
             if (secondaryRateSourceNode.Attributes["id"] != null) 
             {
                 secondaryRateSourceIDRef_ = secondaryRateSourceNode.Attributes["id"].Value;
                 InformationSource ob = new InformationSource(secondaryRateSourceNode);
                 IDManager.SetID(secondaryRateSourceIDRef_, ob);
             }
             else if (secondaryRateSourceNode.Attributes["href"] != null)
             {
                 secondaryRateSourceIDRef_ = secondaryRateSourceNode.Attributes["href"].Value;
             }
             else
             {
                 secondaryRateSource_ = new InformationSource(secondaryRateSourceNode);
             }
         }
         else
         {
             secondaryRateSource_ = new InformationSource(secondaryRateSourceNode);
         }
     }
     
 
     XmlNode fxTypeNode = xmlNode.SelectSingleNode("fxType");
     
     if (fxTypeNode != null)
     {
         if (fxTypeNode.Attributes["href"] != null || fxTypeNode.Attributes["id"] != null) 
         {
             if (fxTypeNode.Attributes["id"] != null) 
             {
                 fxTypeIDRef_ = fxTypeNode.Attributes["id"].Value;
                 CommodityFxType ob = new CommodityFxType(fxTypeNode);
                 IDManager.SetID(fxTypeIDRef_, ob);
             }
             else if (fxTypeNode.Attributes["href"] != null)
             {
                 fxTypeIDRef_ = fxTypeNode.Attributes["href"].Value;
             }
             else
             {
                 fxType_ = new CommodityFxType(fxTypeNode);
             }
         }
         else
         {
             fxType_ = new CommodityFxType(fxTypeNode);
         }
     }
     
 
     XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");
     
     if (averagingMethodNode != null)
     {
         if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null) 
         {
             if (averagingMethodNode.Attributes["id"] != null) 
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                 AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                 IDManager.SetID(averagingMethodIDRef_, ob);
             }
             else if (averagingMethodNode.Attributes["href"] != null)
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
             }
             else
             {
                 averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
             }
         }
         else
         {
             averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
         }
     }
     
 
     XmlNode fixingTimeNode = xmlNode.SelectSingleNode("fixingTime");
     
     if (fixingTimeNode != null)
     {
         if (fixingTimeNode.Attributes["href"] != null || fixingTimeNode.Attributes["id"] != null) 
         {
             if (fixingTimeNode.Attributes["id"] != null) 
             {
                 fixingTimeIDRef_ = fixingTimeNode.Attributes["id"].Value;
                 BusinessCenterTime ob = new BusinessCenterTime(fixingTimeNode);
                 IDManager.SetID(fixingTimeIDRef_, ob);
             }
             else if (fixingTimeNode.Attributes["href"] != null)
             {
                 fixingTimeIDRef_ = fixingTimeNode.Attributes["href"].Value;
             }
             else
             {
                 fixingTime_ = new BusinessCenterTime(fixingTimeNode);
             }
         }
         else
         {
             fixingTime_ = new BusinessCenterTime(fixingTimeNode);
         }
     }
     
 
     XmlNodeList fxObservationDatesNodeList = xmlNode.SelectNodes("fxObservationDates");
     
     if (fxObservationDatesNodeList != null)
     {
         this.fxObservationDates_ = new List<AdjustableDates>();
         foreach (XmlNode item in fxObservationDatesNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     fxObservationDatesIDRef_ = item.Attributes["id"].Value;
                     fxObservationDates_.Add(new AdjustableDates(item));
                     IDManager.SetID(fxObservationDatesIDRef_, fxObservationDates_[fxObservationDates_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     fxObservationDatesIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 fxObservationDates_.Add(new AdjustableDates(item));
                 }
             }
             else
             {
                 fxObservationDates_.Add(new AdjustableDates(item));
             }
         }
     }
     
 
     XmlNode dayTypeNode = xmlNode.SelectSingleNode("dayType");
     
     if (dayTypeNode != null)
     {
         if (dayTypeNode.Attributes["href"] != null || dayTypeNode.Attributes["id"] != null) 
         {
             if (dayTypeNode.Attributes["id"] != null) 
             {
                 dayTypeIDRef_ = dayTypeNode.Attributes["id"].Value;
                 CommodityDayTypeEnum ob = new CommodityDayTypeEnum(dayTypeNode);
                 IDManager.SetID(dayTypeIDRef_, ob);
             }
             else if (dayTypeNode.Attributes["href"] != null)
             {
                 dayTypeIDRef_ = dayTypeNode.Attributes["href"].Value;
             }
             else
             {
                 dayType_ = new CommodityDayTypeEnum(dayTypeNode);
             }
         }
         else
         {
             dayType_ = new CommodityDayTypeEnum(dayTypeNode);
         }
     }
     
 
     XmlNode dayDistributionNode = xmlNode.SelectSingleNode("dayDistribution");
     
     if (dayDistributionNode != null)
     {
         if (dayDistributionNode.Attributes["href"] != null || dayDistributionNode.Attributes["id"] != null) 
         {
             if (dayDistributionNode.Attributes["id"] != null) 
             {
                 dayDistributionIDRef_ = dayDistributionNode.Attributes["id"].Value;
                 CommodityFrequencyType ob = new CommodityFrequencyType(dayDistributionNode);
                 IDManager.SetID(dayDistributionIDRef_, ob);
             }
             else if (dayDistributionNode.Attributes["href"] != null)
             {
                 dayDistributionIDRef_ = dayDistributionNode.Attributes["href"].Value;
             }
             else
             {
                 dayDistribution_ = new CommodityFrequencyType(dayDistributionNode);
             }
         }
         else
         {
             dayDistribution_ = new CommodityFrequencyType(dayDistributionNode);
         }
     }
     
 
     XmlNode dayCountNode = xmlNode.SelectSingleNode("dayCount");
     
     if (dayCountNode != null)
     {
         if (dayCountNode.Attributes["href"] != null || dayCountNode.Attributes["id"] != null) 
         {
             if (dayCountNode.Attributes["id"] != null) 
             {
                 dayCountIDRef_ = dayCountNode.Attributes["id"].Value;
                 XsdTypePositiveInteger ob = new XsdTypePositiveInteger(dayCountNode);
                 IDManager.SetID(dayCountIDRef_, ob);
             }
             else if (dayCountNode.Attributes["href"] != null)
             {
                 dayCountIDRef_ = dayCountNode.Attributes["href"].Value;
             }
             else
             {
                 dayCount_ = new XsdTypePositiveInteger(dayCountNode);
             }
         }
         else
         {
             dayCount_ = new XsdTypePositiveInteger(dayCountNode);
         }
     }
     
 
     XmlNodeList dayOfWeekNodeList = xmlNode.SelectNodes("dayOfWeek");
     
     if (dayOfWeekNodeList != null)
     {
         this.dayOfWeek_ = new List<DayOfWeekEnum>();
         foreach (XmlNode item in dayOfWeekNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     dayOfWeekIDRef_ = item.Attributes["id"].Value;
                     dayOfWeek_.Add(new DayOfWeekEnum(item));
                     IDManager.SetID(dayOfWeekIDRef_, dayOfWeek_[dayOfWeek_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     dayOfWeekIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 dayOfWeek_.Add(new DayOfWeekEnum(item));
                 }
             }
             else
             {
                 dayOfWeek_.Add(new DayOfWeekEnum(item));
             }
         }
     }
     
 
     XmlNode dayNumberNode = xmlNode.SelectSingleNode("dayNumber");
     
     if (dayNumberNode != null)
     {
         if (dayNumberNode.Attributes["href"] != null || dayNumberNode.Attributes["id"] != null) 
         {
             if (dayNumberNode.Attributes["id"] != null) 
             {
                 dayNumberIDRef_ = dayNumberNode.Attributes["id"].Value;
                 XsdTypeInteger ob = new XsdTypeInteger(dayNumberNode);
                 IDManager.SetID(dayNumberIDRef_, ob);
             }
             else if (dayNumberNode.Attributes["href"] != null)
             {
                 dayNumberIDRef_ = dayNumberNode.Attributes["href"].Value;
             }
             else
             {
                 dayNumber_ = new XsdTypeInteger(dayNumberNode);
             }
         }
         else
         {
             dayNumber_ = new XsdTypeInteger(dayNumberNode);
         }
     }
     
 
     XmlNode lagNode = xmlNode.SelectSingleNode("lag");
     
     if (lagNode != null)
     {
         if (lagNode.Attributes["href"] != null || lagNode.Attributes["id"] != null) 
         {
             if (lagNode.Attributes["id"] != null) 
             {
                 lagIDRef_ = lagNode.Attributes["id"].Value;
                 Lag ob = new Lag(lagNode);
                 IDManager.SetID(lagIDRef_, ob);
             }
             else if (lagNode.Attributes["href"] != null)
             {
                 lagIDRef_ = lagNode.Attributes["href"].Value;
             }
             else
             {
                 lag_ = new Lag(lagNode);
             }
         }
         else
         {
             lag_ = new Lag(lagNode);
         }
     }
     
 
     XmlNode lagReferenceNode = xmlNode.SelectSingleNode("lagReference");
     
     if (lagReferenceNode != null)
     {
         if (lagReferenceNode.Attributes["href"] != null || lagReferenceNode.Attributes["id"] != null) 
         {
             if (lagReferenceNode.Attributes["id"] != null) 
             {
                 lagReferenceIDRef_ = lagReferenceNode.Attributes["id"].Value;
                 LagReference ob = new LagReference(lagReferenceNode);
                 IDManager.SetID(lagReferenceIDRef_, ob);
             }
             else if (lagReferenceNode.Attributes["href"] != null)
             {
                 lagReferenceIDRef_ = lagReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 lagReference_ = new LagReference(lagReferenceNode);
             }
         }
         else
         {
             lagReference_ = new LagReference(lagReferenceNode);
         }
     }
     
 
     XmlNode calculationPeriodsReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsReference");
     
     if (calculationPeriodsReferenceNode != null)
     {
         if (calculationPeriodsReferenceNode.Attributes["href"] != null || calculationPeriodsReferenceNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsReferenceNode.Attributes["id"] != null) 
             {
                 calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsReference ob = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                 IDManager.SetID(calculationPeriodsReferenceIDRef_, ob);
             }
             else if (calculationPeriodsReferenceNode.Attributes["href"] != null)
             {
                 calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
             }
         }
         else
         {
             calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
         }
     }
     
 
     XmlNode calculationPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsScheduleReference");
     
     if (calculationPeriodsScheduleReferenceNode != null)
     {
         if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null || calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) 
             {
                 calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                 IDManager.SetID(calculationPeriodsScheduleReferenceIDRef_, ob);
             }
             else if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null)
             {
                 calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
             }
         }
         else
         {
             calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
         }
     }
     
 
     XmlNode calculationPeriodsDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsDatesReference");
     
     if (calculationPeriodsDatesReferenceNode != null)
     {
         if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null || calculationPeriodsDatesReferenceNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsDatesReferenceNode.Attributes["id"] != null) 
             {
                 calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsDatesReference ob = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                 IDManager.SetID(calculationPeriodsDatesReferenceIDRef_, ob);
             }
             else if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null)
             {
                 calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
             }
         }
         else
         {
             calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
         }
     }
     
 
 }
Esempio n. 10
0
        public FloatingRateCalculation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList initialRateNodeList = xmlNode.SelectNodes("initialRate");

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

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


            XmlNodeList finalRateRoundingNodeList = xmlNode.SelectNodes("finalRateRounding");

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

            foreach (XmlNode item in finalRateRoundingNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        finalRateRoundingIDRef = item.Attributes["id"].Name;
                        Rounding ob = Rounding();
                        IDManager.SetID(finalRateRoundingIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        finalRateRoundingIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        finalRateRounding = new Rounding(item);
                    }
                }
            }


            XmlNodeList averagingMethodNodeList = xmlNode.SelectNodes("averagingMethod");

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

            foreach (XmlNode item in averagingMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        averagingMethodIDRef = item.Attributes["id"].Name;
                        AveragingMethodEnum ob = AveragingMethodEnum();
                        IDManager.SetID(averagingMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        averagingMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        averagingMethod = new AveragingMethodEnum(item);
                    }
                }
            }


            XmlNodeList negativeInterestRateTreatmentNodeList = xmlNode.SelectNodes("negativeInterestRateTreatment");

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

            foreach (XmlNode item in negativeInterestRateTreatmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        negativeInterestRateTreatmentIDRef = item.Attributes["id"].Name;
                        NegativeInterestRateTreatmentEnum ob = NegativeInterestRateTreatmentEnum();
                        IDManager.SetID(negativeInterestRateTreatmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        negativeInterestRateTreatmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        negativeInterestRateTreatment = new NegativeInterestRateTreatmentEnum(item);
                    }
                }
            }
        }