public Commodity(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList commodityBaseNodeList = xmlNode.SelectNodes("commodityBase");
     if (commodityBaseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityBaseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityBaseIDRef = item.Attributes["id"].Name;
                 CommodityBase ob = CommodityBase();
                 IDManager.SetID(commodityBaseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityBaseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodityBase = new CommodityBase(item);
             }
         }
     }
     
 
     XmlNodeList commodityDetailsNodeList = xmlNode.SelectNodes("commodityDetails");
     if (commodityDetailsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityDetailsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityDetailsIDRef = item.Attributes["id"].Name;
                 CommodityDetails ob = CommodityDetails();
                 IDManager.SetID(commodityDetailsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityDetailsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodityDetails = new CommodityDetails(item);
             }
         }
     }
     
 
     XmlNodeList unitNodeList = xmlNode.SelectNodes("unit");
     if (unitNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in unitNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 unitIDRef = item.Attributes["id"].Name;
                 QuantityUnit ob = QuantityUnit();
                 IDManager.SetID(unitIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 unitIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 unit = new QuantityUnit(item);
             }
         }
     }
     
 
     XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");
     if (currencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyIDRef = item.Attributes["id"].Name;
                 Currency ob = Currency();
                 IDManager.SetID(currencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency = new Currency(item);
             }
         }
     }
     
 
     XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId");
     if (exchangeIdNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeIdIDRef = item.Attributes["id"].Name;
                 ExchangeId ob = ExchangeId();
                 IDManager.SetID(exchangeIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeId = new ExchangeId(item);
             }
         }
     }
     
 
     XmlNodeList publicationNodeList = xmlNode.SelectNodes("publication");
     if (publicationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in publicationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 publicationIDRef = item.Attributes["id"].Name;
                 CommodityInformationSource ob = CommodityInformationSource();
                 IDManager.SetID(publicationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 publicationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 publication = new CommodityInformationSource(item);
             }
         }
     }
     
 
     XmlNodeList specifiedPriceNodeList = xmlNode.SelectNodes("specifiedPrice");
     if (specifiedPriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in specifiedPriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 specifiedPriceIDRef = item.Attributes["id"].Name;
                 SpecifiedPriceEnum ob = SpecifiedPriceEnum();
                 IDManager.SetID(specifiedPriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 specifiedPriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 specifiedPrice = new SpecifiedPriceEnum(item);
             }
         }
     }
     
 
     XmlNodeList deliveryDatesNodeList = xmlNode.SelectNodes("deliveryDates");
     if (deliveryDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryDatesIDRef = item.Attributes["id"].Name;
                 DeliveryDatesEnum ob = DeliveryDatesEnum();
                 IDManager.SetID(deliveryDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryDates = new DeliveryDatesEnum(item);
             }
         }
     }
     
 
     XmlNodeList deliveryDateNodeList = xmlNode.SelectNodes("deliveryDate");
     if (deliveryDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryDateIDRef = item.Attributes["id"].Name;
                 AdjustableDate ob = AdjustableDate();
                 IDManager.SetID(deliveryDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryDate = new AdjustableDate(item);
             }
         }
     }
     
 
     XmlNodeList deliveryDateYearMonthNodeList = xmlNode.SelectNodes("deliveryDateYearMonth");
     if (deliveryDateYearMonthNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryDateYearMonthNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryDateYearMonthIDRef = item.Attributes["id"].Name;
                 XsdTypeGYearMonth ob = XsdTypeGYearMonth();
                 IDManager.SetID(deliveryDateYearMonthIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryDateYearMonthIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryDateYearMonth = new XsdTypeGYearMonth(item);
             }
         }
     }
     
 
     XmlNodeList deliveryDateRollConventionNodeList = xmlNode.SelectNodes("deliveryDateRollConvention");
     if (deliveryDateRollConventionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryDateRollConventionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryDateRollConventionIDRef = item.Attributes["id"].Name;
                 Offset ob = Offset();
                 IDManager.SetID(deliveryDateRollConventionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryDateRollConventionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryDateRollConvention = new Offset(item);
             }
         }
     }
     
 
     XmlNodeList multiplierNodeList = xmlNode.SelectNodes("multiplier");
     if (multiplierNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in multiplierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 multiplierIDRef = item.Attributes["id"].Name;
                 PositiveDecimal ob = PositiveDecimal();
                 IDManager.SetID(multiplierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 multiplierIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 multiplier = new PositiveDecimal(item);
             }
         }
     }
     
 
 }
 public Commodity(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode commodityBaseNode = xmlNode.SelectSingleNode("commodityBase");
     
     if (commodityBaseNode != null)
     {
         if (commodityBaseNode.Attributes["href"] != null || commodityBaseNode.Attributes["id"] != null) 
         {
             if (commodityBaseNode.Attributes["id"] != null) 
             {
                 commodityBaseIDRef_ = commodityBaseNode.Attributes["id"].Value;
                 CommodityBase ob = new CommodityBase(commodityBaseNode);
                 IDManager.SetID(commodityBaseIDRef_, ob);
             }
             else if (commodityBaseNode.Attributes["href"] != null)
             {
                 commodityBaseIDRef_ = commodityBaseNode.Attributes["href"].Value;
             }
             else
             {
                 commodityBase_ = new CommodityBase(commodityBaseNode);
             }
         }
         else
         {
             commodityBase_ = new CommodityBase(commodityBaseNode);
         }
     }
     
 
     XmlNode commodityDetailsNode = xmlNode.SelectSingleNode("commodityDetails");
     
     if (commodityDetailsNode != null)
     {
         if (commodityDetailsNode.Attributes["href"] != null || commodityDetailsNode.Attributes["id"] != null) 
         {
             if (commodityDetailsNode.Attributes["id"] != null) 
             {
                 commodityDetailsIDRef_ = commodityDetailsNode.Attributes["id"].Value;
                 CommodityDetails ob = new CommodityDetails(commodityDetailsNode);
                 IDManager.SetID(commodityDetailsIDRef_, ob);
             }
             else if (commodityDetailsNode.Attributes["href"] != null)
             {
                 commodityDetailsIDRef_ = commodityDetailsNode.Attributes["href"].Value;
             }
             else
             {
                 commodityDetails_ = new CommodityDetails(commodityDetailsNode);
             }
         }
         else
         {
             commodityDetails_ = new CommodityDetails(commodityDetailsNode);
         }
     }
     
 
     XmlNode unitNode = xmlNode.SelectSingleNode("unit");
     
     if (unitNode != null)
     {
         if (unitNode.Attributes["href"] != null || unitNode.Attributes["id"] != null) 
         {
             if (unitNode.Attributes["id"] != null) 
             {
                 unitIDRef_ = unitNode.Attributes["id"].Value;
                 QuantityUnit ob = new QuantityUnit(unitNode);
                 IDManager.SetID(unitIDRef_, ob);
             }
             else if (unitNode.Attributes["href"] != null)
             {
                 unitIDRef_ = unitNode.Attributes["href"].Value;
             }
             else
             {
                 unit_ = new QuantityUnit(unitNode);
             }
         }
         else
         {
             unit_ = new QuantityUnit(unitNode);
         }
     }
     
 
     XmlNode currencyNode = xmlNode.SelectSingleNode("currency");
     
     if (currencyNode != null)
     {
         if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) 
         {
             if (currencyNode.Attributes["id"] != null) 
             {
                 currencyIDRef_ = currencyNode.Attributes["id"].Value;
                 Currency ob = new Currency(currencyNode);
                 IDManager.SetID(currencyIDRef_, ob);
             }
             else if (currencyNode.Attributes["href"] != null)
             {
                 currencyIDRef_ = currencyNode.Attributes["href"].Value;
             }
             else
             {
                 currency_ = new Currency(currencyNode);
             }
         }
         else
         {
             currency_ = new Currency(currencyNode);
         }
     }
     
 
     XmlNode exchangeIdNode = xmlNode.SelectSingleNode("exchangeId");
     
     if (exchangeIdNode != null)
     {
         if (exchangeIdNode.Attributes["href"] != null || exchangeIdNode.Attributes["id"] != null) 
         {
             if (exchangeIdNode.Attributes["id"] != null) 
             {
                 exchangeIdIDRef_ = exchangeIdNode.Attributes["id"].Value;
                 ExchangeId ob = new ExchangeId(exchangeIdNode);
                 IDManager.SetID(exchangeIdIDRef_, ob);
             }
             else if (exchangeIdNode.Attributes["href"] != null)
             {
                 exchangeIdIDRef_ = exchangeIdNode.Attributes["href"].Value;
             }
             else
             {
                 exchangeId_ = new ExchangeId(exchangeIdNode);
             }
         }
         else
         {
             exchangeId_ = new ExchangeId(exchangeIdNode);
         }
     }
     
 
     XmlNode publicationNode = xmlNode.SelectSingleNode("publication");
     
     if (publicationNode != null)
     {
         if (publicationNode.Attributes["href"] != null || publicationNode.Attributes["id"] != null) 
         {
             if (publicationNode.Attributes["id"] != null) 
             {
                 publicationIDRef_ = publicationNode.Attributes["id"].Value;
                 CommodityInformationSource ob = new CommodityInformationSource(publicationNode);
                 IDManager.SetID(publicationIDRef_, ob);
             }
             else if (publicationNode.Attributes["href"] != null)
             {
                 publicationIDRef_ = publicationNode.Attributes["href"].Value;
             }
             else
             {
                 publication_ = new CommodityInformationSource(publicationNode);
             }
         }
         else
         {
             publication_ = new CommodityInformationSource(publicationNode);
         }
     }
     
 
     XmlNode specifiedPriceNode = xmlNode.SelectSingleNode("specifiedPrice");
     
     if (specifiedPriceNode != null)
     {
         if (specifiedPriceNode.Attributes["href"] != null || specifiedPriceNode.Attributes["id"] != null) 
         {
             if (specifiedPriceNode.Attributes["id"] != null) 
             {
                 specifiedPriceIDRef_ = specifiedPriceNode.Attributes["id"].Value;
                 SpecifiedPriceEnum ob = new SpecifiedPriceEnum(specifiedPriceNode);
                 IDManager.SetID(specifiedPriceIDRef_, ob);
             }
             else if (specifiedPriceNode.Attributes["href"] != null)
             {
                 specifiedPriceIDRef_ = specifiedPriceNode.Attributes["href"].Value;
             }
             else
             {
                 specifiedPrice_ = new SpecifiedPriceEnum(specifiedPriceNode);
             }
         }
         else
         {
             specifiedPrice_ = new SpecifiedPriceEnum(specifiedPriceNode);
         }
     }
     
 
     XmlNode deliveryDatesNode = xmlNode.SelectSingleNode("deliveryDates");
     
     if (deliveryDatesNode != null)
     {
         if (deliveryDatesNode.Attributes["href"] != null || deliveryDatesNode.Attributes["id"] != null) 
         {
             if (deliveryDatesNode.Attributes["id"] != null) 
             {
                 deliveryDatesIDRef_ = deliveryDatesNode.Attributes["id"].Value;
                 DeliveryDatesEnum ob = new DeliveryDatesEnum(deliveryDatesNode);
                 IDManager.SetID(deliveryDatesIDRef_, ob);
             }
             else if (deliveryDatesNode.Attributes["href"] != null)
             {
                 deliveryDatesIDRef_ = deliveryDatesNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryDates_ = new DeliveryDatesEnum(deliveryDatesNode);
             }
         }
         else
         {
             deliveryDates_ = new DeliveryDatesEnum(deliveryDatesNode);
         }
     }
     
 
     XmlNode deliveryDateNode = xmlNode.SelectSingleNode("deliveryDate");
     
     if (deliveryDateNode != null)
     {
         if (deliveryDateNode.Attributes["href"] != null || deliveryDateNode.Attributes["id"] != null) 
         {
             if (deliveryDateNode.Attributes["id"] != null) 
             {
                 deliveryDateIDRef_ = deliveryDateNode.Attributes["id"].Value;
                 AdjustableDate ob = new AdjustableDate(deliveryDateNode);
                 IDManager.SetID(deliveryDateIDRef_, ob);
             }
             else if (deliveryDateNode.Attributes["href"] != null)
             {
                 deliveryDateIDRef_ = deliveryDateNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryDate_ = new AdjustableDate(deliveryDateNode);
             }
         }
         else
         {
             deliveryDate_ = new AdjustableDate(deliveryDateNode);
         }
     }
     
 
     XmlNode deliveryDateYearMonthNode = xmlNode.SelectSingleNode("deliveryDateYearMonth");
     
     if (deliveryDateYearMonthNode != null)
     {
         if (deliveryDateYearMonthNode.Attributes["href"] != null || deliveryDateYearMonthNode.Attributes["id"] != null) 
         {
             if (deliveryDateYearMonthNode.Attributes["id"] != null) 
             {
                 deliveryDateYearMonthIDRef_ = deliveryDateYearMonthNode.Attributes["id"].Value;
                 XsdTypeGYearMonth ob = new XsdTypeGYearMonth(deliveryDateYearMonthNode);
                 IDManager.SetID(deliveryDateYearMonthIDRef_, ob);
             }
             else if (deliveryDateYearMonthNode.Attributes["href"] != null)
             {
                 deliveryDateYearMonthIDRef_ = deliveryDateYearMonthNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryDateYearMonth_ = new XsdTypeGYearMonth(deliveryDateYearMonthNode);
             }
         }
         else
         {
             deliveryDateYearMonth_ = new XsdTypeGYearMonth(deliveryDateYearMonthNode);
         }
     }
     
 
     XmlNode deliveryDateRollConventionNode = xmlNode.SelectSingleNode("deliveryDateRollConvention");
     
     if (deliveryDateRollConventionNode != null)
     {
         if (deliveryDateRollConventionNode.Attributes["href"] != null || deliveryDateRollConventionNode.Attributes["id"] != null) 
         {
             if (deliveryDateRollConventionNode.Attributes["id"] != null) 
             {
                 deliveryDateRollConventionIDRef_ = deliveryDateRollConventionNode.Attributes["id"].Value;
                 Offset ob = new Offset(deliveryDateRollConventionNode);
                 IDManager.SetID(deliveryDateRollConventionIDRef_, ob);
             }
             else if (deliveryDateRollConventionNode.Attributes["href"] != null)
             {
                 deliveryDateRollConventionIDRef_ = deliveryDateRollConventionNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryDateRollConvention_ = new Offset(deliveryDateRollConventionNode);
             }
         }
         else
         {
             deliveryDateRollConvention_ = new Offset(deliveryDateRollConventionNode);
         }
     }
     
 
     XmlNode multiplierNode = xmlNode.SelectSingleNode("multiplier");
     
     if (multiplierNode != null)
     {
         if (multiplierNode.Attributes["href"] != null || multiplierNode.Attributes["id"] != null) 
         {
             if (multiplierNode.Attributes["id"] != null) 
             {
                 multiplierIDRef_ = multiplierNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(multiplierNode);
                 IDManager.SetID(multiplierIDRef_, ob);
             }
             else if (multiplierNode.Attributes["href"] != null)
             {
                 multiplierIDRef_ = multiplierNode.Attributes["href"].Value;
             }
             else
             {
                 multiplier_ = new PositiveDecimal(multiplierNode);
             }
         }
         else
         {
             multiplier_ = new PositiveDecimal(multiplierNode);
         }
     }
     
 
 }
        public Commodity(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode commodityBaseNode = xmlNode.SelectSingleNode("commodityBase");

            if (commodityBaseNode != null)
            {
                if (commodityBaseNode.Attributes["href"] != null || commodityBaseNode.Attributes["id"] != null)
                {
                    if (commodityBaseNode.Attributes["id"] != null)
                    {
                        commodityBaseIDRef_ = commodityBaseNode.Attributes["id"].Value;
                        CommodityBase ob = new CommodityBase(commodityBaseNode);
                        IDManager.SetID(commodityBaseIDRef_, ob);
                    }
                    else if (commodityBaseNode.Attributes["href"] != null)
                    {
                        commodityBaseIDRef_ = commodityBaseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        commodityBase_ = new CommodityBase(commodityBaseNode);
                    }
                }
                else
                {
                    commodityBase_ = new CommodityBase(commodityBaseNode);
                }
            }


            XmlNode commodityDetailsNode = xmlNode.SelectSingleNode("commodityDetails");

            if (commodityDetailsNode != null)
            {
                if (commodityDetailsNode.Attributes["href"] != null || commodityDetailsNode.Attributes["id"] != null)
                {
                    if (commodityDetailsNode.Attributes["id"] != null)
                    {
                        commodityDetailsIDRef_ = commodityDetailsNode.Attributes["id"].Value;
                        CommodityDetails ob = new CommodityDetails(commodityDetailsNode);
                        IDManager.SetID(commodityDetailsIDRef_, ob);
                    }
                    else if (commodityDetailsNode.Attributes["href"] != null)
                    {
                        commodityDetailsIDRef_ = commodityDetailsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        commodityDetails_ = new CommodityDetails(commodityDetailsNode);
                    }
                }
                else
                {
                    commodityDetails_ = new CommodityDetails(commodityDetailsNode);
                }
            }


            XmlNode unitNode = xmlNode.SelectSingleNode("unit");

            if (unitNode != null)
            {
                if (unitNode.Attributes["href"] != null || unitNode.Attributes["id"] != null)
                {
                    if (unitNode.Attributes["id"] != null)
                    {
                        unitIDRef_ = unitNode.Attributes["id"].Value;
                        QuantityUnit ob = new QuantityUnit(unitNode);
                        IDManager.SetID(unitIDRef_, ob);
                    }
                    else if (unitNode.Attributes["href"] != null)
                    {
                        unitIDRef_ = unitNode.Attributes["href"].Value;
                    }
                    else
                    {
                        unit_ = new QuantityUnit(unitNode);
                    }
                }
                else
                {
                    unit_ = new QuantityUnit(unitNode);
                }
            }


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

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


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

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


            XmlNode publicationNode = xmlNode.SelectSingleNode("publication");

            if (publicationNode != null)
            {
                if (publicationNode.Attributes["href"] != null || publicationNode.Attributes["id"] != null)
                {
                    if (publicationNode.Attributes["id"] != null)
                    {
                        publicationIDRef_ = publicationNode.Attributes["id"].Value;
                        CommodityInformationSource ob = new CommodityInformationSource(publicationNode);
                        IDManager.SetID(publicationIDRef_, ob);
                    }
                    else if (publicationNode.Attributes["href"] != null)
                    {
                        publicationIDRef_ = publicationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        publication_ = new CommodityInformationSource(publicationNode);
                    }
                }
                else
                {
                    publication_ = new CommodityInformationSource(publicationNode);
                }
            }


            XmlNode specifiedPriceNode = xmlNode.SelectSingleNode("specifiedPrice");

            if (specifiedPriceNode != null)
            {
                if (specifiedPriceNode.Attributes["href"] != null || specifiedPriceNode.Attributes["id"] != null)
                {
                    if (specifiedPriceNode.Attributes["id"] != null)
                    {
                        specifiedPriceIDRef_ = specifiedPriceNode.Attributes["id"].Value;
                        SpecifiedPriceEnum ob = new SpecifiedPriceEnum(specifiedPriceNode);
                        IDManager.SetID(specifiedPriceIDRef_, ob);
                    }
                    else if (specifiedPriceNode.Attributes["href"] != null)
                    {
                        specifiedPriceIDRef_ = specifiedPriceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        specifiedPrice_ = new SpecifiedPriceEnum(specifiedPriceNode);
                    }
                }
                else
                {
                    specifiedPrice_ = new SpecifiedPriceEnum(specifiedPriceNode);
                }
            }


            XmlNode deliveryDatesNode = xmlNode.SelectSingleNode("deliveryDates");

            if (deliveryDatesNode != null)
            {
                if (deliveryDatesNode.Attributes["href"] != null || deliveryDatesNode.Attributes["id"] != null)
                {
                    if (deliveryDatesNode.Attributes["id"] != null)
                    {
                        deliveryDatesIDRef_ = deliveryDatesNode.Attributes["id"].Value;
                        DeliveryDatesEnum ob = new DeliveryDatesEnum(deliveryDatesNode);
                        IDManager.SetID(deliveryDatesIDRef_, ob);
                    }
                    else if (deliveryDatesNode.Attributes["href"] != null)
                    {
                        deliveryDatesIDRef_ = deliveryDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryDates_ = new DeliveryDatesEnum(deliveryDatesNode);
                    }
                }
                else
                {
                    deliveryDates_ = new DeliveryDatesEnum(deliveryDatesNode);
                }
            }


            XmlNode deliveryDateNode = xmlNode.SelectSingleNode("deliveryDate");

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


            XmlNode deliveryDateYearMonthNode = xmlNode.SelectSingleNode("deliveryDateYearMonth");

            if (deliveryDateYearMonthNode != null)
            {
                if (deliveryDateYearMonthNode.Attributes["href"] != null || deliveryDateYearMonthNode.Attributes["id"] != null)
                {
                    if (deliveryDateYearMonthNode.Attributes["id"] != null)
                    {
                        deliveryDateYearMonthIDRef_ = deliveryDateYearMonthNode.Attributes["id"].Value;
                        XsdTypeGYearMonth ob = new XsdTypeGYearMonth(deliveryDateYearMonthNode);
                        IDManager.SetID(deliveryDateYearMonthIDRef_, ob);
                    }
                    else if (deliveryDateYearMonthNode.Attributes["href"] != null)
                    {
                        deliveryDateYearMonthIDRef_ = deliveryDateYearMonthNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryDateYearMonth_ = new XsdTypeGYearMonth(deliveryDateYearMonthNode);
                    }
                }
                else
                {
                    deliveryDateYearMonth_ = new XsdTypeGYearMonth(deliveryDateYearMonthNode);
                }
            }


            XmlNode deliveryDateRollConventionNode = xmlNode.SelectSingleNode("deliveryDateRollConvention");

            if (deliveryDateRollConventionNode != null)
            {
                if (deliveryDateRollConventionNode.Attributes["href"] != null || deliveryDateRollConventionNode.Attributes["id"] != null)
                {
                    if (deliveryDateRollConventionNode.Attributes["id"] != null)
                    {
                        deliveryDateRollConventionIDRef_ = deliveryDateRollConventionNode.Attributes["id"].Value;
                        Offset ob = new Offset(deliveryDateRollConventionNode);
                        IDManager.SetID(deliveryDateRollConventionIDRef_, ob);
                    }
                    else if (deliveryDateRollConventionNode.Attributes["href"] != null)
                    {
                        deliveryDateRollConventionIDRef_ = deliveryDateRollConventionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryDateRollConvention_ = new Offset(deliveryDateRollConventionNode);
                    }
                }
                else
                {
                    deliveryDateRollConvention_ = new Offset(deliveryDateRollConventionNode);
                }
            }


            XmlNode multiplierNode = xmlNode.SelectSingleNode("multiplier");

            if (multiplierNode != null)
            {
                if (multiplierNode.Attributes["href"] != null || multiplierNode.Attributes["id"] != null)
                {
                    if (multiplierNode.Attributes["id"] != null)
                    {
                        multiplierIDRef_ = multiplierNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(multiplierNode);
                        IDManager.SetID(multiplierIDRef_, ob);
                    }
                    else if (multiplierNode.Attributes["href"] != null)
                    {
                        multiplierIDRef_ = multiplierNode.Attributes["href"].Value;
                    }
                    else
                    {
                        multiplier_ = new PositiveDecimal(multiplierNode);
                    }
                }
                else
                {
                    multiplier_ = new PositiveDecimal(multiplierNode);
                }
            }
        }
Esempio n. 4
0
        public Commodity(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList commodityBaseNodeList = xmlNode.SelectNodes("commodityBase");

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

            foreach (XmlNode item in commodityBaseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commodityBaseIDRef = item.Attributes["id"].Name;
                        CommodityBase ob = CommodityBase();
                        IDManager.SetID(commodityBaseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commodityBaseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commodityBase = new CommodityBase(item);
                    }
                }
            }


            XmlNodeList commodityDetailsNodeList = xmlNode.SelectNodes("commodityDetails");

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

            foreach (XmlNode item in commodityDetailsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commodityDetailsIDRef = item.Attributes["id"].Name;
                        CommodityDetails ob = CommodityDetails();
                        IDManager.SetID(commodityDetailsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commodityDetailsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commodityDetails = new CommodityDetails(item);
                    }
                }
            }


            XmlNodeList unitNodeList = xmlNode.SelectNodes("unit");

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

            foreach (XmlNode item in unitNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        unitIDRef = item.Attributes["id"].Name;
                        QuantityUnit ob = QuantityUnit();
                        IDManager.SetID(unitIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        unitIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        unit = new QuantityUnit(item);
                    }
                }
            }


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

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

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


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

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

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


            XmlNodeList publicationNodeList = xmlNode.SelectNodes("publication");

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

            foreach (XmlNode item in publicationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        publicationIDRef = item.Attributes["id"].Name;
                        CommodityInformationSource ob = CommodityInformationSource();
                        IDManager.SetID(publicationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        publicationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        publication = new CommodityInformationSource(item);
                    }
                }
            }


            XmlNodeList specifiedPriceNodeList = xmlNode.SelectNodes("specifiedPrice");

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

            foreach (XmlNode item in specifiedPriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        specifiedPriceIDRef = item.Attributes["id"].Name;
                        SpecifiedPriceEnum ob = SpecifiedPriceEnum();
                        IDManager.SetID(specifiedPriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        specifiedPriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        specifiedPrice = new SpecifiedPriceEnum(item);
                    }
                }
            }


            XmlNodeList deliveryDatesNodeList = xmlNode.SelectNodes("deliveryDates");

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

            foreach (XmlNode item in deliveryDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryDatesIDRef = item.Attributes["id"].Name;
                        DeliveryDatesEnum ob = DeliveryDatesEnum();
                        IDManager.SetID(deliveryDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryDates = new DeliveryDatesEnum(item);
                    }
                }
            }


            XmlNodeList deliveryDateNodeList = xmlNode.SelectNodes("deliveryDate");

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

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


            XmlNodeList deliveryDateYearMonthNodeList = xmlNode.SelectNodes("deliveryDateYearMonth");

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

            foreach (XmlNode item in deliveryDateYearMonthNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryDateYearMonthIDRef = item.Attributes["id"].Name;
                        XsdTypeGYearMonth ob = XsdTypeGYearMonth();
                        IDManager.SetID(deliveryDateYearMonthIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryDateYearMonthIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryDateYearMonth = new XsdTypeGYearMonth(item);
                    }
                }
            }


            XmlNodeList deliveryDateRollConventionNodeList = xmlNode.SelectNodes("deliveryDateRollConvention");

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

            foreach (XmlNode item in deliveryDateRollConventionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryDateRollConventionIDRef = item.Attributes["id"].Name;
                        Offset ob = Offset();
                        IDManager.SetID(deliveryDateRollConventionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryDateRollConventionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryDateRollConvention = new Offset(item);
                    }
                }
            }


            XmlNodeList multiplierNodeList = xmlNode.SelectNodes("multiplier");

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

            foreach (XmlNode item in multiplierNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        multiplierIDRef = item.Attributes["id"].Name;
                        PositiveDecimal ob = PositiveDecimal();
                        IDManager.SetID(multiplierIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        multiplierIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        multiplier = new PositiveDecimal(item);
                    }
                }
            }
        }