public CommodityDeliveryPeriods(XmlNode xmlNode)
        {
            XmlNode periodsNode = xmlNode.SelectSingleNode("periods");

            if (periodsNode != null)
            {
                if (periodsNode.Attributes["href"] != null || periodsNode.Attributes["id"] != null)
                {
                    if (periodsNode.Attributes["id"] != null)
                    {
                        periodsIDRef_ = periodsNode.Attributes["id"].Value;
                        AdjustableDates ob = new AdjustableDates(periodsNode);
                        IDManager.SetID(periodsIDRef_, ob);
                    }
                    else if (periodsNode.Attributes["href"] != null)
                    {
                        periodsIDRef_ = periodsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        periods_ = new AdjustableDates(periodsNode);
                    }
                }
                else
                {
                    periods_ = new AdjustableDates(periodsNode);
                }
            }


            XmlNode periodsScheduleNode = xmlNode.SelectSingleNode("periodsSchedule");

            if (periodsScheduleNode != null)
            {
                if (periodsScheduleNode.Attributes["href"] != null || periodsScheduleNode.Attributes["id"] != null)
                {
                    if (periodsScheduleNode.Attributes["id"] != null)
                    {
                        periodsScheduleIDRef_ = periodsScheduleNode.Attributes["id"].Value;
                        CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(periodsScheduleNode);
                        IDManager.SetID(periodsScheduleIDRef_, ob);
                    }
                    else if (periodsScheduleNode.Attributes["href"] != null)
                    {
                        periodsScheduleIDRef_ = periodsScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        periodsSchedule_ = new CommodityCalculationPeriodsSchedule(periodsScheduleNode);
                    }
                }
                else
                {
                    periodsSchedule_ = new CommodityCalculationPeriodsSchedule(periodsScheduleNode);
                }
            }


            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 CoalStandardQualitySchedule(XmlNode xmlNode)
 {
     XmlNodeList StandardQualityStepNodeList = xmlNode.SelectNodes("StandardQualityStep");
     
     if (StandardQualityStepNodeList != null)
     {
         this.StandardQualityStep_ = new List<CoalStandardQuality>();
         foreach (XmlNode item in StandardQualityStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     StandardQualityStepIDRef_ = item.Attributes["id"].Value;
                     StandardQualityStep_.Add(new CoalStandardQuality(item));
                     IDManager.SetID(StandardQualityStepIDRef_, StandardQualityStep_[StandardQualityStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     StandardQualityStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 StandardQualityStep_.Add(new CoalStandardQuality(item));
                 }
             }
             else
             {
                 StandardQualityStep_.Add(new CoalStandardQuality(item));
             }
         }
     }
     
 
     XmlNode deliveryPeriodsReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsReference");
     
     if (deliveryPeriodsReferenceNode != null)
     {
         if (deliveryPeriodsReferenceNode.Attributes["href"] != null || deliveryPeriodsReferenceNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsReferenceNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsReferenceIDRef_ = deliveryPeriodsReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsReference ob = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
                 IDManager.SetID(deliveryPeriodsReferenceIDRef_, ob);
             }
             else if (deliveryPeriodsReferenceNode.Attributes["href"] != null)
             {
                 deliveryPeriodsReferenceIDRef_ = deliveryPeriodsReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriodsReference_ = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
             }
         }
         else
         {
             deliveryPeriodsReference_ = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
         }
     }
     
 
     XmlNode deliveryPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsScheduleReference");
     
     if (deliveryPeriodsScheduleReferenceNode != null)
     {
         if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null || deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                 IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef_, ob);
             }
             else if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null)
             {
                 deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
             }
         }
         else
         {
             deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
         }
     }
     
 
 }
 public CommodityFixedPriceSchedule(XmlNode xmlNode)
 {
     XmlNodeList fixedPriceStepNodeList = xmlNode.SelectNodes("fixedPriceStep");
     
     if (fixedPriceStepNodeList != null)
     {
         this.fixedPriceStep_ = new List<FixedPrice>();
         foreach (XmlNode item in fixedPriceStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     fixedPriceStepIDRef_ = item.Attributes["id"].Value;
                     fixedPriceStep_.Add(new FixedPrice(item));
                     IDManager.SetID(fixedPriceStepIDRef_, fixedPriceStep_[fixedPriceStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     fixedPriceStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 fixedPriceStep_.Add(new FixedPrice(item));
                 }
             }
             else
             {
                 fixedPriceStep_.Add(new FixedPrice(item));
             }
         }
     }
     
 
     XmlNodeList worldscaleRateStepNodeList = xmlNode.SelectNodes("worldscaleRateStep");
     
     if (worldscaleRateStepNodeList != null)
     {
         this.worldscaleRateStep_ = new List<XsdTypeDecimal>();
         foreach (XmlNode item in worldscaleRateStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     worldscaleRateStepIDRef_ = item.Attributes["id"].Value;
                     worldscaleRateStep_.Add(new XsdTypeDecimal(item));
                     IDManager.SetID(worldscaleRateStepIDRef_, worldscaleRateStep_[worldscaleRateStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     worldscaleRateStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 worldscaleRateStep_.Add(new XsdTypeDecimal(item));
                 }
             }
             else
             {
                 worldscaleRateStep_.Add(new XsdTypeDecimal(item));
             }
         }
     }
     
 
     XmlNodeList contractRateStepNodeList = xmlNode.SelectNodes("contractRateStep");
     
     if (contractRateStepNodeList != null)
     {
         this.contractRateStep_ = new List<NonNegativeMoney>();
         foreach (XmlNode item in contractRateStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     contractRateStepIDRef_ = item.Attributes["id"].Value;
                     contractRateStep_.Add(new NonNegativeMoney(item));
                     IDManager.SetID(contractRateStepIDRef_, contractRateStep_[contractRateStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     contractRateStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 contractRateStep_.Add(new NonNegativeMoney(item));
                 }
             }
             else
             {
                 contractRateStep_.Add(new NonNegativeMoney(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsPriceScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsPriceSchedule");
     
     if (settlementPeriodsPriceScheduleNodeList != null)
     {
         this.settlementPeriodsPriceSchedule_ = new List<CommoditySettlementPeriodsPriceSchedule>();
         foreach (XmlNode item in settlementPeriodsPriceScheduleNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsPriceScheduleIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsPriceSchedule_.Add(new CommoditySettlementPeriodsPriceSchedule(item));
                     IDManager.SetID(settlementPeriodsPriceScheduleIDRef_, settlementPeriodsPriceSchedule_[settlementPeriodsPriceSchedule_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsPriceScheduleIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsPriceSchedule_.Add(new CommoditySettlementPeriodsPriceSchedule(item));
                 }
             }
             else
             {
                 settlementPeriodsPriceSchedule_.Add(new CommoditySettlementPeriodsPriceSchedule(item));
             }
         }
     }
     
 
     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 CommodityPhysicalQuantitySchedule(XmlNode xmlNode)
 {
     XmlNodeList quantityStepNodeList = xmlNode.SelectNodes("quantityStep");
     
     if (quantityStepNodeList != null)
     {
         this.quantityStep_ = new List<CommodityNotionalQuantity>();
         foreach (XmlNode item in quantityStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     quantityStepIDRef_ = item.Attributes["id"].Value;
                     quantityStep_.Add(new CommodityNotionalQuantity(item));
                     IDManager.SetID(quantityStepIDRef_, quantityStep_[quantityStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     quantityStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 quantityStep_.Add(new CommodityNotionalQuantity(item));
                 }
             }
             else
             {
                 quantityStep_.Add(new CommodityNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNode deliveryPeriodsReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsReference");
     
     if (deliveryPeriodsReferenceNode != null)
     {
         if (deliveryPeriodsReferenceNode.Attributes["href"] != null || deliveryPeriodsReferenceNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsReferenceNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsReferenceIDRef_ = deliveryPeriodsReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsReference ob = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
                 IDManager.SetID(deliveryPeriodsReferenceIDRef_, ob);
             }
             else if (deliveryPeriodsReferenceNode.Attributes["href"] != null)
             {
                 deliveryPeriodsReferenceIDRef_ = deliveryPeriodsReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriodsReference_ = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
             }
         }
         else
         {
             deliveryPeriodsReference_ = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
         }
     }
     
 
     XmlNode deliveryPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsScheduleReference");
     
     if (deliveryPeriodsScheduleReferenceNode != null)
     {
         if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null || deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                 IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef_, ob);
             }
             else if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null)
             {
                 deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
             }
         }
         else
         {
             deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
         }
     }
     
 
 }
Exemplo n.º 5
0
        public FloatingPriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates");

            if (calculationDatesNode != null)
            {
                if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null)
                {
                    if (calculationDatesNode.Attributes["id"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                        AdjustableDates ob = new AdjustableDates(calculationDatesNode);
                        IDManager.SetID(calculationDatesIDRef_, ob);
                    }
                    else if (calculationDatesNode.Attributes["href"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationDates_ = new AdjustableDates(calculationDatesNode);
                    }
                }
                else
                {
                    calculationDates_ = new AdjustableDates(calculationDatesNode);
                }
            }


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


            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 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 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;
                        FloatingLegCalculation ob = new FloatingLegCalculation(calculationNode);
                        IDManager.SetID(calculationIDRef_, ob);
                    }
                    else if (calculationNode.Attributes["href"] != null)
                    {
                        calculationIDRef_ = calculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculation_ = new FloatingLegCalculation(calculationNode);
                    }
                }
                else
                {
                    calculation_ = new FloatingLegCalculation(calculationNode);
                }
            }


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

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


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

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


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

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


            XmlNode flatRateNode = xmlNode.SelectSingleNode("flatRate");

            if (flatRateNode != null)
            {
                if (flatRateNode.Attributes["href"] != null || flatRateNode.Attributes["id"] != null)
                {
                    if (flatRateNode.Attributes["id"] != null)
                    {
                        flatRateIDRef_ = flatRateNode.Attributes["id"].Value;
                        FlatRateEnum ob = new FlatRateEnum(flatRateNode);
                        IDManager.SetID(flatRateIDRef_, ob);
                    }
                    else if (flatRateNode.Attributes["href"] != null)
                    {
                        flatRateIDRef_ = flatRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        flatRate_ = new FlatRateEnum(flatRateNode);
                    }
                }
                else
                {
                    flatRate_ = new FlatRateEnum(flatRateNode);
                }
            }


            XmlNode flatRateAmountNode = xmlNode.SelectSingleNode("flatRateAmount");

            if (flatRateAmountNode != null)
            {
                if (flatRateAmountNode.Attributes["href"] != null || flatRateAmountNode.Attributes["id"] != null)
                {
                    if (flatRateAmountNode.Attributes["id"] != null)
                    {
                        flatRateAmountIDRef_ = flatRateAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(flatRateAmountNode);
                        IDManager.SetID(flatRateAmountIDRef_, ob);
                    }
                    else if (flatRateAmountNode.Attributes["href"] != null)
                    {
                        flatRateAmountIDRef_ = flatRateAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode);
                    }
                }
                else
                {
                    flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode);
                }
            }
        }
        public AveragePriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

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


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

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


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }


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

            if (calculationDatesNode != null)
            {
                if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null)
                {
                    if (calculationDatesNode.Attributes["id"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                        AdjustableDates ob = new AdjustableDates(calculationDatesNode);
                        IDManager.SetID(calculationDatesIDRef_, ob);
                    }
                    else if (calculationDatesNode.Attributes["href"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationDates_ = new AdjustableDates(calculationDatesNode);
                    }
                }
                else
                {
                    calculationDates_ = new AdjustableDates(calculationDatesNode);
                }
            }


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


            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 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 pricingStartDateNode = xmlNode.SelectSingleNode("pricingStartDate");

            if (pricingStartDateNode != null)
            {
                if (pricingStartDateNode.Attributes["href"] != null || pricingStartDateNode.Attributes["id"] != null)
                {
                    if (pricingStartDateNode.Attributes["id"] != null)
                    {
                        pricingStartDateIDRef_ = pricingStartDateNode.Attributes["id"].Value;
                        AdjustableDate ob = new AdjustableDate(pricingStartDateNode);
                        IDManager.SetID(pricingStartDateIDRef_, ob);
                    }
                    else if (pricingStartDateNode.Attributes["href"] != null)
                    {
                        pricingStartDateIDRef_ = pricingStartDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pricingStartDate_ = new AdjustableDate(pricingStartDateNode);
                    }
                }
                else
                {
                    pricingStartDate_ = new AdjustableDate(pricingStartDateNode);
                }
            }


            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;
                        FloatingLegCalculation ob = new FloatingLegCalculation(calculationNode);
                        IDManager.SetID(calculationIDRef_, ob);
                    }
                    else if (calculationNode.Attributes["href"] != null)
                    {
                        calculationIDRef_ = calculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculation_ = new FloatingLegCalculation(calculationNode);
                    }
                }
                else
                {
                    calculation_ = new FloatingLegCalculation(calculationNode);
                }
            }


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

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


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

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


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

            if (masterAgreementPaymentDatesNode != null)
            {
                if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null)
                {
                    if (masterAgreementPaymentDatesNode.Attributes["id"] != null)
                    {
                        masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                        IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob);
                    }
                    else if (masterAgreementPaymentDatesNode.Attributes["href"] != null)
                    {
                        masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                    }
                }
                else
                {
                    masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                }
            }
        }
 public SettlementPeriodsSchedule(XmlNode xmlNode)
 {
     XmlNodeList settlementPeriodsStepNodeList = xmlNode.SelectNodes("settlementPeriodsStep");
     
     foreach (XmlNode item in settlementPeriodsStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsStepIDRef = item.Attributes["id"].Name;
                 List<SettlementPeriodsStep> ob = new List<SettlementPeriodsStep>();
                 ob.Add(new SettlementPeriodsStep(item));
                 IDManager.SetID(settlementPeriodsStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriodsStep.Add(new SettlementPeriodsStep(item));
             }
         }
     }
     
 
     XmlNodeList deliveryPeriodsReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsReference");
     if (deliveryPeriodsReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsReferenceIDRef = item.Attributes["id"].Name;
                 CalculationPeriodsReference ob = CalculationPeriodsReference();
                 IDManager.SetID(deliveryPeriodsReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriodsReference = new CalculationPeriodsReference(item);
             }
         }
     }
     
 
     XmlNodeList deliveryPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsScheduleReference");
     if (deliveryPeriodsScheduleReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsScheduleReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name;
                 CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference();
                 IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item);
             }
         }
     }
     
 
 }
 public CommodityPhysicalQuantitySchedule(XmlNode xmlNode)
 {
     XmlNodeList quantityStepNodeList = xmlNode.SelectNodes("quantityStep");
     
     foreach (XmlNode item in quantityStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quantityStepIDRef = item.Attributes["id"].Name;
                 List<CommodityNotionalQuantity> ob = new List<CommodityNotionalQuantity>();
                 ob.Add(new CommodityNotionalQuantity(item));
                 IDManager.SetID(quantityStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quantityStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             quantityStep.Add(new CommodityNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNodeList deliveryPeriodsReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsReference");
     if (deliveryPeriodsReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsReferenceIDRef = item.Attributes["id"].Name;
                 CalculationPeriodsReference ob = CalculationPeriodsReference();
                 IDManager.SetID(deliveryPeriodsReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriodsReference = new CalculationPeriodsReference(item);
             }
         }
     }
     
 
     XmlNodeList deliveryPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsScheduleReference");
     if (deliveryPeriodsScheduleReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsScheduleReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name;
                 CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference();
                 IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item);
             }
         }
     }
     
 
 }
        public CommodityDeliveryPeriods(XmlNode xmlNode)
        {
            XmlNodeList periodsNodeList = xmlNode.SelectNodes("periods");

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

            foreach (XmlNode item in periodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        periodsIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(periodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        periodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        periods = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList periodsScheduleNodeList = xmlNode.SelectNodes("periodsSchedule");

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

            foreach (XmlNode item in periodsScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        periodsScheduleIDRef = item.Attributes["id"].Name;
                        CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                        IDManager.SetID(periodsScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        periodsScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        periodsSchedule = new CommodityCalculationPeriodsSchedule(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 CommodityFixedPriceSchedule(XmlNode xmlNode)
        {
            XmlNodeList fixedPriceStepNodeList = xmlNode.SelectNodes("fixedPriceStep");

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


            XmlNodeList worldscaleRateStepNodeList = xmlNode.SelectNodes("worldscaleRateStep");

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


            XmlNodeList contractRateStepNodeList = xmlNode.SelectNodes("contractRateStep");

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


            XmlNodeList settlementPeriodsPriceScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsPriceSchedule");

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


            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 CommodityStrikeSchedule(XmlNode xmlNode)
 {
     XmlNodeList strikePricePerUnitStepNodeList = xmlNode.SelectNodes("strikePricePerUnitStep");
     
     foreach (XmlNode item in strikePricePerUnitStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strikePricePerUnitStepIDRef = item.Attributes["id"].Name;
                 List<NonNegativeMoney> ob = new List<NonNegativeMoney>();
                 ob.Add(new NonNegativeMoney(item));
                 IDManager.SetID(strikePricePerUnitStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strikePricePerUnitStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             strikePricePerUnitStep.Add(new NonNegativeMoney(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 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 CommodityPricingDates(XmlNode xmlNode)
        {
            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);
                    }
                }
            }


            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 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 businessCalendarNodeList = xmlNode.SelectNodes("businessCalendar");

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

            foreach (XmlNode item in businessCalendarNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        businessCalendarIDRef = item.Attributes["id"].Name;
                        CommodityBusinessCalendar ob = CommodityBusinessCalendar();
                        IDManager.SetID(businessCalendarIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        businessCalendarIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        businessCalendar = new CommodityBusinessCalendar(item);
                    }
                }
            }


            XmlNodeList calendarSourceNodeList = xmlNode.SelectNodes("calendarSource");

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

            foreach (XmlNode item in calendarSourceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calendarSourceIDRef = item.Attributes["id"].Name;
                        CalendarSourceEnum ob = CalendarSourceEnum();
                        IDManager.SetID(calendarSourceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calendarSourceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calendarSource = new CalendarSourceEnum(item);
                    }
                }
            }


            XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");

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


            XmlNodeList settlementPeriodsReferenceNodeList = xmlNode.SelectNodes("settlementPeriodsReference");

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


            XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates");

            foreach (XmlNode item in pricingDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pricingDatesIDRef = item.Attributes["id"].Name;
                        List <AdjustableDates> ob = new List <AdjustableDates>();
                        ob.Add(new AdjustableDates(item));
                        IDManager.SetID(pricingDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pricingDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pricingDates.Add(new AdjustableDates(item));
                    }
                }
            }
        }
Exemplo n.º 14
0
        public CommodityRelativePaymentDates(XmlNode xmlNode)
        {
            XmlNode payRelativeToNode = xmlNode.SelectSingleNode("payRelativeTo");

            if (payRelativeToNode != null)
            {
                if (payRelativeToNode.Attributes["href"] != null || payRelativeToNode.Attributes["id"] != null)
                {
                    if (payRelativeToNode.Attributes["id"] != null)
                    {
                        payRelativeToIDRef_ = payRelativeToNode.Attributes["id"].Value;
                        CommodityPayRelativeToEnum ob = new CommodityPayRelativeToEnum(payRelativeToNode);
                        IDManager.SetID(payRelativeToIDRef_, ob);
                    }
                    else if (payRelativeToNode.Attributes["href"] != null)
                    {
                        payRelativeToIDRef_ = payRelativeToNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payRelativeTo_ = new CommodityPayRelativeToEnum(payRelativeToNode);
                    }
                }
                else
                {
                    payRelativeTo_ = new CommodityPayRelativeToEnum(payRelativeToNode);
                }
            }


            XmlNode payRelativeToEventNode = xmlNode.SelectSingleNode("payRelativeToEvent");

            if (payRelativeToEventNode != null)
            {
                if (payRelativeToEventNode.Attributes["href"] != null || payRelativeToEventNode.Attributes["id"] != null)
                {
                    if (payRelativeToEventNode.Attributes["id"] != null)
                    {
                        payRelativeToEventIDRef_ = payRelativeToEventNode.Attributes["id"].Value;
                        CommodityPayRelativeToEvent ob = new CommodityPayRelativeToEvent(payRelativeToEventNode);
                        IDManager.SetID(payRelativeToEventIDRef_, ob);
                    }
                    else if (payRelativeToEventNode.Attributes["href"] != null)
                    {
                        payRelativeToEventIDRef_ = payRelativeToEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payRelativeToEvent_ = new CommodityPayRelativeToEvent(payRelativeToEventNode);
                    }
                }
                else
                {
                    payRelativeToEvent_ = new CommodityPayRelativeToEvent(payRelativeToEventNode);
                }
            }


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


            XmlNode paymentDaysOffsetNode = xmlNode.SelectSingleNode("paymentDaysOffset");

            if (paymentDaysOffsetNode != null)
            {
                if (paymentDaysOffsetNode.Attributes["href"] != null || paymentDaysOffsetNode.Attributes["id"] != null)
                {
                    if (paymentDaysOffsetNode.Attributes["id"] != null)
                    {
                        paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["id"].Value;
                        DateOffset ob = new DateOffset(paymentDaysOffsetNode);
                        IDManager.SetID(paymentDaysOffsetIDRef_, ob);
                    }
                    else if (paymentDaysOffsetNode.Attributes["href"] != null)
                    {
                        paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDaysOffset_ = new DateOffset(paymentDaysOffsetNode);
                    }
                }
                else
                {
                    paymentDaysOffset_ = new DateOffset(paymentDaysOffsetNode);
                }
            }


            XmlNode businessCentersReferenceNode = xmlNode.SelectSingleNode("businessCentersReference");

            if (businessCentersReferenceNode != null)
            {
                if (businessCentersReferenceNode.Attributes["href"] != null || businessCentersReferenceNode.Attributes["id"] != null)
                {
                    if (businessCentersReferenceNode.Attributes["id"] != null)
                    {
                        businessCentersReferenceIDRef_ = businessCentersReferenceNode.Attributes["id"].Value;
                        BusinessCentersReference ob = new BusinessCentersReference(businessCentersReferenceNode);
                        IDManager.SetID(businessCentersReferenceIDRef_, ob);
                    }
                    else if (businessCentersReferenceNode.Attributes["href"] != null)
                    {
                        businessCentersReferenceIDRef_ = businessCentersReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        businessCentersReference_ = new BusinessCentersReference(businessCentersReferenceNode);
                    }
                }
                else
                {
                    businessCentersReference_ = new BusinessCentersReference(businessCentersReferenceNode);
                }
            }


            XmlNode businessCentersNode = xmlNode.SelectSingleNode("businessCenters");

            if (businessCentersNode != null)
            {
                if (businessCentersNode.Attributes["href"] != null || businessCentersNode.Attributes["id"] != null)
                {
                    if (businessCentersNode.Attributes["id"] != null)
                    {
                        businessCentersIDRef_ = businessCentersNode.Attributes["id"].Value;
                        BusinessCenters ob = new BusinessCenters(businessCentersNode);
                        IDManager.SetID(businessCentersIDRef_, ob);
                    }
                    else if (businessCentersNode.Attributes["href"] != null)
                    {
                        businessCentersIDRef_ = businessCentersNode.Attributes["href"].Value;
                    }
                    else
                    {
                        businessCenters_ = new BusinessCenters(businessCentersNode);
                    }
                }
                else
                {
                    businessCenters_ = new BusinessCenters(businessCentersNode);
                }
            }
        }
        public CoalStandardQualitySchedule(XmlNode xmlNode)
        {
            XmlNodeList StandardQualityStepNodeList = xmlNode.SelectNodes("StandardQualityStep");

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


            XmlNode deliveryPeriodsReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsReference");

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


            XmlNode deliveryPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsScheduleReference");

            if (deliveryPeriodsScheduleReferenceNode != null)
            {
                if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null || deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                        IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef_, ob);
                    }
                    else if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                    }
                }
                else
                {
                    deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                }
            }
        }
 public CommodityNotionalQuantitySchedule(XmlNode xmlNode)
 {
     XmlNodeList notionalStepNodeList = xmlNode.SelectNodes("notionalStep");
     
     if (notionalStepNodeList != null)
     {
         this.notionalStep_ = new List<CommodityNotionalQuantity>();
         foreach (XmlNode item in notionalStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     notionalStepIDRef_ = item.Attributes["id"].Value;
                     notionalStep_.Add(new CommodityNotionalQuantity(item));
                     IDManager.SetID(notionalStepIDRef_, notionalStep_[notionalStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     notionalStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 notionalStep_.Add(new CommodityNotionalQuantity(item));
                 }
             }
             else
             {
                 notionalStep_.Add(new CommodityNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsNotionalQuantityScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantitySchedule");
     
     if (settlementPeriodsNotionalQuantityScheduleNodeList != null)
     {
         this.settlementPeriodsNotionalQuantitySchedule_ = new List<CommoditySettlementPeriodsNotionalQuantitySchedule>();
         foreach (XmlNode item in settlementPeriodsNotionalQuantityScheduleNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsNotionalQuantityScheduleIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsNotionalQuantitySchedule_.Add(new CommoditySettlementPeriodsNotionalQuantitySchedule(item));
                     IDManager.SetID(settlementPeriodsNotionalQuantityScheduleIDRef_, settlementPeriodsNotionalQuantitySchedule_[settlementPeriodsNotionalQuantitySchedule_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsNotionalQuantityScheduleIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsNotionalQuantitySchedule_.Add(new CommoditySettlementPeriodsNotionalQuantitySchedule(item));
                 }
             }
             else
             {
                 settlementPeriodsNotionalQuantitySchedule_.Add(new CommoditySettlementPeriodsNotionalQuantitySchedule(item));
             }
         }
     }
     
 
     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);
         }
     }
     
 
 }
Exemplo n.º 17
0
        public CommoditySpreadSchedule(XmlNode xmlNode)
        {
            XmlNodeList spreadStepNodeList = xmlNode.SelectNodes("spreadStep");

            foreach (XmlNode item in spreadStepNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        spreadStepIDRef = item.Attributes["id"].Name;
                        List <CommoditySpread> ob = new List <CommoditySpread>();
                        ob.Add(new CommoditySpread(item));
                        IDManager.SetID(spreadStepIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        spreadStepIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        spreadStep.Add(new CommoditySpread(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);
                    }
                }
            }
        }
Exemplo n.º 18
0
        public SettlementPeriodsSchedule(XmlNode xmlNode)
        {
            XmlNodeList settlementPeriodsStepNodeList = xmlNode.SelectNodes("settlementPeriodsStep");

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


            XmlNode deliveryPeriodsReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsReference");

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


            XmlNode deliveryPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsScheduleReference");

            if (deliveryPeriodsScheduleReferenceNode != null)
            {
                if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null || deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                        IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef_, ob);
                    }
                    else if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                    }
                }
                else
                {
                    deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                }
            }
        }
 public CommodityPricingDates(XmlNode xmlNode)
 {
     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);
             }
         }
     }
     
 
     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 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 businessCalendarNodeList = xmlNode.SelectNodes("businessCalendar");
     if (businessCalendarNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in businessCalendarNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 businessCalendarIDRef = item.Attributes["id"].Name;
                 CommodityBusinessCalendar ob = CommodityBusinessCalendar();
                 IDManager.SetID(businessCalendarIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 businessCalendarIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 businessCalendar = new CommodityBusinessCalendar(item);
             }
         }
     }
     
 
     XmlNodeList calendarSourceNodeList = xmlNode.SelectNodes("calendarSource");
     if (calendarSourceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calendarSourceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calendarSourceIDRef = item.Attributes["id"].Name;
                 CalendarSourceEnum ob = CalendarSourceEnum();
                 IDManager.SetID(calendarSourceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calendarSourceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calendarSource = new CalendarSourceEnum(item);
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");
     
     foreach (XmlNode item in settlementPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsIDRef = item.Attributes["id"].Name;
                 List<SettlementPeriods> ob = new List<SettlementPeriods>();
                 ob.Add(new SettlementPeriods(item));
                 IDManager.SetID(settlementPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriods.Add(new SettlementPeriods(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsReferenceNodeList = xmlNode.SelectNodes("settlementPeriodsReference");
     
     foreach (XmlNode item in settlementPeriodsReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsReferenceIDRef = item.Attributes["id"].Name;
                 List<SettlementPeriodsReference> ob = new List<SettlementPeriodsReference>();
                 ob.Add(new SettlementPeriodsReference(item));
                 IDManager.SetID(settlementPeriodsReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriodsReference.Add(new SettlementPeriodsReference(item));
             }
         }
     }
     
 
     XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates");
     
     foreach (XmlNode item in pricingDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 pricingDatesIDRef = item.Attributes["id"].Name;
                 List<AdjustableDates> ob = new List<AdjustableDates>();
                 ob.Add(new AdjustableDates(item));
                 IDManager.SetID(pricingDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 pricingDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
             pricingDates.Add(new AdjustableDates(item));
             }
         }
     }
     
 
 }
 public FixedPriceLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates");
     
     if (calculationDatesNode != null)
     {
         if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null) 
         {
             if (calculationDatesNode.Attributes["id"] != null) 
             {
                 calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                 AdjustableDates ob = new AdjustableDates(calculationDatesNode);
                 IDManager.SetID(calculationDatesIDRef_, ob);
             }
             else if (calculationDatesNode.Attributes["href"] != null)
             {
                 calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
             }
             else
             {
                 calculationDates_ = new AdjustableDates(calculationDatesNode);
             }
         }
         else
         {
             calculationDates_ = new AdjustableDates(calculationDatesNode);
         }
     }
     
 
     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 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 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);
         }
     }
     
 
     XmlNode fixedPriceScheduleNode = xmlNode.SelectSingleNode("fixedPriceSchedule");
     
     if (fixedPriceScheduleNode != null)
     {
         if (fixedPriceScheduleNode.Attributes["href"] != null || fixedPriceScheduleNode.Attributes["id"] != null) 
         {
             if (fixedPriceScheduleNode.Attributes["id"] != null) 
             {
                 fixedPriceScheduleIDRef_ = fixedPriceScheduleNode.Attributes["id"].Value;
                 CommodityFixedPriceSchedule ob = new CommodityFixedPriceSchedule(fixedPriceScheduleNode);
                 IDManager.SetID(fixedPriceScheduleIDRef_, ob);
             }
             else if (fixedPriceScheduleNode.Attributes["href"] != null)
             {
                 fixedPriceScheduleIDRef_ = fixedPriceScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 fixedPriceSchedule_ = new CommodityFixedPriceSchedule(fixedPriceScheduleNode);
             }
         }
         else
         {
             fixedPriceSchedule_ = new CommodityFixedPriceSchedule(fixedPriceScheduleNode);
         }
     }
     
 
     XmlNode fixedPriceNode = xmlNode.SelectSingleNode("fixedPrice");
     
     if (fixedPriceNode != null)
     {
         if (fixedPriceNode.Attributes["href"] != null || fixedPriceNode.Attributes["id"] != null) 
         {
             if (fixedPriceNode.Attributes["id"] != null) 
             {
                 fixedPriceIDRef_ = fixedPriceNode.Attributes["id"].Value;
                 FixedPrice ob = new FixedPrice(fixedPriceNode);
                 IDManager.SetID(fixedPriceIDRef_, ob);
             }
             else if (fixedPriceNode.Attributes["href"] != null)
             {
                 fixedPriceIDRef_ = fixedPriceNode.Attributes["href"].Value;
             }
             else
             {
                 fixedPrice_ = new FixedPrice(fixedPriceNode);
             }
         }
         else
         {
             fixedPrice_ = new FixedPrice(fixedPriceNode);
         }
     }
     
 
     XmlNode worldscaleRateNode = xmlNode.SelectSingleNode("worldscaleRate");
     
     if (worldscaleRateNode != null)
     {
         if (worldscaleRateNode.Attributes["href"] != null || worldscaleRateNode.Attributes["id"] != null) 
         {
             if (worldscaleRateNode.Attributes["id"] != null) 
             {
                 worldscaleRateIDRef_ = worldscaleRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(worldscaleRateNode);
                 IDManager.SetID(worldscaleRateIDRef_, ob);
             }
             else if (worldscaleRateNode.Attributes["href"] != null)
             {
                 worldscaleRateIDRef_ = worldscaleRateNode.Attributes["href"].Value;
             }
             else
             {
                 worldscaleRate_ = new XsdTypeDecimal(worldscaleRateNode);
             }
         }
         else
         {
             worldscaleRate_ = new XsdTypeDecimal(worldscaleRateNode);
         }
     }
     
 
     XmlNode contractRateNode = xmlNode.SelectSingleNode("contractRate");
     
     if (contractRateNode != null)
     {
         if (contractRateNode.Attributes["href"] != null || contractRateNode.Attributes["id"] != null) 
         {
             if (contractRateNode.Attributes["id"] != null) 
             {
                 contractRateIDRef_ = contractRateNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(contractRateNode);
                 IDManager.SetID(contractRateIDRef_, ob);
             }
             else if (contractRateNode.Attributes["href"] != null)
             {
                 contractRateIDRef_ = contractRateNode.Attributes["href"].Value;
             }
             else
             {
                 contractRate_ = new NonNegativeMoney(contractRateNode);
             }
         }
         else
         {
             contractRate_ = new NonNegativeMoney(contractRateNode);
         }
     }
     
 
     XmlNodeList settlementPeriodsPriceNodeList = xmlNode.SelectNodes("settlementPeriodsPrice");
     
     if (settlementPeriodsPriceNodeList != null)
     {
         this.settlementPeriodsPrice_ = new List<SettlementPeriodsFixedPrice>();
         foreach (XmlNode item in settlementPeriodsPriceNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsPriceIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsPrice_.Add(new SettlementPeriodsFixedPrice(item));
                     IDManager.SetID(settlementPeriodsPriceIDRef_, settlementPeriodsPrice_[settlementPeriodsPrice_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsPriceIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsPrice_.Add(new SettlementPeriodsFixedPrice(item));
                 }
             }
             else
             {
                 settlementPeriodsPrice_.Add(new SettlementPeriodsFixedPrice(item));
             }
         }
     }
     
 
     XmlNode totalPriceNode = xmlNode.SelectSingleNode("totalPrice");
     
     if (totalPriceNode != null)
     {
         if (totalPriceNode.Attributes["href"] != null || totalPriceNode.Attributes["id"] != null) 
         {
             if (totalPriceNode.Attributes["id"] != null) 
             {
                 totalPriceIDRef_ = totalPriceNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(totalPriceNode);
                 IDManager.SetID(totalPriceIDRef_, ob);
             }
             else if (totalPriceNode.Attributes["href"] != null)
             {
                 totalPriceIDRef_ = totalPriceNode.Attributes["href"].Value;
             }
             else
             {
                 totalPrice_ = new NonNegativeMoney(totalPriceNode);
             }
         }
         else
         {
             totalPrice_ = new NonNegativeMoney(totalPriceNode);
         }
     }
     
 
     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 relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates");
     
     if (relativePaymentDatesNode != null)
     {
         if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null) 
         {
             if (relativePaymentDatesNode.Attributes["id"] != null) 
             {
                 relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value;
                 CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                 IDManager.SetID(relativePaymentDatesIDRef_, ob);
             }
             else if (relativePaymentDatesNode.Attributes["href"] != null)
             {
                 relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
             }
         }
         else
         {
             relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
         }
     }
     
 
     XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates");
     
     if (paymentDatesNode != null)
     {
         if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null) 
         {
             if (paymentDatesNode.Attributes["id"] != null) 
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value;
                 AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                 IDManager.SetID(paymentDatesIDRef_, ob);
             }
             else if (paymentDatesNode.Attributes["href"] != null)
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
             }
         }
         else
         {
             paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
         }
     }
     
 
     XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates");
     
     if (masterAgreementPaymentDatesNode != null)
     {
         if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null) 
         {
             if (masterAgreementPaymentDatesNode.Attributes["id"] != null) 
             {
                 masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                 IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob);
             }
             else if (masterAgreementPaymentDatesNode.Attributes["href"] != null)
             {
                 masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
             }
         }
         else
         {
             masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
         }
     }
     
 
     XmlNode flatRateNode = xmlNode.SelectSingleNode("flatRate");
     
     if (flatRateNode != null)
     {
         if (flatRateNode.Attributes["href"] != null || flatRateNode.Attributes["id"] != null) 
         {
             if (flatRateNode.Attributes["id"] != null) 
             {
                 flatRateIDRef_ = flatRateNode.Attributes["id"].Value;
                 FlatRateEnum ob = new FlatRateEnum(flatRateNode);
                 IDManager.SetID(flatRateIDRef_, ob);
             }
             else if (flatRateNode.Attributes["href"] != null)
             {
                 flatRateIDRef_ = flatRateNode.Attributes["href"].Value;
             }
             else
             {
                 flatRate_ = new FlatRateEnum(flatRateNode);
             }
         }
         else
         {
             flatRate_ = new FlatRateEnum(flatRateNode);
         }
     }
     
 
     XmlNode flatRateAmountNode = xmlNode.SelectSingleNode("flatRateAmount");
     
     if (flatRateAmountNode != null)
     {
         if (flatRateAmountNode.Attributes["href"] != null || flatRateAmountNode.Attributes["id"] != null) 
         {
             if (flatRateAmountNode.Attributes["id"] != null) 
             {
                 flatRateAmountIDRef_ = flatRateAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(flatRateAmountNode);
                 IDManager.SetID(flatRateAmountIDRef_, ob);
             }
             else if (flatRateAmountNode.Attributes["href"] != null)
             {
                 flatRateAmountIDRef_ = flatRateAmountNode.Attributes["href"].Value;
             }
             else
             {
                 flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode);
             }
         }
         else
         {
             flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode);
         }
     }
     
 
 }
Exemplo n.º 21
0
        public CommodityRelativePaymentDates(XmlNode xmlNode)
        {
            XmlNodeList payRelativeToNodeList = xmlNode.SelectNodes("payRelativeTo");

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

            foreach (XmlNode item in payRelativeToNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payRelativeToIDRef = item.Attributes["id"].Name;
                        CommodityPayRelativeToEnum ob = CommodityPayRelativeToEnum();
                        IDManager.SetID(payRelativeToIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payRelativeToIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payRelativeTo = new CommodityPayRelativeToEnum(item);
                    }
                }
            }


            XmlNodeList payRelativeToEventNodeList = xmlNode.SelectNodes("payRelativeToEvent");

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

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


            XmlNodeList paymentDaysOffsetNodeList = xmlNode.SelectNodes("paymentDaysOffset");

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

            foreach (XmlNode item in paymentDaysOffsetNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentDaysOffsetIDRef = item.Attributes["id"].Name;
                        DateOffset ob = DateOffset();
                        IDManager.SetID(paymentDaysOffsetIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDaysOffsetIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDaysOffset = new DateOffset(item);
                    }
                }
            }


            XmlNodeList businessCentersReferenceNodeList = xmlNode.SelectNodes("businessCentersReference");

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

            foreach (XmlNode item in businessCentersReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        businessCentersReferenceIDRef = item.Attributes["id"].Name;
                        BusinessCentersReference ob = BusinessCentersReference();
                        IDManager.SetID(businessCentersReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        businessCentersReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        businessCentersReference = new BusinessCentersReference(item);
                    }
                }
            }


            XmlNodeList businessCentersNodeList = xmlNode.SelectNodes("businessCenters");

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

            foreach (XmlNode item in businessCentersNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        businessCentersIDRef = item.Attributes["id"].Name;
                        BusinessCenters ob = BusinessCenters();
                        IDManager.SetID(businessCentersIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        businessCentersIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        businessCenters = new BusinessCenters(item);
                    }
                }
            }
        }
 public CommodityRelativePaymentDates(XmlNode xmlNode)
 {
     XmlNodeList payRelativeToNodeList = xmlNode.SelectNodes("payRelativeTo");
     if (payRelativeToNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payRelativeToNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payRelativeToIDRef = item.Attributes["id"].Name;
                 CommodityPayRelativeToEnum ob = CommodityPayRelativeToEnum();
                 IDManager.SetID(payRelativeToIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payRelativeToIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payRelativeTo = new CommodityPayRelativeToEnum(item);
             }
         }
     }
     
 
     XmlNodeList payRelativeToEventNodeList = xmlNode.SelectNodes("payRelativeToEvent");
     if (payRelativeToEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payRelativeToEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payRelativeToEventIDRef = item.Attributes["id"].Name;
                 CommodityPayRelativeToEvent ob = CommodityPayRelativeToEvent();
                 IDManager.SetID(payRelativeToEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payRelativeToEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payRelativeToEvent = new CommodityPayRelativeToEvent(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);
             }
         }
     }
     
 
     XmlNodeList paymentDaysOffsetNodeList = xmlNode.SelectNodes("paymentDaysOffset");
     if (paymentDaysOffsetNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDaysOffsetNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDaysOffsetIDRef = item.Attributes["id"].Name;
                 DateOffset ob = DateOffset();
                 IDManager.SetID(paymentDaysOffsetIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDaysOffsetIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDaysOffset = new DateOffset(item);
             }
         }
     }
     
 
     XmlNodeList businessCentersReferenceNodeList = xmlNode.SelectNodes("businessCentersReference");
     if (businessCentersReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in businessCentersReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 businessCentersReferenceIDRef = item.Attributes["id"].Name;
                 BusinessCentersReference ob = BusinessCentersReference();
                 IDManager.SetID(businessCentersReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 businessCentersReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 businessCentersReference = new BusinessCentersReference(item);
             }
         }
     }
     
 
     XmlNodeList businessCentersNodeList = xmlNode.SelectNodes("businessCenters");
     if (businessCentersNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in businessCentersNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 businessCentersIDRef = item.Attributes["id"].Name;
                 BusinessCenters ob = BusinessCenters();
                 IDManager.SetID(businessCentersIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 businessCentersIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 businessCenters = new BusinessCenters(item);
             }
         }
     }
     
 
 }
 public CommodityPricingDates(XmlNode xmlNode)
 {
     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);
         }
     }
     
 
     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 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 businessCalendarNode = xmlNode.SelectSingleNode("businessCalendar");
     
     if (businessCalendarNode != null)
     {
         if (businessCalendarNode.Attributes["href"] != null || businessCalendarNode.Attributes["id"] != null) 
         {
             if (businessCalendarNode.Attributes["id"] != null) 
             {
                 businessCalendarIDRef_ = businessCalendarNode.Attributes["id"].Value;
                 CommodityBusinessCalendar ob = new CommodityBusinessCalendar(businessCalendarNode);
                 IDManager.SetID(businessCalendarIDRef_, ob);
             }
             else if (businessCalendarNode.Attributes["href"] != null)
             {
                 businessCalendarIDRef_ = businessCalendarNode.Attributes["href"].Value;
             }
             else
             {
                 businessCalendar_ = new CommodityBusinessCalendar(businessCalendarNode);
             }
         }
         else
         {
             businessCalendar_ = new CommodityBusinessCalendar(businessCalendarNode);
         }
     }
     
 
     XmlNode calendarSourceNode = xmlNode.SelectSingleNode("calendarSource");
     
     if (calendarSourceNode != null)
     {
         if (calendarSourceNode.Attributes["href"] != null || calendarSourceNode.Attributes["id"] != null) 
         {
             if (calendarSourceNode.Attributes["id"] != null) 
             {
                 calendarSourceIDRef_ = calendarSourceNode.Attributes["id"].Value;
                 CalendarSourceEnum ob = new CalendarSourceEnum(calendarSourceNode);
                 IDManager.SetID(calendarSourceIDRef_, ob);
             }
             else if (calendarSourceNode.Attributes["href"] != null)
             {
                 calendarSourceIDRef_ = calendarSourceNode.Attributes["href"].Value;
             }
             else
             {
                 calendarSource_ = new CalendarSourceEnum(calendarSourceNode);
             }
         }
         else
         {
             calendarSource_ = new CalendarSourceEnum(calendarSourceNode);
         }
     }
     
 
     XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");
     
     if (settlementPeriodsNodeList != null)
     {
         this.settlementPeriods_ = new List<SettlementPeriods>();
         foreach (XmlNode item in settlementPeriodsNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsIDRef_ = item.Attributes["id"].Value;
                     settlementPeriods_.Add(new SettlementPeriods(item));
                     IDManager.SetID(settlementPeriodsIDRef_, settlementPeriods_[settlementPeriods_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriods_.Add(new SettlementPeriods(item));
                 }
             }
             else
             {
                 settlementPeriods_.Add(new SettlementPeriods(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsReferenceNodeList = xmlNode.SelectNodes("settlementPeriodsReference");
     
     if (settlementPeriodsReferenceNodeList != null)
     {
         this.settlementPeriodsReference_ = new List<SettlementPeriodsReference>();
         foreach (XmlNode item in settlementPeriodsReferenceNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsReferenceIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsReference_.Add(new SettlementPeriodsReference(item));
                     IDManager.SetID(settlementPeriodsReferenceIDRef_, settlementPeriodsReference_[settlementPeriodsReference_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsReferenceIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsReference_.Add(new SettlementPeriodsReference(item));
                 }
             }
             else
             {
                 settlementPeriodsReference_.Add(new SettlementPeriodsReference(item));
             }
         }
     }
     
 
     XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates");
     
     if (pricingDatesNodeList != null)
     {
         this.pricingDates_ = new List<AdjustableDates>();
         foreach (XmlNode item in pricingDatesNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     pricingDatesIDRef_ = item.Attributes["id"].Value;
                     pricingDates_.Add(new AdjustableDates(item));
                     IDManager.SetID(pricingDatesIDRef_, pricingDates_[pricingDates_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     pricingDatesIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 pricingDates_.Add(new AdjustableDates(item));
                 }
             }
             else
             {
                 pricingDates_.Add(new AdjustableDates(item));
             }
         }
     }
     
 
 }
 public FloatingPriceLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates");
     if (calculationDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationDatesIDRef = item.Attributes["id"].Name;
                 AdjustableDates ob = AdjustableDates();
                 IDManager.SetID(calculationDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationDates = new AdjustableDates(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods");
     if (calculationPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodsIDRef = item.Attributes["id"].Name;
                 AdjustableDates ob = AdjustableDates();
                 IDManager.SetID(calculationPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriods = new AdjustableDates(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule");
     if (calculationPeriodsScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodsScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodsScheduleIDRef = item.Attributes["id"].Name;
                 CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                 IDManager.SetID(calculationPeriodsScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodsScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(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);
             }
         }
     }
     
 
     XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");
     if (commodityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityIDRef = item.Attributes["id"].Name;
                 Commodity ob = Commodity();
                 IDManager.SetID(commodityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodity = new Commodity(item);
             }
         }
     }
     
 
     XmlNodeList notionalQuantityScheduleNodeList = xmlNode.SelectNodes("notionalQuantitySchedule");
     if (notionalQuantityScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalQuantityScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalQuantityScheduleIDRef = item.Attributes["id"].Name;
                 CommodityNotionalQuantitySchedule ob = CommodityNotionalQuantitySchedule();
                 IDManager.SetID(notionalQuantityScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalQuantityScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalQuantitySchedule = new CommodityNotionalQuantitySchedule(item);
             }
         }
     }
     
 
     XmlNodeList notionalQuantityNodeList = xmlNode.SelectNodes("notionalQuantity");
     if (notionalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalQuantityIDRef = item.Attributes["id"].Name;
                 CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                 IDManager.SetID(notionalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalQuantity = new CommodityNotionalQuantity(item);
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity");
     
     foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsNotionalQuantityIDRef = item.Attributes["id"].Name;
                 List<CommoditySettlementPeriodsNotionalQuantity> ob = new List<CommoditySettlementPeriodsNotionalQuantity>();
                 ob.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
                 IDManager.SetID(settlementPeriodsNotionalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsNotionalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriodsNotionalQuantity.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNodeList totalNotionalQuantityNodeList = xmlNode.SelectNodes("totalNotionalQuantity");
     if (totalNotionalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in totalNotionalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 totalNotionalQuantityIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(totalNotionalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 totalNotionalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 totalNotionalQuantity = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference");
     if (quantityReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in quantityReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quantityReferenceIDRef = item.Attributes["id"].Name;
                 QuantityReference ob = QuantityReference();
                 IDManager.SetID(quantityReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quantityReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 quantityReference = new QuantityReference(item);
             }
         }
     }
     
 
     XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation");
     if (calculationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationIDRef = item.Attributes["id"].Name;
                 FloatingLegCalculation ob = FloatingLegCalculation();
                 IDManager.SetID(calculationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculation = new FloatingLegCalculation(item);
             }
         }
     }
     
 
     XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates");
     if (relativePaymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in relativePaymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 relativePaymentDatesIDRef = item.Attributes["id"].Name;
                 CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                 IDManager.SetID(relativePaymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 relativePaymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 relativePaymentDates = new CommodityRelativePaymentDates(item);
             }
         }
     }
     
 
     XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates");
     if (paymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDatesIDRef = item.Attributes["id"].Name;
                 AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset();
                 IDManager.SetID(paymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDates = new AdjustableDatesOrRelativeDateOffset(item);
             }
         }
     }
     
 
     XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates");
     if (masterAgreementPaymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in masterAgreementPaymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(masterAgreementPaymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 masterAgreementPaymentDates = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList flatRateNodeList = xmlNode.SelectNodes("flatRate");
     if (flatRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in flatRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 flatRateIDRef = item.Attributes["id"].Name;
                 FlatRateEnum ob = FlatRateEnum();
                 IDManager.SetID(flatRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 flatRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 flatRate = new FlatRateEnum(item);
             }
         }
     }
     
 
     XmlNodeList flatRateAmountNodeList = xmlNode.SelectNodes("flatRateAmount");
     if (flatRateAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in flatRateAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 flatRateAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(flatRateAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 flatRateAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 flatRateAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
 }
        public FixedPriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates");

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

            foreach (XmlNode item in calculationDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationDatesIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(calculationDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationDates = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods");

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

            foreach (XmlNode item in calculationPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(calculationPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriods = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule");

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

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


            XmlNodeList fixedPriceScheduleNodeList = xmlNode.SelectNodes("fixedPriceSchedule");

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

            foreach (XmlNode item in fixedPriceScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedPriceScheduleIDRef = item.Attributes["id"].Name;
                        CommodityFixedPriceSchedule ob = CommodityFixedPriceSchedule();
                        IDManager.SetID(fixedPriceScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedPriceScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedPriceSchedule = new CommodityFixedPriceSchedule(item);
                    }
                }
            }


            XmlNodeList fixedPriceNodeList = xmlNode.SelectNodes("fixedPrice");

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

            foreach (XmlNode item in fixedPriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedPriceIDRef = item.Attributes["id"].Name;
                        FixedPrice ob = FixedPrice();
                        IDManager.SetID(fixedPriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedPriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedPrice = new FixedPrice(item);
                    }
                }
            }


            XmlNodeList worldscaleRateNodeList = xmlNode.SelectNodes("worldscaleRate");

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

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


            XmlNodeList contractRateNodeList = xmlNode.SelectNodes("contractRate");

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

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


            XmlNodeList settlementPeriodsPriceNodeList = xmlNode.SelectNodes("settlementPeriodsPrice");

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


            XmlNodeList totalPriceNodeList = xmlNode.SelectNodes("totalPrice");

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

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


            XmlNodeList notionalQuantityScheduleNodeList = xmlNode.SelectNodes("notionalQuantitySchedule");

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

            foreach (XmlNode item in notionalQuantityScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalQuantityScheduleIDRef = item.Attributes["id"].Name;
                        CommodityNotionalQuantitySchedule ob = CommodityNotionalQuantitySchedule();
                        IDManager.SetID(notionalQuantityScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalQuantityScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notionalQuantitySchedule = new CommodityNotionalQuantitySchedule(item);
                    }
                }
            }


            XmlNodeList notionalQuantityNodeList = xmlNode.SelectNodes("notionalQuantity");

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

            foreach (XmlNode item in notionalQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalQuantityIDRef = item.Attributes["id"].Name;
                        CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                        IDManager.SetID(notionalQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notionalQuantity = new CommodityNotionalQuantity(item);
                    }
                }
            }


            XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity");

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


            XmlNodeList totalNotionalQuantityNodeList = xmlNode.SelectNodes("totalNotionalQuantity");

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

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


            XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference");

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

            foreach (XmlNode item in quantityReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quantityReferenceIDRef = item.Attributes["id"].Name;
                        QuantityReference ob = QuantityReference();
                        IDManager.SetID(quantityReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quantityReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quantityReference = new QuantityReference(item);
                    }
                }
            }


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

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

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


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

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

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


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

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

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


            XmlNodeList flatRateNodeList = xmlNode.SelectNodes("flatRate");

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

            foreach (XmlNode item in flatRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        flatRateIDRef = item.Attributes["id"].Name;
                        FlatRateEnum ob = FlatRateEnum();
                        IDManager.SetID(flatRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        flatRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        flatRate = new FlatRateEnum(item);
                    }
                }
            }


            XmlNodeList flatRateAmountNodeList = xmlNode.SelectNodes("flatRateAmount");

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

            foreach (XmlNode item in flatRateAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        flatRateAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(flatRateAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        flatRateAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        flatRateAmount = new NonNegativeMoney(item);
                    }
                }
            }
        }
Exemplo n.º 26
0
        public CommodityPhysicalQuantitySchedule(XmlNode xmlNode)
        {
            XmlNodeList quantityStepNodeList = xmlNode.SelectNodes("quantityStep");

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


            XmlNode deliveryPeriodsReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsReference");

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


            XmlNode deliveryPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsScheduleReference");

            if (deliveryPeriodsScheduleReferenceNode != null)
            {
                if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null || deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                        IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef_, ob);
                    }
                    else if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                    }
                }
                else
                {
                    deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                }
            }
        }
Exemplo n.º 27
0
        public CommodityFixedPriceSchedule(XmlNode xmlNode)
        {
            XmlNodeList fixedPriceStepNodeList = xmlNode.SelectNodes("fixedPriceStep");

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


            XmlNodeList worldscaleRateStepNodeList = xmlNode.SelectNodes("worldscaleRateStep");

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


            XmlNodeList contractRateStepNodeList = xmlNode.SelectNodes("contractRateStep");

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


            XmlNodeList settlementPeriodsPriceScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsPriceSchedule");

            foreach (XmlNode item in settlementPeriodsPriceScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementPeriodsPriceScheduleIDRef = item.Attributes["id"].Name;
                        List <CommoditySettlementPeriodsPriceSchedule> ob = new List <CommoditySettlementPeriodsPriceSchedule>();
                        ob.Add(new CommoditySettlementPeriodsPriceSchedule(item));
                        IDManager.SetID(settlementPeriodsPriceScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementPeriodsPriceScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementPeriodsPriceSchedule.Add(new CommoditySettlementPeriodsPriceSchedule(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 AveragePriceLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates");
     
     if (calculationDatesNode != null)
     {
         if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null) 
         {
             if (calculationDatesNode.Attributes["id"] != null) 
             {
                 calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                 AdjustableDates ob = new AdjustableDates(calculationDatesNode);
                 IDManager.SetID(calculationDatesIDRef_, ob);
             }
             else if (calculationDatesNode.Attributes["href"] != null)
             {
                 calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
             }
             else
             {
                 calculationDates_ = new AdjustableDates(calculationDatesNode);
             }
         }
         else
         {
             calculationDates_ = new AdjustableDates(calculationDatesNode);
         }
     }
     
 
     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 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 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);
         }
     }
     
 
     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 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 pricingStartDateNode = xmlNode.SelectSingleNode("pricingStartDate");
     
     if (pricingStartDateNode != null)
     {
         if (pricingStartDateNode.Attributes["href"] != null || pricingStartDateNode.Attributes["id"] != null) 
         {
             if (pricingStartDateNode.Attributes["id"] != null) 
             {
                 pricingStartDateIDRef_ = pricingStartDateNode.Attributes["id"].Value;
                 AdjustableDate ob = new AdjustableDate(pricingStartDateNode);
                 IDManager.SetID(pricingStartDateIDRef_, ob);
             }
             else if (pricingStartDateNode.Attributes["href"] != null)
             {
                 pricingStartDateIDRef_ = pricingStartDateNode.Attributes["href"].Value;
             }
             else
             {
                 pricingStartDate_ = new AdjustableDate(pricingStartDateNode);
             }
         }
         else
         {
             pricingStartDate_ = new AdjustableDate(pricingStartDateNode);
         }
     }
     
 
     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;
                 FloatingLegCalculation ob = new FloatingLegCalculation(calculationNode);
                 IDManager.SetID(calculationIDRef_, ob);
             }
             else if (calculationNode.Attributes["href"] != null)
             {
                 calculationIDRef_ = calculationNode.Attributes["href"].Value;
             }
             else
             {
                 calculation_ = new FloatingLegCalculation(calculationNode);
             }
         }
         else
         {
             calculation_ = new FloatingLegCalculation(calculationNode);
         }
     }
     
 
     XmlNode relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates");
     
     if (relativePaymentDatesNode != null)
     {
         if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null) 
         {
             if (relativePaymentDatesNode.Attributes["id"] != null) 
             {
                 relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value;
                 CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                 IDManager.SetID(relativePaymentDatesIDRef_, ob);
             }
             else if (relativePaymentDatesNode.Attributes["href"] != null)
             {
                 relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
             }
         }
         else
         {
             relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
         }
     }
     
 
     XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates");
     
     if (paymentDatesNode != null)
     {
         if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null) 
         {
             if (paymentDatesNode.Attributes["id"] != null) 
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value;
                 AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                 IDManager.SetID(paymentDatesIDRef_, ob);
             }
             else if (paymentDatesNode.Attributes["href"] != null)
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
             }
         }
         else
         {
             paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
         }
     }
     
 
     XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates");
     
     if (masterAgreementPaymentDatesNode != null)
     {
         if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null) 
         {
             if (masterAgreementPaymentDatesNode.Attributes["id"] != null) 
             {
                 masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                 IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob);
             }
             else if (masterAgreementPaymentDatesNode.Attributes["href"] != null)
             {
                 masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
             }
         }
         else
         {
             masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
         }
     }
     
 
 }
Exemplo n.º 29
0
        public CommodityPricingDates(XmlNode xmlNode)
        {
            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);
                }
            }


            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 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 businessCalendarNode = xmlNode.SelectSingleNode("businessCalendar");

            if (businessCalendarNode != null)
            {
                if (businessCalendarNode.Attributes["href"] != null || businessCalendarNode.Attributes["id"] != null)
                {
                    if (businessCalendarNode.Attributes["id"] != null)
                    {
                        businessCalendarIDRef_ = businessCalendarNode.Attributes["id"].Value;
                        CommodityBusinessCalendar ob = new CommodityBusinessCalendar(businessCalendarNode);
                        IDManager.SetID(businessCalendarIDRef_, ob);
                    }
                    else if (businessCalendarNode.Attributes["href"] != null)
                    {
                        businessCalendarIDRef_ = businessCalendarNode.Attributes["href"].Value;
                    }
                    else
                    {
                        businessCalendar_ = new CommodityBusinessCalendar(businessCalendarNode);
                    }
                }
                else
                {
                    businessCalendar_ = new CommodityBusinessCalendar(businessCalendarNode);
                }
            }


            XmlNode calendarSourceNode = xmlNode.SelectSingleNode("calendarSource");

            if (calendarSourceNode != null)
            {
                if (calendarSourceNode.Attributes["href"] != null || calendarSourceNode.Attributes["id"] != null)
                {
                    if (calendarSourceNode.Attributes["id"] != null)
                    {
                        calendarSourceIDRef_ = calendarSourceNode.Attributes["id"].Value;
                        CalendarSourceEnum ob = new CalendarSourceEnum(calendarSourceNode);
                        IDManager.SetID(calendarSourceIDRef_, ob);
                    }
                    else if (calendarSourceNode.Attributes["href"] != null)
                    {
                        calendarSourceIDRef_ = calendarSourceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calendarSource_ = new CalendarSourceEnum(calendarSourceNode);
                    }
                }
                else
                {
                    calendarSource_ = new CalendarSourceEnum(calendarSourceNode);
                }
            }


            XmlNodeList settlementPeriodsNodeList = xmlNode.SelectNodes("settlementPeriods");

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


            XmlNodeList settlementPeriodsReferenceNodeList = xmlNode.SelectNodes("settlementPeriodsReference");

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


            XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates");

            if (pricingDatesNodeList != null)
            {
                this.pricingDates_ = new List <AdjustableDates>();
                foreach (XmlNode item in pricingDatesNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            pricingDatesIDRef_ = item.Attributes["id"].Value;
                            pricingDates_.Add(new AdjustableDates(item));
                            IDManager.SetID(pricingDatesIDRef_, pricingDates_[pricingDates_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            pricingDatesIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            pricingDates_.Add(new AdjustableDates(item));
                        }
                    }
                    else
                    {
                        pricingDates_.Add(new AdjustableDates(item));
                    }
                }
            }
        }
 public CommoditySpreadSchedule(XmlNode xmlNode)
 {
     XmlNodeList spreadStepNodeList = xmlNode.SelectNodes("spreadStep");
     
     if (spreadStepNodeList != null)
     {
         this.spreadStep_ = new List<CommoditySpread>();
         foreach (XmlNode item in spreadStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     spreadStepIDRef_ = item.Attributes["id"].Value;
                     spreadStep_.Add(new CommoditySpread(item));
                     IDManager.SetID(spreadStepIDRef_, spreadStep_[spreadStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     spreadStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 spreadStep_.Add(new CommoditySpread(item));
                 }
             }
             else
             {
                 spreadStep_.Add(new CommoditySpread(item));
             }
         }
     }
     
 
     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);
         }
     }
     
 
 }
Exemplo n.º 31
0
        public CommoditySpreadSchedule(XmlNode xmlNode)
        {
            XmlNodeList spreadStepNodeList = xmlNode.SelectNodes("spreadStep");

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


            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 AveragePriceLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");
     if (payerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(payerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");
     if (payerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(payerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");
     if (receiverPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(receiverPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");
     if (receiverAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(receiverAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates");
     if (calculationDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationDatesIDRef = item.Attributes["id"].Name;
                 AdjustableDates ob = AdjustableDates();
                 IDManager.SetID(calculationDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationDates = new AdjustableDates(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods");
     if (calculationPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodsIDRef = item.Attributes["id"].Name;
                 AdjustableDates ob = AdjustableDates();
                 IDManager.SetID(calculationPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriods = new AdjustableDates(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule");
     if (calculationPeriodsScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodsScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodsScheduleIDRef = item.Attributes["id"].Name;
                 CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                 IDManager.SetID(calculationPeriodsScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodsScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(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);
             }
         }
     }
     
 
     XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");
     if (commodityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityIDRef = item.Attributes["id"].Name;
                 Commodity ob = Commodity();
                 IDManager.SetID(commodityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodity = new Commodity(item);
             }
         }
     }
     
 
     XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference");
     if (quantityReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in quantityReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quantityReferenceIDRef = item.Attributes["id"].Name;
                 QuantityReference ob = QuantityReference();
                 IDManager.SetID(quantityReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quantityReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 quantityReference = new QuantityReference(item);
             }
         }
     }
     
 
     XmlNodeList pricingStartDateNodeList = xmlNode.SelectNodes("pricingStartDate");
     if (pricingStartDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in pricingStartDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 pricingStartDateIDRef = item.Attributes["id"].Name;
                 AdjustableDate ob = AdjustableDate();
                 IDManager.SetID(pricingStartDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 pricingStartDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 pricingStartDate = new AdjustableDate(item);
             }
         }
     }
     
 
     XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation");
     if (calculationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationIDRef = item.Attributes["id"].Name;
                 FloatingLegCalculation ob = FloatingLegCalculation();
                 IDManager.SetID(calculationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculation = new FloatingLegCalculation(item);
             }
         }
     }
     
 
     XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates");
     if (relativePaymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in relativePaymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 relativePaymentDatesIDRef = item.Attributes["id"].Name;
                 CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                 IDManager.SetID(relativePaymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 relativePaymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 relativePaymentDates = new CommodityRelativePaymentDates(item);
             }
         }
     }
     
 
     XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates");
     if (paymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDatesIDRef = item.Attributes["id"].Name;
                 AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset();
                 IDManager.SetID(paymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDates = new AdjustableDatesOrRelativeDateOffset(item);
             }
         }
     }
     
 
     XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates");
     if (masterAgreementPaymentDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in masterAgreementPaymentDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(masterAgreementPaymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 masterAgreementPaymentDates = new XsdTypeBoolean(item);
             }
         }
     }
     
 
 }
Exemplo n.º 33
0
        public AveragePriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

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


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

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


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


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

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

            foreach (XmlNode item in calculationDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationDatesIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(calculationDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationDates = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods");

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

            foreach (XmlNode item in calculationPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(calculationPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriods = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule");

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

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


            XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");

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

            foreach (XmlNode item in commodityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commodityIDRef = item.Attributes["id"].Name;
                        Commodity ob = Commodity();
                        IDManager.SetID(commodityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commodityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commodity = new Commodity(item);
                    }
                }
            }


            XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference");

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

            foreach (XmlNode item in quantityReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quantityReferenceIDRef = item.Attributes["id"].Name;
                        QuantityReference ob = QuantityReference();
                        IDManager.SetID(quantityReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quantityReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quantityReference = new QuantityReference(item);
                    }
                }
            }


            XmlNodeList pricingStartDateNodeList = xmlNode.SelectNodes("pricingStartDate");

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

            foreach (XmlNode item in pricingStartDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pricingStartDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate ob = AdjustableDate();
                        IDManager.SetID(pricingStartDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pricingStartDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pricingStartDate = new AdjustableDate(item);
                    }
                }
            }


            XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation");

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

            foreach (XmlNode item in calculationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationIDRef = item.Attributes["id"].Name;
                        FloatingLegCalculation ob = FloatingLegCalculation();
                        IDManager.SetID(calculationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculation = new FloatingLegCalculation(item);
                    }
                }
            }


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

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

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


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

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

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


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

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

            foreach (XmlNode item in masterAgreementPaymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(masterAgreementPaymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        masterAgreementPaymentDates = new XsdTypeBoolean(item);
                    }
                }
            }
        }
        public 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 CommodityRelativePaymentDates(XmlNode xmlNode)
 {
     XmlNode payRelativeToNode = xmlNode.SelectSingleNode("payRelativeTo");
     
     if (payRelativeToNode != null)
     {
         if (payRelativeToNode.Attributes["href"] != null || payRelativeToNode.Attributes["id"] != null) 
         {
             if (payRelativeToNode.Attributes["id"] != null) 
             {
                 payRelativeToIDRef_ = payRelativeToNode.Attributes["id"].Value;
                 CommodityPayRelativeToEnum ob = new CommodityPayRelativeToEnum(payRelativeToNode);
                 IDManager.SetID(payRelativeToIDRef_, ob);
             }
             else if (payRelativeToNode.Attributes["href"] != null)
             {
                 payRelativeToIDRef_ = payRelativeToNode.Attributes["href"].Value;
             }
             else
             {
                 payRelativeTo_ = new CommodityPayRelativeToEnum(payRelativeToNode);
             }
         }
         else
         {
             payRelativeTo_ = new CommodityPayRelativeToEnum(payRelativeToNode);
         }
     }
     
 
     XmlNode payRelativeToEventNode = xmlNode.SelectSingleNode("payRelativeToEvent");
     
     if (payRelativeToEventNode != null)
     {
         if (payRelativeToEventNode.Attributes["href"] != null || payRelativeToEventNode.Attributes["id"] != null) 
         {
             if (payRelativeToEventNode.Attributes["id"] != null) 
             {
                 payRelativeToEventIDRef_ = payRelativeToEventNode.Attributes["id"].Value;
                 CommodityPayRelativeToEvent ob = new CommodityPayRelativeToEvent(payRelativeToEventNode);
                 IDManager.SetID(payRelativeToEventIDRef_, ob);
             }
             else if (payRelativeToEventNode.Attributes["href"] != null)
             {
                 payRelativeToEventIDRef_ = payRelativeToEventNode.Attributes["href"].Value;
             }
             else
             {
                 payRelativeToEvent_ = new CommodityPayRelativeToEvent(payRelativeToEventNode);
             }
         }
         else
         {
             payRelativeToEvent_ = new CommodityPayRelativeToEvent(payRelativeToEventNode);
         }
     }
     
 
     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);
         }
     }
     
 
     XmlNode paymentDaysOffsetNode = xmlNode.SelectSingleNode("paymentDaysOffset");
     
     if (paymentDaysOffsetNode != null)
     {
         if (paymentDaysOffsetNode.Attributes["href"] != null || paymentDaysOffsetNode.Attributes["id"] != null) 
         {
             if (paymentDaysOffsetNode.Attributes["id"] != null) 
             {
                 paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["id"].Value;
                 DateOffset ob = new DateOffset(paymentDaysOffsetNode);
                 IDManager.SetID(paymentDaysOffsetIDRef_, ob);
             }
             else if (paymentDaysOffsetNode.Attributes["href"] != null)
             {
                 paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDaysOffset_ = new DateOffset(paymentDaysOffsetNode);
             }
         }
         else
         {
             paymentDaysOffset_ = new DateOffset(paymentDaysOffsetNode);
         }
     }
     
 
     XmlNode businessCentersReferenceNode = xmlNode.SelectSingleNode("businessCentersReference");
     
     if (businessCentersReferenceNode != null)
     {
         if (businessCentersReferenceNode.Attributes["href"] != null || businessCentersReferenceNode.Attributes["id"] != null) 
         {
             if (businessCentersReferenceNode.Attributes["id"] != null) 
             {
                 businessCentersReferenceIDRef_ = businessCentersReferenceNode.Attributes["id"].Value;
                 BusinessCentersReference ob = new BusinessCentersReference(businessCentersReferenceNode);
                 IDManager.SetID(businessCentersReferenceIDRef_, ob);
             }
             else if (businessCentersReferenceNode.Attributes["href"] != null)
             {
                 businessCentersReferenceIDRef_ = businessCentersReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 businessCentersReference_ = new BusinessCentersReference(businessCentersReferenceNode);
             }
         }
         else
         {
             businessCentersReference_ = new BusinessCentersReference(businessCentersReferenceNode);
         }
     }
     
 
     XmlNode businessCentersNode = xmlNode.SelectSingleNode("businessCenters");
     
     if (businessCentersNode != null)
     {
         if (businessCentersNode.Attributes["href"] != null || businessCentersNode.Attributes["id"] != null) 
         {
             if (businessCentersNode.Attributes["id"] != null) 
             {
                 businessCentersIDRef_ = businessCentersNode.Attributes["id"].Value;
                 BusinessCenters ob = new BusinessCenters(businessCentersNode);
                 IDManager.SetID(businessCentersIDRef_, ob);
             }
             else if (businessCentersNode.Attributes["href"] != null)
             {
                 businessCentersIDRef_ = businessCentersNode.Attributes["href"].Value;
             }
             else
             {
                 businessCenters_ = new BusinessCenters(businessCentersNode);
             }
         }
         else
         {
             businessCenters_ = new BusinessCenters(businessCentersNode);
         }
     }
     
 
 }
        public CommodityPhysicalQuantitySchedule(XmlNode xmlNode)
        {
            XmlNodeList quantityStepNodeList = xmlNode.SelectNodes("quantityStep");

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


            XmlNodeList deliveryPeriodsReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsReference");

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

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


            XmlNodeList deliveryPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsScheduleReference");

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

            foreach (XmlNode item in deliveryPeriodsScheduleReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference();
                        IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item);
                    }
                }
            }
        }
        public SettlementPeriodsSchedule(XmlNode xmlNode)
        {
            XmlNodeList settlementPeriodsStepNodeList = xmlNode.SelectNodes("settlementPeriodsStep");

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


            XmlNodeList deliveryPeriodsReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsReference");

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

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


            XmlNodeList deliveryPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("deliveryPeriodsScheduleReference");

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

            foreach (XmlNode item in deliveryPeriodsScheduleReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference();
                        IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item);
                    }
                }
            }
        }
 public CommodityDeliveryPeriods(XmlNode xmlNode)
 {
     XmlNodeList periodsNodeList = xmlNode.SelectNodes("periods");
     if (periodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in periodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 periodsIDRef = item.Attributes["id"].Name;
                 AdjustableDates ob = AdjustableDates();
                 IDManager.SetID(periodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 periodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 periods = new AdjustableDates(item);
             }
         }
     }
     
 
     XmlNodeList periodsScheduleNodeList = xmlNode.SelectNodes("periodsSchedule");
     if (periodsScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in periodsScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 periodsScheduleIDRef = item.Attributes["id"].Name;
                 CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                 IDManager.SetID(periodsScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 periodsScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 periodsSchedule = new CommodityCalculationPeriodsSchedule(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);
             }
         }
     }
     
 
 }
Exemplo n.º 39
0
        public CommodityNotionalQuantitySchedule(XmlNode xmlNode)
        {
            XmlNodeList notionalStepNodeList = xmlNode.SelectNodes("notionalStep");

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


            XmlNodeList settlementPeriodsNotionalQuantityScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantitySchedule");

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


            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 CommodityDeliveryPeriods(XmlNode xmlNode)
 {
     XmlNode periodsNode = xmlNode.SelectSingleNode("periods");
     
     if (periodsNode != null)
     {
         if (periodsNode.Attributes["href"] != null || periodsNode.Attributes["id"] != null) 
         {
             if (periodsNode.Attributes["id"] != null) 
             {
                 periodsIDRef_ = periodsNode.Attributes["id"].Value;
                 AdjustableDates ob = new AdjustableDates(periodsNode);
                 IDManager.SetID(periodsIDRef_, ob);
             }
             else if (periodsNode.Attributes["href"] != null)
             {
                 periodsIDRef_ = periodsNode.Attributes["href"].Value;
             }
             else
             {
                 periods_ = new AdjustableDates(periodsNode);
             }
         }
         else
         {
             periods_ = new AdjustableDates(periodsNode);
         }
     }
     
 
     XmlNode periodsScheduleNode = xmlNode.SelectSingleNode("periodsSchedule");
     
     if (periodsScheduleNode != null)
     {
         if (periodsScheduleNode.Attributes["href"] != null || periodsScheduleNode.Attributes["id"] != null) 
         {
             if (periodsScheduleNode.Attributes["id"] != null) 
             {
                 periodsScheduleIDRef_ = periodsScheduleNode.Attributes["id"].Value;
                 CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(periodsScheduleNode);
                 IDManager.SetID(periodsScheduleIDRef_, ob);
             }
             else if (periodsScheduleNode.Attributes["href"] != null)
             {
                 periodsScheduleIDRef_ = periodsScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 periodsSchedule_ = new CommodityCalculationPeriodsSchedule(periodsScheduleNode);
             }
         }
         else
         {
             periodsSchedule_ = new CommodityCalculationPeriodsSchedule(periodsScheduleNode);
         }
     }
     
 
     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 SettlementPeriodsSchedule(XmlNode xmlNode)
 {
     XmlNodeList settlementPeriodsStepNodeList = xmlNode.SelectNodes("settlementPeriodsStep");
     
     if (settlementPeriodsStepNodeList != null)
     {
         this.settlementPeriodsStep_ = new List<SettlementPeriodsStep>();
         foreach (XmlNode item in settlementPeriodsStepNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsStepIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsStep_.Add(new SettlementPeriodsStep(item));
                     IDManager.SetID(settlementPeriodsStepIDRef_, settlementPeriodsStep_[settlementPeriodsStep_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsStepIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsStep_.Add(new SettlementPeriodsStep(item));
                 }
             }
             else
             {
                 settlementPeriodsStep_.Add(new SettlementPeriodsStep(item));
             }
         }
     }
     
 
     XmlNode deliveryPeriodsReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsReference");
     
     if (deliveryPeriodsReferenceNode != null)
     {
         if (deliveryPeriodsReferenceNode.Attributes["href"] != null || deliveryPeriodsReferenceNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsReferenceNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsReferenceIDRef_ = deliveryPeriodsReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsReference ob = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
                 IDManager.SetID(deliveryPeriodsReferenceIDRef_, ob);
             }
             else if (deliveryPeriodsReferenceNode.Attributes["href"] != null)
             {
                 deliveryPeriodsReferenceIDRef_ = deliveryPeriodsReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriodsReference_ = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
             }
         }
         else
         {
             deliveryPeriodsReference_ = new CalculationPeriodsReference(deliveryPeriodsReferenceNode);
         }
     }
     
 
     XmlNode deliveryPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("deliveryPeriodsScheduleReference");
     
     if (deliveryPeriodsScheduleReferenceNode != null)
     {
         if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null || deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsScheduleReferenceNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
                 IDManager.SetID(deliveryPeriodsScheduleReferenceIDRef_, ob);
             }
             else if (deliveryPeriodsScheduleReferenceNode.Attributes["href"] != null)
             {
                 deliveryPeriodsScheduleReferenceIDRef_ = deliveryPeriodsScheduleReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
             }
         }
         else
         {
             deliveryPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(deliveryPeriodsScheduleReferenceNode);
         }
     }
     
 
 }
Exemplo n.º 42
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 CommodityNotionalQuantitySchedule(XmlNode xmlNode)
 {
     XmlNodeList notionalStepNodeList = xmlNode.SelectNodes("notionalStep");
     
     foreach (XmlNode item in notionalStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalStepIDRef = item.Attributes["id"].Name;
                 List<CommodityNotionalQuantity> ob = new List<CommodityNotionalQuantity>();
                 ob.Add(new CommodityNotionalQuantity(item));
                 IDManager.SetID(notionalStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             notionalStep.Add(new CommodityNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsNotionalQuantityScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantitySchedule");
     
     foreach (XmlNode item in settlementPeriodsNotionalQuantityScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsNotionalQuantityScheduleIDRef = item.Attributes["id"].Name;
                 List<CommoditySettlementPeriodsNotionalQuantitySchedule> ob = new List<CommoditySettlementPeriodsNotionalQuantitySchedule>();
                 ob.Add(new CommoditySettlementPeriodsNotionalQuantitySchedule(item));
                 IDManager.SetID(settlementPeriodsNotionalQuantityScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsNotionalQuantityScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriodsNotionalQuantitySchedule.Add(new CommoditySettlementPeriodsNotionalQuantitySchedule(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 CommodityFixedPriceSchedule(XmlNode xmlNode)
 {
     XmlNodeList fixedPriceStepNodeList = xmlNode.SelectNodes("fixedPriceStep");
     
     foreach (XmlNode item in fixedPriceStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedPriceStepIDRef = item.Attributes["id"].Name;
                 List<FixedPrice> ob = new List<FixedPrice>();
                 ob.Add(new FixedPrice(item));
                 IDManager.SetID(fixedPriceStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedPriceStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             fixedPriceStep.Add(new FixedPrice(item));
             }
         }
     }
     
 
     XmlNodeList worldscaleRateStepNodeList = xmlNode.SelectNodes("worldscaleRateStep");
     
     foreach (XmlNode item in worldscaleRateStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 worldscaleRateStepIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = new XsdTypeDecimal();
                 ob.Add(new XsdTypeDecimal(item));
                 IDManager.SetID(worldscaleRateStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 worldscaleRateStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             worldscaleRateStep.Add(new XsdTypeDecimal(item));
             }
         }
     }
     
 
     XmlNodeList contractRateStepNodeList = xmlNode.SelectNodes("contractRateStep");
     
     foreach (XmlNode item in contractRateStepNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 contractRateStepIDRef = item.Attributes["id"].Name;
                 List<NonNegativeMoney> ob = new List<NonNegativeMoney>();
                 ob.Add(new NonNegativeMoney(item));
                 IDManager.SetID(contractRateStepIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 contractRateStepIDRef = item.Attributes["href"].Name;
             }
             else
             {
             contractRateStep.Add(new NonNegativeMoney(item));
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsPriceScheduleNodeList = xmlNode.SelectNodes("settlementPeriodsPriceSchedule");
     
     foreach (XmlNode item in settlementPeriodsPriceScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsPriceScheduleIDRef = item.Attributes["id"].Name;
                 List<CommoditySettlementPeriodsPriceSchedule> ob = new List<CommoditySettlementPeriodsPriceSchedule>();
                 ob.Add(new CommoditySettlementPeriodsPriceSchedule(item));
                 IDManager.SetID(settlementPeriodsPriceScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsPriceScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriodsPriceSchedule.Add(new CommoditySettlementPeriodsPriceSchedule(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);
             }
         }
     }
     
 
 }