public Bond(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode issuerNameNode = xmlNode.SelectSingleNode("issuerName");
     
     if (issuerNameNode != null)
     {
         if (issuerNameNode.Attributes["href"] != null || issuerNameNode.Attributes["id"] != null) 
         {
             if (issuerNameNode.Attributes["id"] != null) 
             {
                 issuerNameIDRef_ = issuerNameNode.Attributes["id"].Value;
                 XsdTypeString ob = new XsdTypeString(issuerNameNode);
                 IDManager.SetID(issuerNameIDRef_, ob);
             }
             else if (issuerNameNode.Attributes["href"] != null)
             {
                 issuerNameIDRef_ = issuerNameNode.Attributes["href"].Value;
             }
             else
             {
                 issuerName_ = new XsdTypeString(issuerNameNode);
             }
         }
         else
         {
             issuerName_ = new XsdTypeString(issuerNameNode);
         }
     }
     
 
     XmlNode issuerPartyReferenceNode = xmlNode.SelectSingleNode("issuerPartyReference");
     
     if (issuerPartyReferenceNode != null)
     {
         if (issuerPartyReferenceNode.Attributes["href"] != null || issuerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (issuerPartyReferenceNode.Attributes["id"] != null) 
             {
                 issuerPartyReferenceIDRef_ = issuerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(issuerPartyReferenceNode);
                 IDManager.SetID(issuerPartyReferenceIDRef_, ob);
             }
             else if (issuerPartyReferenceNode.Attributes["href"] != null)
             {
                 issuerPartyReferenceIDRef_ = issuerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 issuerPartyReference_ = new PartyReference(issuerPartyReferenceNode);
             }
         }
         else
         {
             issuerPartyReference_ = new PartyReference(issuerPartyReferenceNode);
         }
     }
     
 
     XmlNode seniorityNode = xmlNode.SelectSingleNode("seniority");
     
     if (seniorityNode != null)
     {
         if (seniorityNode.Attributes["href"] != null || seniorityNode.Attributes["id"] != null) 
         {
             if (seniorityNode.Attributes["id"] != null) 
             {
                 seniorityIDRef_ = seniorityNode.Attributes["id"].Value;
                 CreditSeniority ob = new CreditSeniority(seniorityNode);
                 IDManager.SetID(seniorityIDRef_, ob);
             }
             else if (seniorityNode.Attributes["href"] != null)
             {
                 seniorityIDRef_ = seniorityNode.Attributes["href"].Value;
             }
             else
             {
                 seniority_ = new CreditSeniority(seniorityNode);
             }
         }
         else
         {
             seniority_ = new CreditSeniority(seniorityNode);
         }
     }
     
 
     XmlNode couponTypeNode = xmlNode.SelectSingleNode("couponType");
     
     if (couponTypeNode != null)
     {
         if (couponTypeNode.Attributes["href"] != null || couponTypeNode.Attributes["id"] != null) 
         {
             if (couponTypeNode.Attributes["id"] != null) 
             {
                 couponTypeIDRef_ = couponTypeNode.Attributes["id"].Value;
                 CouponType ob = new CouponType(couponTypeNode);
                 IDManager.SetID(couponTypeIDRef_, ob);
             }
             else if (couponTypeNode.Attributes["href"] != null)
             {
                 couponTypeIDRef_ = couponTypeNode.Attributes["href"].Value;
             }
             else
             {
                 couponType_ = new CouponType(couponTypeNode);
             }
         }
         else
         {
             couponType_ = new CouponType(couponTypeNode);
         }
     }
     
 
     XmlNode couponRateNode = xmlNode.SelectSingleNode("couponRate");
     
     if (couponRateNode != null)
     {
         if (couponRateNode.Attributes["href"] != null || couponRateNode.Attributes["id"] != null) 
         {
             if (couponRateNode.Attributes["id"] != null) 
             {
                 couponRateIDRef_ = couponRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(couponRateNode);
                 IDManager.SetID(couponRateIDRef_, ob);
             }
             else if (couponRateNode.Attributes["href"] != null)
             {
                 couponRateIDRef_ = couponRateNode.Attributes["href"].Value;
             }
             else
             {
                 couponRate_ = new XsdTypeDecimal(couponRateNode);
             }
         }
         else
         {
             couponRate_ = new XsdTypeDecimal(couponRateNode);
         }
     }
     
 
     XmlNode maturityNode = xmlNode.SelectSingleNode("maturity");
     
     if (maturityNode != null)
     {
         if (maturityNode.Attributes["href"] != null || maturityNode.Attributes["id"] != null) 
         {
             if (maturityNode.Attributes["id"] != null) 
             {
                 maturityIDRef_ = maturityNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(maturityNode);
                 IDManager.SetID(maturityIDRef_, ob);
             }
             else if (maturityNode.Attributes["href"] != null)
             {
                 maturityIDRef_ = maturityNode.Attributes["href"].Value;
             }
             else
             {
                 maturity_ = new XsdTypeDate(maturityNode);
             }
         }
         else
         {
             maturity_ = new XsdTypeDate(maturityNode);
         }
     }
     
 
     XmlNode parValueNode = xmlNode.SelectSingleNode("parValue");
     
     if (parValueNode != null)
     {
         if (parValueNode.Attributes["href"] != null || parValueNode.Attributes["id"] != null) 
         {
             if (parValueNode.Attributes["id"] != null) 
             {
                 parValueIDRef_ = parValueNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(parValueNode);
                 IDManager.SetID(parValueIDRef_, ob);
             }
             else if (parValueNode.Attributes["href"] != null)
             {
                 parValueIDRef_ = parValueNode.Attributes["href"].Value;
             }
             else
             {
                 parValue_ = new XsdTypeDecimal(parValueNode);
             }
         }
         else
         {
             parValue_ = new XsdTypeDecimal(parValueNode);
         }
     }
     
 
     XmlNode faceAmountNode = xmlNode.SelectSingleNode("faceAmount");
     
     if (faceAmountNode != null)
     {
         if (faceAmountNode.Attributes["href"] != null || faceAmountNode.Attributes["id"] != null) 
         {
             if (faceAmountNode.Attributes["id"] != null) 
             {
                 faceAmountIDRef_ = faceAmountNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(faceAmountNode);
                 IDManager.SetID(faceAmountIDRef_, ob);
             }
             else if (faceAmountNode.Attributes["href"] != null)
             {
                 faceAmountIDRef_ = faceAmountNode.Attributes["href"].Value;
             }
             else
             {
                 faceAmount_ = new XsdTypeDecimal(faceAmountNode);
             }
         }
         else
         {
             faceAmount_ = new XsdTypeDecimal(faceAmountNode);
         }
     }
     
 
     XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");
     
     if (paymentFrequencyNode != null)
     {
         if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null) 
         {
             if (paymentFrequencyNode.Attributes["id"] != null) 
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                 Period ob = new Period(paymentFrequencyNode);
                 IDManager.SetID(paymentFrequencyIDRef_, ob);
             }
             else if (paymentFrequencyNode.Attributes["href"] != null)
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
             }
             else
             {
                 paymentFrequency_ = new Period(paymentFrequencyNode);
             }
         }
         else
         {
             paymentFrequency_ = new Period(paymentFrequencyNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
 }
 public Bond(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList issuerNameNodeList = xmlNode.SelectNodes("issuerName");
     if (issuerNameNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in issuerNameNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 issuerNameIDRef = item.Attributes["id"].Name;
                 XsdTypeString ob = XsdTypeString();
                 IDManager.SetID(issuerNameIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 issuerNameIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 issuerName = new XsdTypeString(item);
             }
         }
     }
     
 
     XmlNodeList issuerPartyReferenceNodeList = xmlNode.SelectNodes("issuerPartyReference");
     if (issuerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in issuerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 issuerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(issuerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 issuerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 issuerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList seniorityNodeList = xmlNode.SelectNodes("seniority");
     if (seniorityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in seniorityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 seniorityIDRef = item.Attributes["id"].Name;
                 CreditSeniority ob = CreditSeniority();
                 IDManager.SetID(seniorityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 seniorityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 seniority = new CreditSeniority(item);
             }
         }
     }
     
 
     XmlNodeList couponTypeNodeList = xmlNode.SelectNodes("couponType");
     if (couponTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in couponTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 couponTypeIDRef = item.Attributes["id"].Name;
                 CouponType ob = CouponType();
                 IDManager.SetID(couponTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 couponTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 couponType = new CouponType(item);
             }
         }
     }
     
 
     XmlNodeList couponRateNodeList = xmlNode.SelectNodes("couponRate");
     if (couponRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in couponRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 couponRateIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(couponRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 couponRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 couponRate = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList maturityNodeList = xmlNode.SelectNodes("maturity");
     if (maturityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in maturityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 maturityIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(maturityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 maturityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 maturity = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList parValueNodeList = xmlNode.SelectNodes("parValue");
     if (parValueNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in parValueNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 parValueIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(parValueIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 parValueIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 parValue = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList faceAmountNodeList = xmlNode.SelectNodes("faceAmount");
     if (faceAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in faceAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 faceAmountIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(faceAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 faceAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 faceAmount = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList paymentFrequencyNodeList = xmlNode.SelectNodes("paymentFrequency");
     if (paymentFrequencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentFrequencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentFrequencyIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(paymentFrequencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentFrequencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentFrequency = new Period(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
 }
 public Deposit(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode termNode = xmlNode.SelectSingleNode("term");
     
     if (termNode != null)
     {
         if (termNode.Attributes["href"] != null || termNode.Attributes["id"] != null) 
         {
             if (termNode.Attributes["id"] != null) 
             {
                 termIDRef_ = termNode.Attributes["id"].Value;
                 Period ob = new Period(termNode);
                 IDManager.SetID(termIDRef_, ob);
             }
             else if (termNode.Attributes["href"] != null)
             {
                 termIDRef_ = termNode.Attributes["href"].Value;
             }
             else
             {
                 term_ = new Period(termNode);
             }
         }
         else
         {
             term_ = new Period(termNode);
         }
     }
     
 
     XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");
     
     if (paymentFrequencyNode != null)
     {
         if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null) 
         {
             if (paymentFrequencyNode.Attributes["id"] != null) 
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                 Period ob = new Period(paymentFrequencyNode);
                 IDManager.SetID(paymentFrequencyIDRef_, ob);
             }
             else if (paymentFrequencyNode.Attributes["href"] != null)
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
             }
             else
             {
                 paymentFrequency_ = new Period(paymentFrequencyNode);
             }
         }
         else
         {
             paymentFrequency_ = new Period(paymentFrequencyNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
 }
Пример #4
0
        public InterestCalculation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }


            XmlNode compoundingNode = xmlNode.SelectSingleNode("compounding");

            if (compoundingNode != null)
            {
                if (compoundingNode.Attributes["href"] != null || compoundingNode.Attributes["id"] != null)
                {
                    if (compoundingNode.Attributes["id"] != null)
                    {
                        compoundingIDRef_ = compoundingNode.Attributes["id"].Value;
                        Compounding ob = new Compounding(compoundingNode);
                        IDManager.SetID(compoundingIDRef_, ob);
                    }
                    else if (compoundingNode.Attributes["href"] != null)
                    {
                        compoundingIDRef_ = compoundingNode.Attributes["href"].Value;
                    }
                    else
                    {
                        compounding_ = new Compounding(compoundingNode);
                    }
                }
                else
                {
                    compounding_ = new Compounding(compoundingNode);
                }
            }


            XmlNode interpolationMethodNode = xmlNode.SelectSingleNode("interpolationMethod");

            if (interpolationMethodNode != null)
            {
                if (interpolationMethodNode.Attributes["href"] != null || interpolationMethodNode.Attributes["id"] != null)
                {
                    if (interpolationMethodNode.Attributes["id"] != null)
                    {
                        interpolationMethodIDRef_ = interpolationMethodNode.Attributes["id"].Value;
                        InterpolationMethod ob = new InterpolationMethod(interpolationMethodNode);
                        IDManager.SetID(interpolationMethodIDRef_, ob);
                    }
                    else if (interpolationMethodNode.Attributes["href"] != null)
                    {
                        interpolationMethodIDRef_ = interpolationMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        interpolationMethod_ = new InterpolationMethod(interpolationMethodNode);
                    }
                }
                else
                {
                    interpolationMethod_ = new InterpolationMethod(interpolationMethodNode);
                }
            }


            XmlNode interpolationPeriodNode = xmlNode.SelectSingleNode("interpolationPeriod");

            if (interpolationPeriodNode != null)
            {
                if (interpolationPeriodNode.Attributes["href"] != null || interpolationPeriodNode.Attributes["id"] != null)
                {
                    if (interpolationPeriodNode.Attributes["id"] != null)
                    {
                        interpolationPeriodIDRef_ = interpolationPeriodNode.Attributes["id"].Value;
                        InterpolationPeriodEnum ob = new InterpolationPeriodEnum(interpolationPeriodNode);
                        IDManager.SetID(interpolationPeriodIDRef_, ob);
                    }
                    else if (interpolationPeriodNode.Attributes["href"] != null)
                    {
                        interpolationPeriodIDRef_ = interpolationPeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        interpolationPeriod_ = new InterpolationPeriodEnum(interpolationPeriodNode);
                    }
                }
                else
                {
                    interpolationPeriod_ = new InterpolationPeriodEnum(interpolationPeriodNode);
                }
            }
        }
Пример #5
0
        public Discounting(XmlNode xmlNode)
        {
            XmlNode discountingTypeNode = xmlNode.SelectSingleNode("discountingType");

            if (discountingTypeNode != null)
            {
                if (discountingTypeNode.Attributes["href"] != null || discountingTypeNode.Attributes["id"] != null)
                {
                    if (discountingTypeNode.Attributes["id"] != null)
                    {
                        discountingTypeIDRef_ = discountingTypeNode.Attributes["id"].Value;
                        DiscountingTypeEnum ob = new DiscountingTypeEnum(discountingTypeNode);
                        IDManager.SetID(discountingTypeIDRef_, ob);
                    }
                    else if (discountingTypeNode.Attributes["href"] != null)
                    {
                        discountingTypeIDRef_ = discountingTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        discountingType_ = new DiscountingTypeEnum(discountingTypeNode);
                    }
                }
                else
                {
                    discountingType_ = new DiscountingTypeEnum(discountingTypeNode);
                }
            }


            XmlNode discountRateNode = xmlNode.SelectSingleNode("discountRate");

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


            XmlNode discountRateDayCountFractionNode = xmlNode.SelectSingleNode("discountRateDayCountFraction");

            if (discountRateDayCountFractionNode != null)
            {
                if (discountRateDayCountFractionNode.Attributes["href"] != null || discountRateDayCountFractionNode.Attributes["id"] != null)
                {
                    if (discountRateDayCountFractionNode.Attributes["id"] != null)
                    {
                        discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(discountRateDayCountFractionNode);
                        IDManager.SetID(discountRateDayCountFractionIDRef_, ob);
                    }
                    else if (discountRateDayCountFractionNode.Attributes["href"] != null)
                    {
                        discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode);
                    }
                }
                else
                {
                    discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode);
                }
            }
        }
 public TermDeposit(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 startDateNodeList = xmlNode.SelectNodes("startDate");
     if (startDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in startDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 startDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(startDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 startDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 startDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList maturityDateNodeList = xmlNode.SelectNodes("maturityDate");
     if (maturityDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in maturityDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 maturityDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(maturityDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 maturityDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 maturityDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList tenorNameNodeList = xmlNode.SelectNodes("tenorName");
     if (tenorNameNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tenorNameNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tenorNameIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(tenorNameIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tenorNameIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 tenorName = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");
     if (tenorPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tenorPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(tenorPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tenorPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 tenorPeriod = new Period(item);
             }
         }
     }
     
 
     XmlNodeList principalNodeList = xmlNode.SelectNodes("principal");
     if (principalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in principalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 principalIDRef = item.Attributes["id"].Name;
                 PositiveMoney ob = PositiveMoney();
                 IDManager.SetID(principalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 principalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 principal = new PositiveMoney(item);
             }
         }
     }
     
 
     XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");
     if (fixedRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedRateIDRef = item.Attributes["id"].Name;
                 PositiveDecimal ob = PositiveDecimal();
                 IDManager.SetID(fixedRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedRate = new PositiveDecimal(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
     XmlNodeList featuresNodeList = xmlNode.SelectNodes("features");
     if (featuresNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in featuresNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 featuresIDRef = item.Attributes["id"].Name;
                 TermDepositFeatures ob = TermDepositFeatures();
                 IDManager.SetID(featuresIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 featuresIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 features = new TermDepositFeatures(item);
             }
         }
     }
     
 
     XmlNodeList interestNodeList = xmlNode.SelectNodes("interest");
     if (interestNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in interestNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 interestIDRef = item.Attributes["id"].Name;
                 Money ob = Money();
                 IDManager.SetID(interestIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 interestIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 interest = new Money(item);
             }
         }
     }
     
 
     XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");
     
     foreach (XmlNode item in paymentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentIDRef = item.Attributes["id"].Name;
                 List<Payment> ob = new List<Payment>();
                 ob.Add(new Payment(item));
                 IDManager.SetID(paymentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentIDRef = item.Attributes["href"].Name;
             }
             else
             {
             payment.Add(new Payment(item));
             }
         }
     }
     
 
 }
Пример #7
0
        public Fra(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

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


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

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


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

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


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

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


            XmlNodeList adjustedEffectiveDateNodeList = xmlNode.SelectNodes("adjustedEffectiveDate");

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

            foreach (XmlNode item in adjustedEffectiveDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        adjustedEffectiveDateIDRef = item.Attributes["id"].Name;
                        RequiredIdentifierDate ob = RequiredIdentifierDate();
                        IDManager.SetID(adjustedEffectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        adjustedEffectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        adjustedEffectiveDate = new RequiredIdentifierDate(item);
                    }
                }
            }


            XmlNodeList adjustedTerminationDateNodeList = xmlNode.SelectNodes("adjustedTerminationDate");

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

            foreach (XmlNode item in adjustedTerminationDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        adjustedTerminationDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(adjustedTerminationDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        adjustedTerminationDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        adjustedTerminationDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList paymentDateNodeList = xmlNode.SelectNodes("paymentDate");

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

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


            XmlNodeList fixingDateOffsetNodeList = xmlNode.SelectNodes("fixingDateOffset");

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

            foreach (XmlNode item in fixingDateOffsetNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixingDateOffsetIDRef = item.Attributes["id"].Name;
                        RelativeDateOffset ob = RelativeDateOffset();
                        IDManager.SetID(fixingDateOffsetIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixingDateOffsetIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixingDateOffset = new RelativeDateOffset(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }


            XmlNodeList calculationPeriodNumberOfDaysNodeList = xmlNode.SelectNodes("calculationPeriodNumberOfDays");

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

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


            XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");

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

            foreach (XmlNode item in notionalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(notionalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notional = new Money(item);
                    }
                }
            }


            XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");

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

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


            XmlNodeList floatingRateIndexNodeList = xmlNode.SelectNodes("floatingRateIndex");

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

            foreach (XmlNode item in floatingRateIndexNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        floatingRateIndexIDRef = item.Attributes["id"].Name;
                        FloatingRateIndex ob = FloatingRateIndex();
                        IDManager.SetID(floatingRateIndexIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        floatingRateIndexIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        floatingRateIndex = new FloatingRateIndex(item);
                    }
                }
            }


            XmlNodeList indexTenorNodeList = xmlNode.SelectNodes("indexTenor");

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


            XmlNodeList fraDiscountingNodeList = xmlNode.SelectNodes("fraDiscounting");

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

            foreach (XmlNode item in fraDiscountingNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fraDiscountingIDRef = item.Attributes["id"].Name;
                        FraDiscountingEnum ob = FraDiscountingEnum();
                        IDManager.SetID(fraDiscountingIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fraDiscountingIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fraDiscounting = new FraDiscountingEnum(item);
                    }
                }
            }
        }
Пример #8
0
        public Bond(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode issuerNameNode = xmlNode.SelectSingleNode("issuerName");

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


            XmlNode issuerPartyReferenceNode = xmlNode.SelectSingleNode("issuerPartyReference");

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


            XmlNode seniorityNode = xmlNode.SelectSingleNode("seniority");

            if (seniorityNode != null)
            {
                if (seniorityNode.Attributes["href"] != null || seniorityNode.Attributes["id"] != null)
                {
                    if (seniorityNode.Attributes["id"] != null)
                    {
                        seniorityIDRef_ = seniorityNode.Attributes["id"].Value;
                        CreditSeniority ob = new CreditSeniority(seniorityNode);
                        IDManager.SetID(seniorityIDRef_, ob);
                    }
                    else if (seniorityNode.Attributes["href"] != null)
                    {
                        seniorityIDRef_ = seniorityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        seniority_ = new CreditSeniority(seniorityNode);
                    }
                }
                else
                {
                    seniority_ = new CreditSeniority(seniorityNode);
                }
            }


            XmlNode couponTypeNode = xmlNode.SelectSingleNode("couponType");

            if (couponTypeNode != null)
            {
                if (couponTypeNode.Attributes["href"] != null || couponTypeNode.Attributes["id"] != null)
                {
                    if (couponTypeNode.Attributes["id"] != null)
                    {
                        couponTypeIDRef_ = couponTypeNode.Attributes["id"].Value;
                        CouponType ob = new CouponType(couponTypeNode);
                        IDManager.SetID(couponTypeIDRef_, ob);
                    }
                    else if (couponTypeNode.Attributes["href"] != null)
                    {
                        couponTypeIDRef_ = couponTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        couponType_ = new CouponType(couponTypeNode);
                    }
                }
                else
                {
                    couponType_ = new CouponType(couponTypeNode);
                }
            }


            XmlNode couponRateNode = xmlNode.SelectSingleNode("couponRate");

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


            XmlNode maturityNode = xmlNode.SelectSingleNode("maturity");

            if (maturityNode != null)
            {
                if (maturityNode.Attributes["href"] != null || maturityNode.Attributes["id"] != null)
                {
                    if (maturityNode.Attributes["id"] != null)
                    {
                        maturityIDRef_ = maturityNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(maturityNode);
                        IDManager.SetID(maturityIDRef_, ob);
                    }
                    else if (maturityNode.Attributes["href"] != null)
                    {
                        maturityIDRef_ = maturityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        maturity_ = new XsdTypeDate(maturityNode);
                    }
                }
                else
                {
                    maturity_ = new XsdTypeDate(maturityNode);
                }
            }


            XmlNode parValueNode = xmlNode.SelectSingleNode("parValue");

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


            XmlNode faceAmountNode = xmlNode.SelectSingleNode("faceAmount");

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


            XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");

            if (paymentFrequencyNode != null)
            {
                if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null)
                {
                    if (paymentFrequencyNode.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                        Period ob = new Period(paymentFrequencyNode);
                        IDManager.SetID(paymentFrequencyIDRef_, ob);
                    }
                    else if (paymentFrequencyNode.Attributes["href"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentFrequency_ = new Period(paymentFrequencyNode);
                    }
                }
                else
                {
                    paymentFrequency_ = new Period(paymentFrequencyNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }
        }
 public Discounting(XmlNode xmlNode)
 {
     XmlNode discountingTypeNode = xmlNode.SelectSingleNode("discountingType");
     
     if (discountingTypeNode != null)
     {
         if (discountingTypeNode.Attributes["href"] != null || discountingTypeNode.Attributes["id"] != null) 
         {
             if (discountingTypeNode.Attributes["id"] != null) 
             {
                 discountingTypeIDRef_ = discountingTypeNode.Attributes["id"].Value;
                 DiscountingTypeEnum ob = new DiscountingTypeEnum(discountingTypeNode);
                 IDManager.SetID(discountingTypeIDRef_, ob);
             }
             else if (discountingTypeNode.Attributes["href"] != null)
             {
                 discountingTypeIDRef_ = discountingTypeNode.Attributes["href"].Value;
             }
             else
             {
                 discountingType_ = new DiscountingTypeEnum(discountingTypeNode);
             }
         }
         else
         {
             discountingType_ = new DiscountingTypeEnum(discountingTypeNode);
         }
     }
     
 
     XmlNode discountRateNode = xmlNode.SelectSingleNode("discountRate");
     
     if (discountRateNode != null)
     {
         if (discountRateNode.Attributes["href"] != null || discountRateNode.Attributes["id"] != null) 
         {
             if (discountRateNode.Attributes["id"] != null) 
             {
                 discountRateIDRef_ = discountRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(discountRateNode);
                 IDManager.SetID(discountRateIDRef_, ob);
             }
             else if (discountRateNode.Attributes["href"] != null)
             {
                 discountRateIDRef_ = discountRateNode.Attributes["href"].Value;
             }
             else
             {
                 discountRate_ = new XsdTypeDecimal(discountRateNode);
             }
         }
         else
         {
             discountRate_ = new XsdTypeDecimal(discountRateNode);
         }
     }
     
 
     XmlNode discountRateDayCountFractionNode = xmlNode.SelectSingleNode("discountRateDayCountFraction");
     
     if (discountRateDayCountFractionNode != null)
     {
         if (discountRateDayCountFractionNode.Attributes["href"] != null || discountRateDayCountFractionNode.Attributes["id"] != null) 
         {
             if (discountRateDayCountFractionNode.Attributes["id"] != null) 
             {
                 discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(discountRateDayCountFractionNode);
                 IDManager.SetID(discountRateDayCountFractionIDRef_, ob);
             }
             else if (discountRateDayCountFractionNode.Attributes["href"] != null)
             {
                 discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode);
             }
         }
         else
         {
             discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode);
         }
     }
     
 
 }
Пример #10
0
 public Fra(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     XmlNode adjustedEffectiveDateNode = xmlNode.SelectSingleNode("adjustedEffectiveDate");
     
     if (adjustedEffectiveDateNode != null)
     {
         if (adjustedEffectiveDateNode.Attributes["href"] != null || adjustedEffectiveDateNode.Attributes["id"] != null) 
         {
             if (adjustedEffectiveDateNode.Attributes["id"] != null) 
             {
                 adjustedEffectiveDateIDRef_ = adjustedEffectiveDateNode.Attributes["id"].Value;
                 RequiredIdentifierDate ob = new RequiredIdentifierDate(adjustedEffectiveDateNode);
                 IDManager.SetID(adjustedEffectiveDateIDRef_, ob);
             }
             else if (adjustedEffectiveDateNode.Attributes["href"] != null)
             {
                 adjustedEffectiveDateIDRef_ = adjustedEffectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 adjustedEffectiveDate_ = new RequiredIdentifierDate(adjustedEffectiveDateNode);
             }
         }
         else
         {
             adjustedEffectiveDate_ = new RequiredIdentifierDate(adjustedEffectiveDateNode);
         }
     }
     
 
     XmlNode adjustedTerminationDateNode = xmlNode.SelectSingleNode("adjustedTerminationDate");
     
     if (adjustedTerminationDateNode != null)
     {
         if (adjustedTerminationDateNode.Attributes["href"] != null || adjustedTerminationDateNode.Attributes["id"] != null) 
         {
             if (adjustedTerminationDateNode.Attributes["id"] != null) 
             {
                 adjustedTerminationDateIDRef_ = adjustedTerminationDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(adjustedTerminationDateNode);
                 IDManager.SetID(adjustedTerminationDateIDRef_, ob);
             }
             else if (adjustedTerminationDateNode.Attributes["href"] != null)
             {
                 adjustedTerminationDateIDRef_ = adjustedTerminationDateNode.Attributes["href"].Value;
             }
             else
             {
                 adjustedTerminationDate_ = new XsdTypeDate(adjustedTerminationDateNode);
             }
         }
         else
         {
             adjustedTerminationDate_ = new XsdTypeDate(adjustedTerminationDateNode);
         }
     }
     
 
     XmlNode paymentDateNode = xmlNode.SelectSingleNode("paymentDate");
     
     if (paymentDateNode != null)
     {
         if (paymentDateNode.Attributes["href"] != null || paymentDateNode.Attributes["id"] != null) 
         {
             if (paymentDateNode.Attributes["id"] != null) 
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["id"].Value;
                 AdjustableDate ob = new AdjustableDate(paymentDateNode);
                 IDManager.SetID(paymentDateIDRef_, ob);
             }
             else if (paymentDateNode.Attributes["href"] != null)
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDate_ = new AdjustableDate(paymentDateNode);
             }
         }
         else
         {
             paymentDate_ = new AdjustableDate(paymentDateNode);
         }
     }
     
 
     XmlNode fixingDateOffsetNode = xmlNode.SelectSingleNode("fixingDateOffset");
     
     if (fixingDateOffsetNode != null)
     {
         if (fixingDateOffsetNode.Attributes["href"] != null || fixingDateOffsetNode.Attributes["id"] != null) 
         {
             if (fixingDateOffsetNode.Attributes["id"] != null) 
             {
                 fixingDateOffsetIDRef_ = fixingDateOffsetNode.Attributes["id"].Value;
                 RelativeDateOffset ob = new RelativeDateOffset(fixingDateOffsetNode);
                 IDManager.SetID(fixingDateOffsetIDRef_, ob);
             }
             else if (fixingDateOffsetNode.Attributes["href"] != null)
             {
                 fixingDateOffsetIDRef_ = fixingDateOffsetNode.Attributes["href"].Value;
             }
             else
             {
                 fixingDateOffset_ = new RelativeDateOffset(fixingDateOffsetNode);
             }
         }
         else
         {
             fixingDateOffset_ = new RelativeDateOffset(fixingDateOffsetNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
     XmlNode calculationPeriodNumberOfDaysNode = xmlNode.SelectSingleNode("calculationPeriodNumberOfDays");
     
     if (calculationPeriodNumberOfDaysNode != null)
     {
         if (calculationPeriodNumberOfDaysNode.Attributes["href"] != null || calculationPeriodNumberOfDaysNode.Attributes["id"] != null) 
         {
             if (calculationPeriodNumberOfDaysNode.Attributes["id"] != null) 
             {
                 calculationPeriodNumberOfDaysIDRef_ = calculationPeriodNumberOfDaysNode.Attributes["id"].Value;
                 XsdTypePositiveInteger ob = new XsdTypePositiveInteger(calculationPeriodNumberOfDaysNode);
                 IDManager.SetID(calculationPeriodNumberOfDaysIDRef_, ob);
             }
             else if (calculationPeriodNumberOfDaysNode.Attributes["href"] != null)
             {
                 calculationPeriodNumberOfDaysIDRef_ = calculationPeriodNumberOfDaysNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodNumberOfDays_ = new XsdTypePositiveInteger(calculationPeriodNumberOfDaysNode);
             }
         }
         else
         {
             calculationPeriodNumberOfDays_ = new XsdTypePositiveInteger(calculationPeriodNumberOfDaysNode);
         }
     }
     
 
     XmlNode notionalNode = xmlNode.SelectSingleNode("notional");
     
     if (notionalNode != null)
     {
         if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) 
         {
             if (notionalNode.Attributes["id"] != null) 
             {
                 notionalIDRef_ = notionalNode.Attributes["id"].Value;
                 Money ob = new Money(notionalNode);
                 IDManager.SetID(notionalIDRef_, ob);
             }
             else if (notionalNode.Attributes["href"] != null)
             {
                 notionalIDRef_ = notionalNode.Attributes["href"].Value;
             }
             else
             {
                 notional_ = new Money(notionalNode);
             }
         }
         else
         {
             notional_ = new Money(notionalNode);
         }
     }
     
 
     XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");
     
     if (fixedRateNode != null)
     {
         if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null) 
         {
             if (fixedRateNode.Attributes["id"] != null) 
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(fixedRateNode);
                 IDManager.SetID(fixedRateIDRef_, ob);
             }
             else if (fixedRateNode.Attributes["href"] != null)
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
             }
             else
             {
                 fixedRate_ = new XsdTypeDecimal(fixedRateNode);
             }
         }
         else
         {
             fixedRate_ = new XsdTypeDecimal(fixedRateNode);
         }
     }
     
 
     XmlNode floatingRateIndexNode = xmlNode.SelectSingleNode("floatingRateIndex");
     
     if (floatingRateIndexNode != null)
     {
         if (floatingRateIndexNode.Attributes["href"] != null || floatingRateIndexNode.Attributes["id"] != null) 
         {
             if (floatingRateIndexNode.Attributes["id"] != null) 
             {
                 floatingRateIndexIDRef_ = floatingRateIndexNode.Attributes["id"].Value;
                 FloatingRateIndex ob = new FloatingRateIndex(floatingRateIndexNode);
                 IDManager.SetID(floatingRateIndexIDRef_, ob);
             }
             else if (floatingRateIndexNode.Attributes["href"] != null)
             {
                 floatingRateIndexIDRef_ = floatingRateIndexNode.Attributes["href"].Value;
             }
             else
             {
                 floatingRateIndex_ = new FloatingRateIndex(floatingRateIndexNode);
             }
         }
         else
         {
             floatingRateIndex_ = new FloatingRateIndex(floatingRateIndexNode);
         }
     }
     
 
     XmlNodeList indexTenorNodeList = xmlNode.SelectNodes("indexTenor");
     
     if (indexTenorNodeList != null)
     {
         this.indexTenor_ = new List<Period>();
         foreach (XmlNode item in indexTenorNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     indexTenorIDRef_ = item.Attributes["id"].Value;
                     indexTenor_.Add(new Period(item));
                     IDManager.SetID(indexTenorIDRef_, indexTenor_[indexTenor_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     indexTenorIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 indexTenor_.Add(new Period(item));
                 }
             }
             else
             {
                 indexTenor_.Add(new Period(item));
             }
         }
     }
     
 
     XmlNode fraDiscountingNode = xmlNode.SelectSingleNode("fraDiscounting");
     
     if (fraDiscountingNode != null)
     {
         if (fraDiscountingNode.Attributes["href"] != null || fraDiscountingNode.Attributes["id"] != null) 
         {
             if (fraDiscountingNode.Attributes["id"] != null) 
             {
                 fraDiscountingIDRef_ = fraDiscountingNode.Attributes["id"].Value;
                 FraDiscountingEnum ob = new FraDiscountingEnum(fraDiscountingNode);
                 IDManager.SetID(fraDiscountingIDRef_, ob);
             }
             else if (fraDiscountingNode.Attributes["href"] != null)
             {
                 fraDiscountingIDRef_ = fraDiscountingNode.Attributes["href"].Value;
             }
             else
             {
                 fraDiscounting_ = new FraDiscountingEnum(fraDiscountingNode);
             }
         }
         else
         {
             fraDiscounting_ = new FraDiscountingEnum(fraDiscountingNode);
         }
     }
     
 
 }
Пример #11
0
        public Fra(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");

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


            XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");

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


            XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");

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


            XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");

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


            XmlNode adjustedEffectiveDateNode = xmlNode.SelectSingleNode("adjustedEffectiveDate");

            if (adjustedEffectiveDateNode != null)
            {
                if (adjustedEffectiveDateNode.Attributes["href"] != null || adjustedEffectiveDateNode.Attributes["id"] != null)
                {
                    if (adjustedEffectiveDateNode.Attributes["id"] != null)
                    {
                        adjustedEffectiveDateIDRef_ = adjustedEffectiveDateNode.Attributes["id"].Value;
                        RequiredIdentifierDate ob = new RequiredIdentifierDate(adjustedEffectiveDateNode);
                        IDManager.SetID(adjustedEffectiveDateIDRef_, ob);
                    }
                    else if (adjustedEffectiveDateNode.Attributes["href"] != null)
                    {
                        adjustedEffectiveDateIDRef_ = adjustedEffectiveDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        adjustedEffectiveDate_ = new RequiredIdentifierDate(adjustedEffectiveDateNode);
                    }
                }
                else
                {
                    adjustedEffectiveDate_ = new RequiredIdentifierDate(adjustedEffectiveDateNode);
                }
            }


            XmlNode adjustedTerminationDateNode = xmlNode.SelectSingleNode("adjustedTerminationDate");

            if (adjustedTerminationDateNode != null)
            {
                if (adjustedTerminationDateNode.Attributes["href"] != null || adjustedTerminationDateNode.Attributes["id"] != null)
                {
                    if (adjustedTerminationDateNode.Attributes["id"] != null)
                    {
                        adjustedTerminationDateIDRef_ = adjustedTerminationDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(adjustedTerminationDateNode);
                        IDManager.SetID(adjustedTerminationDateIDRef_, ob);
                    }
                    else if (adjustedTerminationDateNode.Attributes["href"] != null)
                    {
                        adjustedTerminationDateIDRef_ = adjustedTerminationDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        adjustedTerminationDate_ = new XsdTypeDate(adjustedTerminationDateNode);
                    }
                }
                else
                {
                    adjustedTerminationDate_ = new XsdTypeDate(adjustedTerminationDateNode);
                }
            }


            XmlNode paymentDateNode = xmlNode.SelectSingleNode("paymentDate");

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


            XmlNode fixingDateOffsetNode = xmlNode.SelectSingleNode("fixingDateOffset");

            if (fixingDateOffsetNode != null)
            {
                if (fixingDateOffsetNode.Attributes["href"] != null || fixingDateOffsetNode.Attributes["id"] != null)
                {
                    if (fixingDateOffsetNode.Attributes["id"] != null)
                    {
                        fixingDateOffsetIDRef_ = fixingDateOffsetNode.Attributes["id"].Value;
                        RelativeDateOffset ob = new RelativeDateOffset(fixingDateOffsetNode);
                        IDManager.SetID(fixingDateOffsetIDRef_, ob);
                    }
                    else if (fixingDateOffsetNode.Attributes["href"] != null)
                    {
                        fixingDateOffsetIDRef_ = fixingDateOffsetNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixingDateOffset_ = new RelativeDateOffset(fixingDateOffsetNode);
                    }
                }
                else
                {
                    fixingDateOffset_ = new RelativeDateOffset(fixingDateOffsetNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }


            XmlNode calculationPeriodNumberOfDaysNode = xmlNode.SelectSingleNode("calculationPeriodNumberOfDays");

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


            XmlNode notionalNode = xmlNode.SelectSingleNode("notional");

            if (notionalNode != null)
            {
                if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null)
                {
                    if (notionalNode.Attributes["id"] != null)
                    {
                        notionalIDRef_ = notionalNode.Attributes["id"].Value;
                        Money ob = new Money(notionalNode);
                        IDManager.SetID(notionalIDRef_, ob);
                    }
                    else if (notionalNode.Attributes["href"] != null)
                    {
                        notionalIDRef_ = notionalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        notional_ = new Money(notionalNode);
                    }
                }
                else
                {
                    notional_ = new Money(notionalNode);
                }
            }


            XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");

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


            XmlNode floatingRateIndexNode = xmlNode.SelectSingleNode("floatingRateIndex");

            if (floatingRateIndexNode != null)
            {
                if (floatingRateIndexNode.Attributes["href"] != null || floatingRateIndexNode.Attributes["id"] != null)
                {
                    if (floatingRateIndexNode.Attributes["id"] != null)
                    {
                        floatingRateIndexIDRef_ = floatingRateIndexNode.Attributes["id"].Value;
                        FloatingRateIndex ob = new FloatingRateIndex(floatingRateIndexNode);
                        IDManager.SetID(floatingRateIndexIDRef_, ob);
                    }
                    else if (floatingRateIndexNode.Attributes["href"] != null)
                    {
                        floatingRateIndexIDRef_ = floatingRateIndexNode.Attributes["href"].Value;
                    }
                    else
                    {
                        floatingRateIndex_ = new FloatingRateIndex(floatingRateIndexNode);
                    }
                }
                else
                {
                    floatingRateIndex_ = new FloatingRateIndex(floatingRateIndexNode);
                }
            }


            XmlNodeList indexTenorNodeList = xmlNode.SelectNodes("indexTenor");

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


            XmlNode fraDiscountingNode = xmlNode.SelectSingleNode("fraDiscounting");

            if (fraDiscountingNode != null)
            {
                if (fraDiscountingNode.Attributes["href"] != null || fraDiscountingNode.Attributes["id"] != null)
                {
                    if (fraDiscountingNode.Attributes["id"] != null)
                    {
                        fraDiscountingIDRef_ = fraDiscountingNode.Attributes["id"].Value;
                        FraDiscountingEnum ob = new FraDiscountingEnum(fraDiscountingNode);
                        IDManager.SetID(fraDiscountingIDRef_, ob);
                    }
                    else if (fraDiscountingNode.Attributes["href"] != null)
                    {
                        fraDiscountingIDRef_ = fraDiscountingNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fraDiscounting_ = new FraDiscountingEnum(fraDiscountingNode);
                    }
                }
                else
                {
                    fraDiscounting_ = new FraDiscountingEnum(fraDiscountingNode);
                }
            }
        }
Пример #12
0
        public TermDeposit(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 startDateNode = xmlNode.SelectSingleNode("startDate");

            if (startDateNode != null)
            {
                if (startDateNode.Attributes["href"] != null || startDateNode.Attributes["id"] != null)
                {
                    if (startDateNode.Attributes["id"] != null)
                    {
                        startDateIDRef_ = startDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(startDateNode);
                        IDManager.SetID(startDateIDRef_, ob);
                    }
                    else if (startDateNode.Attributes["href"] != null)
                    {
                        startDateIDRef_ = startDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        startDate_ = new XsdTypeDate(startDateNode);
                    }
                }
                else
                {
                    startDate_ = new XsdTypeDate(startDateNode);
                }
            }


            XmlNode maturityDateNode = xmlNode.SelectSingleNode("maturityDate");

            if (maturityDateNode != null)
            {
                if (maturityDateNode.Attributes["href"] != null || maturityDateNode.Attributes["id"] != null)
                {
                    if (maturityDateNode.Attributes["id"] != null)
                    {
                        maturityDateIDRef_ = maturityDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(maturityDateNode);
                        IDManager.SetID(maturityDateIDRef_, ob);
                    }
                    else if (maturityDateNode.Attributes["href"] != null)
                    {
                        maturityDateIDRef_ = maturityDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        maturityDate_ = new XsdTypeDate(maturityDateNode);
                    }
                }
                else
                {
                    maturityDate_ = new XsdTypeDate(maturityDateNode);
                }
            }


            XmlNode tenorNameNode = xmlNode.SelectSingleNode("tenorName");

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


            XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");

            if (tenorPeriodNode != null)
            {
                if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null)
                {
                    if (tenorPeriodNode.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                        Period ob = new Period(tenorPeriodNode);
                        IDManager.SetID(tenorPeriodIDRef_, ob);
                    }
                    else if (tenorPeriodNode.Attributes["href"] != null)
                    {
                        tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        tenorPeriod_ = new Period(tenorPeriodNode);
                    }
                }
                else
                {
                    tenorPeriod_ = new Period(tenorPeriodNode);
                }
            }


            XmlNode principalNode = xmlNode.SelectSingleNode("principal");

            if (principalNode != null)
            {
                if (principalNode.Attributes["href"] != null || principalNode.Attributes["id"] != null)
                {
                    if (principalNode.Attributes["id"] != null)
                    {
                        principalIDRef_ = principalNode.Attributes["id"].Value;
                        PositiveMoney ob = new PositiveMoney(principalNode);
                        IDManager.SetID(principalIDRef_, ob);
                    }
                    else if (principalNode.Attributes["href"] != null)
                    {
                        principalIDRef_ = principalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        principal_ = new PositiveMoney(principalNode);
                    }
                }
                else
                {
                    principal_ = new PositiveMoney(principalNode);
                }
            }


            XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");

            if (fixedRateNode != null)
            {
                if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null)
                {
                    if (fixedRateNode.Attributes["id"] != null)
                    {
                        fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(fixedRateNode);
                        IDManager.SetID(fixedRateIDRef_, ob);
                    }
                    else if (fixedRateNode.Attributes["href"] != null)
                    {
                        fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixedRate_ = new PositiveDecimal(fixedRateNode);
                    }
                }
                else
                {
                    fixedRate_ = new PositiveDecimal(fixedRateNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }


            XmlNode featuresNode = xmlNode.SelectSingleNode("features");

            if (featuresNode != null)
            {
                if (featuresNode.Attributes["href"] != null || featuresNode.Attributes["id"] != null)
                {
                    if (featuresNode.Attributes["id"] != null)
                    {
                        featuresIDRef_ = featuresNode.Attributes["id"].Value;
                        TermDepositFeatures ob = new TermDepositFeatures(featuresNode);
                        IDManager.SetID(featuresIDRef_, ob);
                    }
                    else if (featuresNode.Attributes["href"] != null)
                    {
                        featuresIDRef_ = featuresNode.Attributes["href"].Value;
                    }
                    else
                    {
                        features_ = new TermDepositFeatures(featuresNode);
                    }
                }
                else
                {
                    features_ = new TermDepositFeatures(featuresNode);
                }
            }


            XmlNode interestNode = xmlNode.SelectSingleNode("interest");

            if (interestNode != null)
            {
                if (interestNode.Attributes["href"] != null || interestNode.Attributes["id"] != null)
                {
                    if (interestNode.Attributes["id"] != null)
                    {
                        interestIDRef_ = interestNode.Attributes["id"].Value;
                        Money ob = new Money(interestNode);
                        IDManager.SetID(interestIDRef_, ob);
                    }
                    else if (interestNode.Attributes["href"] != null)
                    {
                        interestIDRef_ = interestNode.Attributes["href"].Value;
                    }
                    else
                    {
                        interest_ = new Money(interestNode);
                    }
                }
                else
                {
                    interest_ = new Money(interestNode);
                }
            }


            XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");

            if (paymentNodeList != null)
            {
                this.payment_ = new List <Payment>();
                foreach (XmlNode item in paymentNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            paymentIDRef_ = item.Attributes["id"].Value;
                            payment_.Add(new Payment(item));
                            IDManager.SetID(paymentIDRef_, payment_[payment_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            paymentIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            payment_.Add(new Payment(item));
                        }
                    }
                    else
                    {
                        payment_.Add(new Payment(item));
                    }
                }
            }
        }
 public Calculation(XmlNode xmlNode)
 {
     XmlNodeList notionalScheduleNodeList = xmlNode.SelectNodes("notionalSchedule");
     if (notionalScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalScheduleIDRef = item.Attributes["id"].Name;
                 Notional ob = Notional();
                 IDManager.SetID(notionalScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalSchedule = new Notional(item);
             }
         }
     }
     
 
     XmlNodeList fxLinkedNotionalScheduleNodeList = xmlNode.SelectNodes("fxLinkedNotionalSchedule");
     if (fxLinkedNotionalScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxLinkedNotionalScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxLinkedNotionalScheduleIDRef = item.Attributes["id"].Name;
                 FxLinkedNotionalSchedule ob = FxLinkedNotionalSchedule();
                 IDManager.SetID(fxLinkedNotionalScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxLinkedNotionalScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fxLinkedNotionalSchedule = new FxLinkedNotionalSchedule(item);
             }
         }
     }
     
 
     XmlNodeList fixedRateScheduleNodeList = xmlNode.SelectNodes("fixedRateSchedule");
     if (fixedRateScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedRateScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedRateScheduleIDRef = item.Attributes["id"].Name;
                 Schedule ob = Schedule();
                 IDManager.SetID(fixedRateScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedRateScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedRateSchedule = new Schedule(item);
             }
         }
     }
     
 
     XmlNodeList futureValueNotionalNodeList = xmlNode.SelectNodes("futureValueNotional");
     if (futureValueNotionalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in futureValueNotionalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 futureValueNotionalIDRef = item.Attributes["id"].Name;
                 FutureValueAmount ob = FutureValueAmount();
                 IDManager.SetID(futureValueNotionalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 futureValueNotionalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 futureValueNotional = new FutureValueAmount(item);
             }
         }
     }
     
 
     XmlNodeList rateCalculationNodeList = xmlNode.SelectNodes("rateCalculation");
     if (rateCalculationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in rateCalculationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 rateCalculationIDRef = item.Attributes["id"].Name;
                 Rate ob = Rate();
                 IDManager.SetID(rateCalculationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 rateCalculationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 rateCalculation = new Rate(item);
             }
         }
     }
     
 
     XmlNodeList floatingRateCalculationNodeList = xmlNode.SelectNodes("floatingRateCalculation");
     if (floatingRateCalculationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingRateCalculationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingRateCalculationIDRef = item.Attributes["id"].Name;
                 FloatingRateCalculation ob = FloatingRateCalculation();
                 IDManager.SetID(floatingRateCalculationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingRateCalculationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingRateCalculation = new FloatingRateCalculation(item);
             }
         }
     }
     
 
     XmlNodeList inflationRateCalculationNodeList = xmlNode.SelectNodes("inflationRateCalculation");
     if (inflationRateCalculationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in inflationRateCalculationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 inflationRateCalculationIDRef = item.Attributes["id"].Name;
                 InflationRateCalculation ob = InflationRateCalculation();
                 IDManager.SetID(inflationRateCalculationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 inflationRateCalculationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 inflationRateCalculation = new InflationRateCalculation(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
     XmlNodeList discountingNodeList = xmlNode.SelectNodes("discounting");
     if (discountingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in discountingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 discountingIDRef = item.Attributes["id"].Name;
                 Discounting ob = Discounting();
                 IDManager.SetID(discountingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 discountingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 discounting = new Discounting(item);
             }
         }
     }
     
 
     XmlNodeList compoundingMethodNodeList = xmlNode.SelectNodes("compoundingMethod");
     if (compoundingMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in compoundingMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 compoundingMethodIDRef = item.Attributes["id"].Name;
                 CompoundingMethodEnum ob = CompoundingMethodEnum();
                 IDManager.SetID(compoundingMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 compoundingMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 compoundingMethod = new CompoundingMethodEnum(item);
             }
         }
     }
     
 
 }
 public FixedAmountCalculation(XmlNode xmlNode)
 {
     XmlNode calculationAmountNode = xmlNode.SelectSingleNode("calculationAmount");
     
     if (calculationAmountNode != null)
     {
         if (calculationAmountNode.Attributes["href"] != null || calculationAmountNode.Attributes["id"] != null) 
         {
             if (calculationAmountNode.Attributes["id"] != null) 
             {
                 calculationAmountIDRef_ = calculationAmountNode.Attributes["id"].Value;
                 CalculationAmount ob = new CalculationAmount(calculationAmountNode);
                 IDManager.SetID(calculationAmountIDRef_, ob);
             }
             else if (calculationAmountNode.Attributes["href"] != null)
             {
                 calculationAmountIDRef_ = calculationAmountNode.Attributes["href"].Value;
             }
             else
             {
                 calculationAmount_ = new CalculationAmount(calculationAmountNode);
             }
         }
         else
         {
             calculationAmount_ = new CalculationAmount(calculationAmountNode);
         }
     }
     
 
     XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");
     
     if (fixedRateNode != null)
     {
         if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null) 
         {
             if (fixedRateNode.Attributes["id"] != null) 
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                 FixedRate ob = new FixedRate(fixedRateNode);
                 IDManager.SetID(fixedRateIDRef_, ob);
             }
             else if (fixedRateNode.Attributes["href"] != null)
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
             }
             else
             {
                 fixedRate_ = new FixedRate(fixedRateNode);
             }
         }
         else
         {
             fixedRate_ = new FixedRate(fixedRateNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
 }
 public InterestCalculation(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
     XmlNodeList compoundingNodeList = xmlNode.SelectNodes("compounding");
     if (compoundingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in compoundingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 compoundingIDRef = item.Attributes["id"].Name;
                 Compounding ob = Compounding();
                 IDManager.SetID(compoundingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 compoundingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 compounding = new Compounding(item);
             }
         }
     }
     
 
     XmlNodeList interpolationMethodNodeList = xmlNode.SelectNodes("interpolationMethod");
     if (interpolationMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in interpolationMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 interpolationMethodIDRef = item.Attributes["id"].Name;
                 InterpolationMethod ob = InterpolationMethod();
                 IDManager.SetID(interpolationMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 interpolationMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 interpolationMethod = new InterpolationMethod(item);
             }
         }
     }
     
 
     XmlNodeList interpolationPeriodNodeList = xmlNode.SelectNodes("interpolationPeriod");
     if (interpolationPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in interpolationPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 interpolationPeriodIDRef = item.Attributes["id"].Name;
                 InterpolationPeriodEnum ob = InterpolationPeriodEnum();
                 IDManager.SetID(interpolationPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 interpolationPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 interpolationPeriod = new InterpolationPeriodEnum(item);
             }
         }
     }
     
 
 }
 public RateIndex(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList floatingRateIndexNodeList = xmlNode.SelectNodes("floatingRateIndex");
     if (floatingRateIndexNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingRateIndexNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingRateIndexIDRef = item.Attributes["id"].Name;
                 FloatingRateIndex ob = FloatingRateIndex();
                 IDManager.SetID(floatingRateIndexIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingRateIndexIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingRateIndex = new FloatingRateIndex(item);
             }
         }
     }
     
 
     XmlNodeList termNodeList = xmlNode.SelectNodes("term");
     if (termNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in termNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 termIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(termIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 termIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 term = new Period(item);
             }
         }
     }
     
 
     XmlNodeList paymentFrequencyNodeList = xmlNode.SelectNodes("paymentFrequency");
     if (paymentFrequencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentFrequencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentFrequencyIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(paymentFrequencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentFrequencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentFrequency = new Period(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
 }
        public InterestCalculation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }


            XmlNodeList compoundingNodeList = xmlNode.SelectNodes("compounding");

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

            foreach (XmlNode item in compoundingNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        compoundingIDRef = item.Attributes["id"].Name;
                        Compounding ob = Compounding();
                        IDManager.SetID(compoundingIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        compoundingIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        compounding = new Compounding(item);
                    }
                }
            }


            XmlNodeList interpolationMethodNodeList = xmlNode.SelectNodes("interpolationMethod");

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

            foreach (XmlNode item in interpolationMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        interpolationMethodIDRef = item.Attributes["id"].Name;
                        InterpolationMethod ob = InterpolationMethod();
                        IDManager.SetID(interpolationMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        interpolationMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        interpolationMethod = new InterpolationMethod(item);
                    }
                }
            }


            XmlNodeList interpolationPeriodNodeList = xmlNode.SelectNodes("interpolationPeriod");

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

            foreach (XmlNode item in interpolationPeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        interpolationPeriodIDRef = item.Attributes["id"].Name;
                        InterpolationPeriodEnum ob = InterpolationPeriodEnum();
                        IDManager.SetID(interpolationPeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        interpolationPeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        interpolationPeriod = new InterpolationPeriodEnum(item);
                    }
                }
            }
        }
        public RateIndex(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList floatingRateIndexNodeList = xmlNode.SelectNodes("floatingRateIndex");

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

            foreach (XmlNode item in floatingRateIndexNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        floatingRateIndexIDRef = item.Attributes["id"].Name;
                        FloatingRateIndex ob = FloatingRateIndex();
                        IDManager.SetID(floatingRateIndexIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        floatingRateIndexIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        floatingRateIndex = new FloatingRateIndex(item);
                    }
                }
            }


            XmlNodeList termNodeList = xmlNode.SelectNodes("term");

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

            foreach (XmlNode item in termNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        termIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(termIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        termIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        term = new Period(item);
                    }
                }
            }


            XmlNodeList paymentFrequencyNodeList = xmlNode.SelectNodes("paymentFrequency");

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

            foreach (XmlNode item in paymentFrequencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(paymentFrequencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentFrequencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentFrequency = new Period(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }
        }
Пример #19
0
        public SimpleFra(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode startTermNode = xmlNode.SelectSingleNode("startTerm");

            if (startTermNode != null)
            {
                if (startTermNode.Attributes["href"] != null || startTermNode.Attributes["id"] != null)
                {
                    if (startTermNode.Attributes["id"] != null)
                    {
                        startTermIDRef_ = startTermNode.Attributes["id"].Value;
                        Period ob = new Period(startTermNode);
                        IDManager.SetID(startTermIDRef_, ob);
                    }
                    else if (startTermNode.Attributes["href"] != null)
                    {
                        startTermIDRef_ = startTermNode.Attributes["href"].Value;
                    }
                    else
                    {
                        startTerm_ = new Period(startTermNode);
                    }
                }
                else
                {
                    startTerm_ = new Period(startTermNode);
                }
            }


            XmlNode endTermNode = xmlNode.SelectSingleNode("endTerm");

            if (endTermNode != null)
            {
                if (endTermNode.Attributes["href"] != null || endTermNode.Attributes["id"] != null)
                {
                    if (endTermNode.Attributes["id"] != null)
                    {
                        endTermIDRef_ = endTermNode.Attributes["id"].Value;
                        Period ob = new Period(endTermNode);
                        IDManager.SetID(endTermIDRef_, ob);
                    }
                    else if (endTermNode.Attributes["href"] != null)
                    {
                        endTermIDRef_ = endTermNode.Attributes["href"].Value;
                    }
                    else
                    {
                        endTerm_ = new Period(endTermNode);
                    }
                }
                else
                {
                    endTerm_ = new Period(endTermNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }
        }
 public Discounting(XmlNode xmlNode)
 {
     XmlNodeList discountingTypeNodeList = xmlNode.SelectNodes("discountingType");
     if (discountingTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in discountingTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 discountingTypeIDRef = item.Attributes["id"].Name;
                 DiscountingTypeEnum ob = DiscountingTypeEnum();
                 IDManager.SetID(discountingTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 discountingTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 discountingType = new DiscountingTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList discountRateNodeList = xmlNode.SelectNodes("discountRate");
     if (discountRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in discountRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 discountRateIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(discountRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 discountRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 discountRate = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList discountRateDayCountFractionNodeList = xmlNode.SelectNodes("discountRateDayCountFraction");
     if (discountRateDayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in discountRateDayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 discountRateDayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(discountRateDayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 discountRateDayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 discountRateDayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
 }
 public InterestCalculation(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
     XmlNode compoundingNode = xmlNode.SelectSingleNode("compounding");
     
     if (compoundingNode != null)
     {
         if (compoundingNode.Attributes["href"] != null || compoundingNode.Attributes["id"] != null) 
         {
             if (compoundingNode.Attributes["id"] != null) 
             {
                 compoundingIDRef_ = compoundingNode.Attributes["id"].Value;
                 Compounding ob = new Compounding(compoundingNode);
                 IDManager.SetID(compoundingIDRef_, ob);
             }
             else if (compoundingNode.Attributes["href"] != null)
             {
                 compoundingIDRef_ = compoundingNode.Attributes["href"].Value;
             }
             else
             {
                 compounding_ = new Compounding(compoundingNode);
             }
         }
         else
         {
             compounding_ = new Compounding(compoundingNode);
         }
     }
     
 
     XmlNode interpolationMethodNode = xmlNode.SelectSingleNode("interpolationMethod");
     
     if (interpolationMethodNode != null)
     {
         if (interpolationMethodNode.Attributes["href"] != null || interpolationMethodNode.Attributes["id"] != null) 
         {
             if (interpolationMethodNode.Attributes["id"] != null) 
             {
                 interpolationMethodIDRef_ = interpolationMethodNode.Attributes["id"].Value;
                 InterpolationMethod ob = new InterpolationMethod(interpolationMethodNode);
                 IDManager.SetID(interpolationMethodIDRef_, ob);
             }
             else if (interpolationMethodNode.Attributes["href"] != null)
             {
                 interpolationMethodIDRef_ = interpolationMethodNode.Attributes["href"].Value;
             }
             else
             {
                 interpolationMethod_ = new InterpolationMethod(interpolationMethodNode);
             }
         }
         else
         {
             interpolationMethod_ = new InterpolationMethod(interpolationMethodNode);
         }
     }
     
 
     XmlNode interpolationPeriodNode = xmlNode.SelectSingleNode("interpolationPeriod");
     
     if (interpolationPeriodNode != null)
     {
         if (interpolationPeriodNode.Attributes["href"] != null || interpolationPeriodNode.Attributes["id"] != null) 
         {
             if (interpolationPeriodNode.Attributes["id"] != null) 
             {
                 interpolationPeriodIDRef_ = interpolationPeriodNode.Attributes["id"].Value;
                 InterpolationPeriodEnum ob = new InterpolationPeriodEnum(interpolationPeriodNode);
                 IDManager.SetID(interpolationPeriodIDRef_, ob);
             }
             else if (interpolationPeriodNode.Attributes["href"] != null)
             {
                 interpolationPeriodIDRef_ = interpolationPeriodNode.Attributes["href"].Value;
             }
             else
             {
                 interpolationPeriod_ = new InterpolationPeriodEnum(interpolationPeriodNode);
             }
         }
         else
         {
             interpolationPeriod_ = new InterpolationPeriodEnum(interpolationPeriodNode);
         }
     }
     
 
 }
Пример #22
0
        public Discounting(XmlNode xmlNode)
        {
            XmlNodeList discountingTypeNodeList = xmlNode.SelectNodes("discountingType");

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

            foreach (XmlNode item in discountingTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        discountingTypeIDRef = item.Attributes["id"].Name;
                        DiscountingTypeEnum ob = DiscountingTypeEnum();
                        IDManager.SetID(discountingTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        discountingTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        discountingType = new DiscountingTypeEnum(item);
                    }
                }
            }


            XmlNodeList discountRateNodeList = xmlNode.SelectNodes("discountRate");

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

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


            XmlNodeList discountRateDayCountFractionNodeList = xmlNode.SelectNodes("discountRateDayCountFraction");

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

            foreach (XmlNode item in discountRateDayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        discountRateDayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(discountRateDayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        discountRateDayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        discountRateDayCountFraction = new DayCountFraction(item);
                    }
                }
            }
        }
        public TermDeposit(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 startDateNodeList = xmlNode.SelectNodes("startDate");

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

            foreach (XmlNode item in startDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        startDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(startDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        startDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        startDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList maturityDateNodeList = xmlNode.SelectNodes("maturityDate");

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

            foreach (XmlNode item in maturityDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        maturityDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(maturityDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        maturityDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        maturityDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList tenorNameNodeList = xmlNode.SelectNodes("tenorName");

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

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


            XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");

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

            foreach (XmlNode item in tenorPeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(tenorPeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        tenorPeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tenorPeriod = new Period(item);
                    }
                }
            }


            XmlNodeList principalNodeList = xmlNode.SelectNodes("principal");

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

            foreach (XmlNode item in principalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        principalIDRef = item.Attributes["id"].Name;
                        PositiveMoney ob = PositiveMoney();
                        IDManager.SetID(principalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        principalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        principal = new PositiveMoney(item);
                    }
                }
            }


            XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");

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

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


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }


            XmlNodeList featuresNodeList = xmlNode.SelectNodes("features");

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

            foreach (XmlNode item in featuresNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        featuresIDRef = item.Attributes["id"].Name;
                        TermDepositFeatures ob = TermDepositFeatures();
                        IDManager.SetID(featuresIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        featuresIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        features = new TermDepositFeatures(item);
                    }
                }
            }


            XmlNodeList interestNodeList = xmlNode.SelectNodes("interest");

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

            foreach (XmlNode item in interestNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        interestIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(interestIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        interestIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        interest = new Money(item);
                    }
                }
            }


            XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");

            foreach (XmlNode item in paymentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentIDRef = item.Attributes["id"].Name;
                        List <Payment> ob = new List <Payment>();
                        ob.Add(new Payment(item));
                        IDManager.SetID(paymentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payment.Add(new Payment(item));
                    }
                }
            }
        }
Пример #24
0
        public Calculation(XmlNode xmlNode)
        {
            XmlNodeList notionalScheduleNodeList = xmlNode.SelectNodes("notionalSchedule");

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

            foreach (XmlNode item in notionalScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalScheduleIDRef = item.Attributes["id"].Name;
                        Notional ob = Notional();
                        IDManager.SetID(notionalScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notionalSchedule = new Notional(item);
                    }
                }
            }


            XmlNodeList fxLinkedNotionalScheduleNodeList = xmlNode.SelectNodes("fxLinkedNotionalSchedule");

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

            foreach (XmlNode item in fxLinkedNotionalScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxLinkedNotionalScheduleIDRef = item.Attributes["id"].Name;
                        FxLinkedNotionalSchedule ob = FxLinkedNotionalSchedule();
                        IDManager.SetID(fxLinkedNotionalScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxLinkedNotionalScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fxLinkedNotionalSchedule = new FxLinkedNotionalSchedule(item);
                    }
                }
            }


            XmlNodeList fixedRateScheduleNodeList = xmlNode.SelectNodes("fixedRateSchedule");

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

            foreach (XmlNode item in fixedRateScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedRateScheduleIDRef = item.Attributes["id"].Name;
                        Schedule ob = Schedule();
                        IDManager.SetID(fixedRateScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedRateScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedRateSchedule = new Schedule(item);
                    }
                }
            }


            XmlNodeList futureValueNotionalNodeList = xmlNode.SelectNodes("futureValueNotional");

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

            foreach (XmlNode item in futureValueNotionalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        futureValueNotionalIDRef = item.Attributes["id"].Name;
                        FutureValueAmount ob = FutureValueAmount();
                        IDManager.SetID(futureValueNotionalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        futureValueNotionalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        futureValueNotional = new FutureValueAmount(item);
                    }
                }
            }


            XmlNodeList rateCalculationNodeList = xmlNode.SelectNodes("rateCalculation");

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

            foreach (XmlNode item in rateCalculationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        rateCalculationIDRef = item.Attributes["id"].Name;
                        Rate ob = Rate();
                        IDManager.SetID(rateCalculationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        rateCalculationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        rateCalculation = new Rate(item);
                    }
                }
            }


            XmlNodeList floatingRateCalculationNodeList = xmlNode.SelectNodes("floatingRateCalculation");

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

            foreach (XmlNode item in floatingRateCalculationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        floatingRateCalculationIDRef = item.Attributes["id"].Name;
                        FloatingRateCalculation ob = FloatingRateCalculation();
                        IDManager.SetID(floatingRateCalculationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        floatingRateCalculationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        floatingRateCalculation = new FloatingRateCalculation(item);
                    }
                }
            }


            XmlNodeList inflationRateCalculationNodeList = xmlNode.SelectNodes("inflationRateCalculation");

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

            foreach (XmlNode item in inflationRateCalculationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        inflationRateCalculationIDRef = item.Attributes["id"].Name;
                        InflationRateCalculation ob = InflationRateCalculation();
                        IDManager.SetID(inflationRateCalculationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        inflationRateCalculationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        inflationRateCalculation = new InflationRateCalculation(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }


            XmlNodeList discountingNodeList = xmlNode.SelectNodes("discounting");

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

            foreach (XmlNode item in discountingNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        discountingIDRef = item.Attributes["id"].Name;
                        Discounting ob = Discounting();
                        IDManager.SetID(discountingIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        discountingIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        discounting = new Discounting(item);
                    }
                }
            }


            XmlNodeList compoundingMethodNodeList = xmlNode.SelectNodes("compoundingMethod");

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

            foreach (XmlNode item in compoundingMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        compoundingMethodIDRef = item.Attributes["id"].Name;
                        CompoundingMethodEnum ob = CompoundingMethodEnum();
                        IDManager.SetID(compoundingMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        compoundingMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        compoundingMethod = new CompoundingMethodEnum(item);
                    }
                }
            }
        }
Пример #25
0
        public Mortgage(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode insurerNode = xmlNode.SelectSingleNode("insurer");

            if (insurerNode != null)
            {
                if (insurerNode.Attributes["href"] != null || insurerNode.Attributes["id"] != null)
                {
                    if (insurerNode.Attributes["id"] != null)
                    {
                        insurerIDRef_ = insurerNode.Attributes["id"].Value;
                        LegalEntity ob = new LegalEntity(insurerNode);
                        IDManager.SetID(insurerIDRef_, ob);
                    }
                    else if (insurerNode.Attributes["href"] != null)
                    {
                        insurerIDRef_ = insurerNode.Attributes["href"].Value;
                    }
                    else
                    {
                        insurer_ = new LegalEntity(insurerNode);
                    }
                }
                else
                {
                    insurer_ = new LegalEntity(insurerNode);
                }
            }


            XmlNode insurerReferenceNode = xmlNode.SelectSingleNode("insurerReference");

            if (insurerReferenceNode != null)
            {
                if (insurerReferenceNode.Attributes["href"] != null || insurerReferenceNode.Attributes["id"] != null)
                {
                    if (insurerReferenceNode.Attributes["id"] != null)
                    {
                        insurerReferenceIDRef_ = insurerReferenceNode.Attributes["id"].Value;
                        LegalEntityReference ob = new LegalEntityReference(insurerReferenceNode);
                        IDManager.SetID(insurerReferenceIDRef_, ob);
                    }
                    else if (insurerReferenceNode.Attributes["href"] != null)
                    {
                        insurerReferenceIDRef_ = insurerReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        insurerReference_ = new LegalEntityReference(insurerReferenceNode);
                    }
                }
                else
                {
                    insurerReference_ = new LegalEntityReference(insurerReferenceNode);
                }
            }


            XmlNode issuerNameNode = xmlNode.SelectSingleNode("issuerName");

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


            XmlNode issuerPartyReferenceNode = xmlNode.SelectSingleNode("issuerPartyReference");

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


            XmlNode seniorityNode = xmlNode.SelectSingleNode("seniority");

            if (seniorityNode != null)
            {
                if (seniorityNode.Attributes["href"] != null || seniorityNode.Attributes["id"] != null)
                {
                    if (seniorityNode.Attributes["id"] != null)
                    {
                        seniorityIDRef_ = seniorityNode.Attributes["id"].Value;
                        CreditSeniority ob = new CreditSeniority(seniorityNode);
                        IDManager.SetID(seniorityIDRef_, ob);
                    }
                    else if (seniorityNode.Attributes["href"] != null)
                    {
                        seniorityIDRef_ = seniorityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        seniority_ = new CreditSeniority(seniorityNode);
                    }
                }
                else
                {
                    seniority_ = new CreditSeniority(seniorityNode);
                }
            }


            XmlNode couponTypeNode = xmlNode.SelectSingleNode("couponType");

            if (couponTypeNode != null)
            {
                if (couponTypeNode.Attributes["href"] != null || couponTypeNode.Attributes["id"] != null)
                {
                    if (couponTypeNode.Attributes["id"] != null)
                    {
                        couponTypeIDRef_ = couponTypeNode.Attributes["id"].Value;
                        CouponType ob = new CouponType(couponTypeNode);
                        IDManager.SetID(couponTypeIDRef_, ob);
                    }
                    else if (couponTypeNode.Attributes["href"] != null)
                    {
                        couponTypeIDRef_ = couponTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        couponType_ = new CouponType(couponTypeNode);
                    }
                }
                else
                {
                    couponType_ = new CouponType(couponTypeNode);
                }
            }


            XmlNode couponRateNode = xmlNode.SelectSingleNode("couponRate");

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


            XmlNode maturityNode = xmlNode.SelectSingleNode("maturity");

            if (maturityNode != null)
            {
                if (maturityNode.Attributes["href"] != null || maturityNode.Attributes["id"] != null)
                {
                    if (maturityNode.Attributes["id"] != null)
                    {
                        maturityIDRef_ = maturityNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(maturityNode);
                        IDManager.SetID(maturityIDRef_, ob);
                    }
                    else if (maturityNode.Attributes["href"] != null)
                    {
                        maturityIDRef_ = maturityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        maturity_ = new XsdTypeDate(maturityNode);
                    }
                }
                else
                {
                    maturity_ = new XsdTypeDate(maturityNode);
                }
            }


            XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");

            if (paymentFrequencyNode != null)
            {
                if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null)
                {
                    if (paymentFrequencyNode.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                        Period ob = new Period(paymentFrequencyNode);
                        IDManager.SetID(paymentFrequencyIDRef_, ob);
                    }
                    else if (paymentFrequencyNode.Attributes["href"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentFrequency_ = new Period(paymentFrequencyNode);
                    }
                }
                else
                {
                    paymentFrequency_ = new Period(paymentFrequencyNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }


            XmlNode originalPrincipalAmountNode = xmlNode.SelectSingleNode("originalPrincipalAmount");

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


            XmlNode poolNode = xmlNode.SelectSingleNode("pool");

            if (poolNode != null)
            {
                if (poolNode.Attributes["href"] != null || poolNode.Attributes["id"] != null)
                {
                    if (poolNode.Attributes["id"] != null)
                    {
                        poolIDRef_ = poolNode.Attributes["id"].Value;
                        AssetPool ob = new AssetPool(poolNode);
                        IDManager.SetID(poolIDRef_, ob);
                    }
                    else if (poolNode.Attributes["href"] != null)
                    {
                        poolIDRef_ = poolNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pool_ = new AssetPool(poolNode);
                    }
                }
                else
                {
                    pool_ = new AssetPool(poolNode);
                }
            }


            XmlNode sectorNode = xmlNode.SelectSingleNode("sector");

            if (sectorNode != null)
            {
                if (sectorNode.Attributes["href"] != null || sectorNode.Attributes["id"] != null)
                {
                    if (sectorNode.Attributes["id"] != null)
                    {
                        sectorIDRef_ = sectorNode.Attributes["id"].Value;
                        MortgageSector ob = new MortgageSector(sectorNode);
                        IDManager.SetID(sectorIDRef_, ob);
                    }
                    else if (sectorNode.Attributes["href"] != null)
                    {
                        sectorIDRef_ = sectorNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sector_ = new MortgageSector(sectorNode);
                    }
                }
                else
                {
                    sector_ = new MortgageSector(sectorNode);
                }
            }


            XmlNode trancheNode = xmlNode.SelectSingleNode("tranche");

            if (trancheNode != null)
            {
                if (trancheNode.Attributes["href"] != null || trancheNode.Attributes["id"] != null)
                {
                    if (trancheNode.Attributes["id"] != null)
                    {
                        trancheIDRef_ = trancheNode.Attributes["id"].Value;
                        XsdTypeToken ob = new XsdTypeToken(trancheNode);
                        IDManager.SetID(trancheIDRef_, ob);
                    }
                    else if (trancheNode.Attributes["href"] != null)
                    {
                        trancheIDRef_ = trancheNode.Attributes["href"].Value;
                    }
                    else
                    {
                        tranche_ = new XsdTypeToken(trancheNode);
                    }
                }
                else
                {
                    tranche_ = new XsdTypeToken(trancheNode);
                }
            }
        }
        public SimpleFra(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList startTermNodeList = xmlNode.SelectNodes("startTerm");

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

            foreach (XmlNode item in startTermNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        startTermIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(startTermIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        startTermIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        startTerm = new Period(item);
                    }
                }
            }


            XmlNodeList endTermNodeList = xmlNode.SelectNodes("endTerm");

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

            foreach (XmlNode item in endTermNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        endTermIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(endTermIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        endTermIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        endTerm = new Period(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }
        }
Пример #27
0
 public Fra(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList adjustedEffectiveDateNodeList = xmlNode.SelectNodes("adjustedEffectiveDate");
     if (adjustedEffectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in adjustedEffectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 adjustedEffectiveDateIDRef = item.Attributes["id"].Name;
                 RequiredIdentifierDate ob = RequiredIdentifierDate();
                 IDManager.SetID(adjustedEffectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 adjustedEffectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 adjustedEffectiveDate = new RequiredIdentifierDate(item);
             }
         }
     }
     
 
     XmlNodeList adjustedTerminationDateNodeList = xmlNode.SelectNodes("adjustedTerminationDate");
     if (adjustedTerminationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in adjustedTerminationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 adjustedTerminationDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(adjustedTerminationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 adjustedTerminationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 adjustedTerminationDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList paymentDateNodeList = xmlNode.SelectNodes("paymentDate");
     if (paymentDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDateIDRef = item.Attributes["id"].Name;
                 AdjustableDate ob = AdjustableDate();
                 IDManager.SetID(paymentDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDate = new AdjustableDate(item);
             }
         }
     }
     
 
     XmlNodeList fixingDateOffsetNodeList = xmlNode.SelectNodes("fixingDateOffset");
     if (fixingDateOffsetNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixingDateOffsetNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixingDateOffsetIDRef = item.Attributes["id"].Name;
                 RelativeDateOffset ob = RelativeDateOffset();
                 IDManager.SetID(fixingDateOffsetIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixingDateOffsetIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixingDateOffset = new RelativeDateOffset(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodNumberOfDaysNodeList = xmlNode.SelectNodes("calculationPeriodNumberOfDays");
     if (calculationPeriodNumberOfDaysNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodNumberOfDaysNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodNumberOfDaysIDRef = item.Attributes["id"].Name;
                 XsdTypePositiveInteger ob = XsdTypePositiveInteger();
                 IDManager.SetID(calculationPeriodNumberOfDaysIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodNumberOfDaysIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriodNumberOfDays = new XsdTypePositiveInteger(item);
             }
         }
     }
     
 
     XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");
     if (notionalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalIDRef = item.Attributes["id"].Name;
                 Money ob = Money();
                 IDManager.SetID(notionalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notional = new Money(item);
             }
         }
     }
     
 
     XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");
     if (fixedRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedRateIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(fixedRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedRate = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList floatingRateIndexNodeList = xmlNode.SelectNodes("floatingRateIndex");
     if (floatingRateIndexNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingRateIndexNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingRateIndexIDRef = item.Attributes["id"].Name;
                 FloatingRateIndex ob = FloatingRateIndex();
                 IDManager.SetID(floatingRateIndexIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingRateIndexIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingRateIndex = new FloatingRateIndex(item);
             }
         }
     }
     
 
     XmlNodeList indexTenorNodeList = xmlNode.SelectNodes("indexTenor");
     
     foreach (XmlNode item in indexTenorNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 indexTenorIDRef = item.Attributes["id"].Name;
                 List<Period> ob = new List<Period>();
                 ob.Add(new Period(item));
                 IDManager.SetID(indexTenorIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 indexTenorIDRef = item.Attributes["href"].Name;
             }
             else
             {
             indexTenor.Add(new Period(item));
             }
         }
     }
     
 
     XmlNodeList fraDiscountingNodeList = xmlNode.SelectNodes("fraDiscounting");
     if (fraDiscountingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fraDiscountingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fraDiscountingIDRef = item.Attributes["id"].Name;
                 FraDiscountingEnum ob = FraDiscountingEnum();
                 IDManager.SetID(fraDiscountingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fraDiscountingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fraDiscounting = new FraDiscountingEnum(item);
             }
         }
     }
     
 
 }
Пример #28
0
        public Bond(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList issuerNameNodeList = xmlNode.SelectNodes("issuerName");

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

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


            XmlNodeList issuerPartyReferenceNodeList = xmlNode.SelectNodes("issuerPartyReference");

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

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


            XmlNodeList seniorityNodeList = xmlNode.SelectNodes("seniority");

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

            foreach (XmlNode item in seniorityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        seniorityIDRef = item.Attributes["id"].Name;
                        CreditSeniority ob = CreditSeniority();
                        IDManager.SetID(seniorityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        seniorityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        seniority = new CreditSeniority(item);
                    }
                }
            }


            XmlNodeList couponTypeNodeList = xmlNode.SelectNodes("couponType");

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

            foreach (XmlNode item in couponTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        couponTypeIDRef = item.Attributes["id"].Name;
                        CouponType ob = CouponType();
                        IDManager.SetID(couponTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        couponTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        couponType = new CouponType(item);
                    }
                }
            }


            XmlNodeList couponRateNodeList = xmlNode.SelectNodes("couponRate");

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

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


            XmlNodeList maturityNodeList = xmlNode.SelectNodes("maturity");

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

            foreach (XmlNode item in maturityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        maturityIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(maturityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        maturityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        maturity = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList parValueNodeList = xmlNode.SelectNodes("parValue");

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

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


            XmlNodeList faceAmountNodeList = xmlNode.SelectNodes("faceAmount");

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

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


            XmlNodeList paymentFrequencyNodeList = xmlNode.SelectNodes("paymentFrequency");

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

            foreach (XmlNode item in paymentFrequencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(paymentFrequencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentFrequencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentFrequency = new Period(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }
        }
 public FixedAmountCalculation(XmlNode xmlNode)
 {
     XmlNodeList calculationAmountNodeList = xmlNode.SelectNodes("calculationAmount");
     if (calculationAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationAmountIDRef = item.Attributes["id"].Name;
                 CalculationAmount ob = CalculationAmount();
                 IDManager.SetID(calculationAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationAmount = new CalculationAmount(item);
             }
         }
     }
     
 
     XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");
     if (fixedRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedRateIDRef = item.Attributes["id"].Name;
                 FixedRate ob = FixedRate();
                 IDManager.SetID(fixedRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedRate = new FixedRate(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
 }
Пример #30
0
        public Deposit(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode termNode = xmlNode.SelectSingleNode("term");

            if (termNode != null)
            {
                if (termNode.Attributes["href"] != null || termNode.Attributes["id"] != null)
                {
                    if (termNode.Attributes["id"] != null)
                    {
                        termIDRef_ = termNode.Attributes["id"].Value;
                        Period ob = new Period(termNode);
                        IDManager.SetID(termIDRef_, ob);
                    }
                    else if (termNode.Attributes["href"] != null)
                    {
                        termIDRef_ = termNode.Attributes["href"].Value;
                    }
                    else
                    {
                        term_ = new Period(termNode);
                    }
                }
                else
                {
                    term_ = new Period(termNode);
                }
            }


            XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");

            if (paymentFrequencyNode != null)
            {
                if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null)
                {
                    if (paymentFrequencyNode.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                        Period ob = new Period(paymentFrequencyNode);
                        IDManager.SetID(paymentFrequencyIDRef_, ob);
                    }
                    else if (paymentFrequencyNode.Attributes["href"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentFrequency_ = new Period(paymentFrequencyNode);
                    }
                }
                else
                {
                    paymentFrequency_ = new Period(paymentFrequencyNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }
        }
 public Calculation(XmlNode xmlNode)
 {
     XmlNode notionalScheduleNode = xmlNode.SelectSingleNode("notionalSchedule");
     
     if (notionalScheduleNode != null)
     {
         if (notionalScheduleNode.Attributes["href"] != null || notionalScheduleNode.Attributes["id"] != null) 
         {
             if (notionalScheduleNode.Attributes["id"] != null) 
             {
                 notionalScheduleIDRef_ = notionalScheduleNode.Attributes["id"].Value;
                 Notional ob = new Notional(notionalScheduleNode);
                 IDManager.SetID(notionalScheduleIDRef_, ob);
             }
             else if (notionalScheduleNode.Attributes["href"] != null)
             {
                 notionalScheduleIDRef_ = notionalScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 notionalSchedule_ = new Notional(notionalScheduleNode);
             }
         }
         else
         {
             notionalSchedule_ = new Notional(notionalScheduleNode);
         }
     }
     
 
     XmlNode fxLinkedNotionalScheduleNode = xmlNode.SelectSingleNode("fxLinkedNotionalSchedule");
     
     if (fxLinkedNotionalScheduleNode != null)
     {
         if (fxLinkedNotionalScheduleNode.Attributes["href"] != null || fxLinkedNotionalScheduleNode.Attributes["id"] != null) 
         {
             if (fxLinkedNotionalScheduleNode.Attributes["id"] != null) 
             {
                 fxLinkedNotionalScheduleIDRef_ = fxLinkedNotionalScheduleNode.Attributes["id"].Value;
                 FxLinkedNotionalSchedule ob = new FxLinkedNotionalSchedule(fxLinkedNotionalScheduleNode);
                 IDManager.SetID(fxLinkedNotionalScheduleIDRef_, ob);
             }
             else if (fxLinkedNotionalScheduleNode.Attributes["href"] != null)
             {
                 fxLinkedNotionalScheduleIDRef_ = fxLinkedNotionalScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 fxLinkedNotionalSchedule_ = new FxLinkedNotionalSchedule(fxLinkedNotionalScheduleNode);
             }
         }
         else
         {
             fxLinkedNotionalSchedule_ = new FxLinkedNotionalSchedule(fxLinkedNotionalScheduleNode);
         }
     }
     
 
     XmlNode fixedRateScheduleNode = xmlNode.SelectSingleNode("fixedRateSchedule");
     
     if (fixedRateScheduleNode != null)
     {
         if (fixedRateScheduleNode.Attributes["href"] != null || fixedRateScheduleNode.Attributes["id"] != null) 
         {
             if (fixedRateScheduleNode.Attributes["id"] != null) 
             {
                 fixedRateScheduleIDRef_ = fixedRateScheduleNode.Attributes["id"].Value;
                 Schedule ob = new Schedule(fixedRateScheduleNode);
                 IDManager.SetID(fixedRateScheduleIDRef_, ob);
             }
             else if (fixedRateScheduleNode.Attributes["href"] != null)
             {
                 fixedRateScheduleIDRef_ = fixedRateScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 fixedRateSchedule_ = new Schedule(fixedRateScheduleNode);
             }
         }
         else
         {
             fixedRateSchedule_ = new Schedule(fixedRateScheduleNode);
         }
     }
     
 
     XmlNode futureValueNotionalNode = xmlNode.SelectSingleNode("futureValueNotional");
     
     if (futureValueNotionalNode != null)
     {
         if (futureValueNotionalNode.Attributes["href"] != null || futureValueNotionalNode.Attributes["id"] != null) 
         {
             if (futureValueNotionalNode.Attributes["id"] != null) 
             {
                 futureValueNotionalIDRef_ = futureValueNotionalNode.Attributes["id"].Value;
                 FutureValueAmount ob = new FutureValueAmount(futureValueNotionalNode);
                 IDManager.SetID(futureValueNotionalIDRef_, ob);
             }
             else if (futureValueNotionalNode.Attributes["href"] != null)
             {
                 futureValueNotionalIDRef_ = futureValueNotionalNode.Attributes["href"].Value;
             }
             else
             {
                 futureValueNotional_ = new FutureValueAmount(futureValueNotionalNode);
             }
         }
         else
         {
             futureValueNotional_ = new FutureValueAmount(futureValueNotionalNode);
         }
     }
     
 
     XmlNode rateCalculationNode = xmlNode.SelectSingleNode("rateCalculation");
     
     if (rateCalculationNode != null)
     {
         if (rateCalculationNode.Attributes["href"] != null || rateCalculationNode.Attributes["id"] != null) 
         {
             if (rateCalculationNode.Attributes["id"] != null) 
             {
                 rateCalculationIDRef_ = rateCalculationNode.Attributes["id"].Value;
                 Rate ob = new Rate(rateCalculationNode);
                 IDManager.SetID(rateCalculationIDRef_, ob);
             }
             else if (rateCalculationNode.Attributes["href"] != null)
             {
                 rateCalculationIDRef_ = rateCalculationNode.Attributes["href"].Value;
             }
             else
             {
                 rateCalculation_ = new Rate(rateCalculationNode);
             }
         }
         else
         {
             rateCalculation_ = new Rate(rateCalculationNode);
         }
     }
     
 
     XmlNode floatingRateCalculationNode = xmlNode.SelectSingleNode("floatingRateCalculation");
     
     if (floatingRateCalculationNode != null)
     {
         if (floatingRateCalculationNode.Attributes["href"] != null || floatingRateCalculationNode.Attributes["id"] != null) 
         {
             if (floatingRateCalculationNode.Attributes["id"] != null) 
             {
                 floatingRateCalculationIDRef_ = floatingRateCalculationNode.Attributes["id"].Value;
                 FloatingRateCalculation ob = new FloatingRateCalculation(floatingRateCalculationNode);
                 IDManager.SetID(floatingRateCalculationIDRef_, ob);
             }
             else if (floatingRateCalculationNode.Attributes["href"] != null)
             {
                 floatingRateCalculationIDRef_ = floatingRateCalculationNode.Attributes["href"].Value;
             }
             else
             {
                 floatingRateCalculation_ = new FloatingRateCalculation(floatingRateCalculationNode);
             }
         }
         else
         {
             floatingRateCalculation_ = new FloatingRateCalculation(floatingRateCalculationNode);
         }
     }
     
 
     XmlNode inflationRateCalculationNode = xmlNode.SelectSingleNode("inflationRateCalculation");
     
     if (inflationRateCalculationNode != null)
     {
         if (inflationRateCalculationNode.Attributes["href"] != null || inflationRateCalculationNode.Attributes["id"] != null) 
         {
             if (inflationRateCalculationNode.Attributes["id"] != null) 
             {
                 inflationRateCalculationIDRef_ = inflationRateCalculationNode.Attributes["id"].Value;
                 InflationRateCalculation ob = new InflationRateCalculation(inflationRateCalculationNode);
                 IDManager.SetID(inflationRateCalculationIDRef_, ob);
             }
             else if (inflationRateCalculationNode.Attributes["href"] != null)
             {
                 inflationRateCalculationIDRef_ = inflationRateCalculationNode.Attributes["href"].Value;
             }
             else
             {
                 inflationRateCalculation_ = new InflationRateCalculation(inflationRateCalculationNode);
             }
         }
         else
         {
             inflationRateCalculation_ = new InflationRateCalculation(inflationRateCalculationNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
     XmlNode discountingNode = xmlNode.SelectSingleNode("discounting");
     
     if (discountingNode != null)
     {
         if (discountingNode.Attributes["href"] != null || discountingNode.Attributes["id"] != null) 
         {
             if (discountingNode.Attributes["id"] != null) 
             {
                 discountingIDRef_ = discountingNode.Attributes["id"].Value;
                 Discounting ob = new Discounting(discountingNode);
                 IDManager.SetID(discountingIDRef_, ob);
             }
             else if (discountingNode.Attributes["href"] != null)
             {
                 discountingIDRef_ = discountingNode.Attributes["href"].Value;
             }
             else
             {
                 discounting_ = new Discounting(discountingNode);
             }
         }
         else
         {
             discounting_ = new Discounting(discountingNode);
         }
     }
     
 
     XmlNode compoundingMethodNode = xmlNode.SelectSingleNode("compoundingMethod");
     
     if (compoundingMethodNode != null)
     {
         if (compoundingMethodNode.Attributes["href"] != null || compoundingMethodNode.Attributes["id"] != null) 
         {
             if (compoundingMethodNode.Attributes["id"] != null) 
             {
                 compoundingMethodIDRef_ = compoundingMethodNode.Attributes["id"].Value;
                 CompoundingMethodEnum ob = new CompoundingMethodEnum(compoundingMethodNode);
                 IDManager.SetID(compoundingMethodIDRef_, ob);
             }
             else if (compoundingMethodNode.Attributes["href"] != null)
             {
                 compoundingMethodIDRef_ = compoundingMethodNode.Attributes["href"].Value;
             }
             else
             {
                 compoundingMethod_ = new CompoundingMethodEnum(compoundingMethodNode);
             }
         }
         else
         {
             compoundingMethod_ = new CompoundingMethodEnum(compoundingMethodNode);
         }
     }
     
 
 }
 public SimpleFra(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode startTermNode = xmlNode.SelectSingleNode("startTerm");
     
     if (startTermNode != null)
     {
         if (startTermNode.Attributes["href"] != null || startTermNode.Attributes["id"] != null) 
         {
             if (startTermNode.Attributes["id"] != null) 
             {
                 startTermIDRef_ = startTermNode.Attributes["id"].Value;
                 Period ob = new Period(startTermNode);
                 IDManager.SetID(startTermIDRef_, ob);
             }
             else if (startTermNode.Attributes["href"] != null)
             {
                 startTermIDRef_ = startTermNode.Attributes["href"].Value;
             }
             else
             {
                 startTerm_ = new Period(startTermNode);
             }
         }
         else
         {
             startTerm_ = new Period(startTermNode);
         }
     }
     
 
     XmlNode endTermNode = xmlNode.SelectSingleNode("endTerm");
     
     if (endTermNode != null)
     {
         if (endTermNode.Attributes["href"] != null || endTermNode.Attributes["id"] != null) 
         {
             if (endTermNode.Attributes["id"] != null) 
             {
                 endTermIDRef_ = endTermNode.Attributes["id"].Value;
                 Period ob = new Period(endTermNode);
                 IDManager.SetID(endTermIDRef_, ob);
             }
             else if (endTermNode.Attributes["href"] != null)
             {
                 endTermIDRef_ = endTermNode.Attributes["href"].Value;
             }
             else
             {
                 endTerm_ = new Period(endTermNode);
             }
         }
         else
         {
             endTerm_ = new Period(endTermNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
 }
 public Mortgage(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode insurerNode = xmlNode.SelectSingleNode("insurer");
     
     if (insurerNode != null)
     {
         if (insurerNode.Attributes["href"] != null || insurerNode.Attributes["id"] != null) 
         {
             if (insurerNode.Attributes["id"] != null) 
             {
                 insurerIDRef_ = insurerNode.Attributes["id"].Value;
                 LegalEntity ob = new LegalEntity(insurerNode);
                 IDManager.SetID(insurerIDRef_, ob);
             }
             else if (insurerNode.Attributes["href"] != null)
             {
                 insurerIDRef_ = insurerNode.Attributes["href"].Value;
             }
             else
             {
                 insurer_ = new LegalEntity(insurerNode);
             }
         }
         else
         {
             insurer_ = new LegalEntity(insurerNode);
         }
     }
     
 
     XmlNode insurerReferenceNode = xmlNode.SelectSingleNode("insurerReference");
     
     if (insurerReferenceNode != null)
     {
         if (insurerReferenceNode.Attributes["href"] != null || insurerReferenceNode.Attributes["id"] != null) 
         {
             if (insurerReferenceNode.Attributes["id"] != null) 
             {
                 insurerReferenceIDRef_ = insurerReferenceNode.Attributes["id"].Value;
                 LegalEntityReference ob = new LegalEntityReference(insurerReferenceNode);
                 IDManager.SetID(insurerReferenceIDRef_, ob);
             }
             else if (insurerReferenceNode.Attributes["href"] != null)
             {
                 insurerReferenceIDRef_ = insurerReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 insurerReference_ = new LegalEntityReference(insurerReferenceNode);
             }
         }
         else
         {
             insurerReference_ = new LegalEntityReference(insurerReferenceNode);
         }
     }
     
 
     XmlNode issuerNameNode = xmlNode.SelectSingleNode("issuerName");
     
     if (issuerNameNode != null)
     {
         if (issuerNameNode.Attributes["href"] != null || issuerNameNode.Attributes["id"] != null) 
         {
             if (issuerNameNode.Attributes["id"] != null) 
             {
                 issuerNameIDRef_ = issuerNameNode.Attributes["id"].Value;
                 XsdTypeString ob = new XsdTypeString(issuerNameNode);
                 IDManager.SetID(issuerNameIDRef_, ob);
             }
             else if (issuerNameNode.Attributes["href"] != null)
             {
                 issuerNameIDRef_ = issuerNameNode.Attributes["href"].Value;
             }
             else
             {
                 issuerName_ = new XsdTypeString(issuerNameNode);
             }
         }
         else
         {
             issuerName_ = new XsdTypeString(issuerNameNode);
         }
     }
     
 
     XmlNode issuerPartyReferenceNode = xmlNode.SelectSingleNode("issuerPartyReference");
     
     if (issuerPartyReferenceNode != null)
     {
         if (issuerPartyReferenceNode.Attributes["href"] != null || issuerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (issuerPartyReferenceNode.Attributes["id"] != null) 
             {
                 issuerPartyReferenceIDRef_ = issuerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(issuerPartyReferenceNode);
                 IDManager.SetID(issuerPartyReferenceIDRef_, ob);
             }
             else if (issuerPartyReferenceNode.Attributes["href"] != null)
             {
                 issuerPartyReferenceIDRef_ = issuerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 issuerPartyReference_ = new PartyReference(issuerPartyReferenceNode);
             }
         }
         else
         {
             issuerPartyReference_ = new PartyReference(issuerPartyReferenceNode);
         }
     }
     
 
     XmlNode seniorityNode = xmlNode.SelectSingleNode("seniority");
     
     if (seniorityNode != null)
     {
         if (seniorityNode.Attributes["href"] != null || seniorityNode.Attributes["id"] != null) 
         {
             if (seniorityNode.Attributes["id"] != null) 
             {
                 seniorityIDRef_ = seniorityNode.Attributes["id"].Value;
                 CreditSeniority ob = new CreditSeniority(seniorityNode);
                 IDManager.SetID(seniorityIDRef_, ob);
             }
             else if (seniorityNode.Attributes["href"] != null)
             {
                 seniorityIDRef_ = seniorityNode.Attributes["href"].Value;
             }
             else
             {
                 seniority_ = new CreditSeniority(seniorityNode);
             }
         }
         else
         {
             seniority_ = new CreditSeniority(seniorityNode);
         }
     }
     
 
     XmlNode couponTypeNode = xmlNode.SelectSingleNode("couponType");
     
     if (couponTypeNode != null)
     {
         if (couponTypeNode.Attributes["href"] != null || couponTypeNode.Attributes["id"] != null) 
         {
             if (couponTypeNode.Attributes["id"] != null) 
             {
                 couponTypeIDRef_ = couponTypeNode.Attributes["id"].Value;
                 CouponType ob = new CouponType(couponTypeNode);
                 IDManager.SetID(couponTypeIDRef_, ob);
             }
             else if (couponTypeNode.Attributes["href"] != null)
             {
                 couponTypeIDRef_ = couponTypeNode.Attributes["href"].Value;
             }
             else
             {
                 couponType_ = new CouponType(couponTypeNode);
             }
         }
         else
         {
             couponType_ = new CouponType(couponTypeNode);
         }
     }
     
 
     XmlNode couponRateNode = xmlNode.SelectSingleNode("couponRate");
     
     if (couponRateNode != null)
     {
         if (couponRateNode.Attributes["href"] != null || couponRateNode.Attributes["id"] != null) 
         {
             if (couponRateNode.Attributes["id"] != null) 
             {
                 couponRateIDRef_ = couponRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(couponRateNode);
                 IDManager.SetID(couponRateIDRef_, ob);
             }
             else if (couponRateNode.Attributes["href"] != null)
             {
                 couponRateIDRef_ = couponRateNode.Attributes["href"].Value;
             }
             else
             {
                 couponRate_ = new XsdTypeDecimal(couponRateNode);
             }
         }
         else
         {
             couponRate_ = new XsdTypeDecimal(couponRateNode);
         }
     }
     
 
     XmlNode maturityNode = xmlNode.SelectSingleNode("maturity");
     
     if (maturityNode != null)
     {
         if (maturityNode.Attributes["href"] != null || maturityNode.Attributes["id"] != null) 
         {
             if (maturityNode.Attributes["id"] != null) 
             {
                 maturityIDRef_ = maturityNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(maturityNode);
                 IDManager.SetID(maturityIDRef_, ob);
             }
             else if (maturityNode.Attributes["href"] != null)
             {
                 maturityIDRef_ = maturityNode.Attributes["href"].Value;
             }
             else
             {
                 maturity_ = new XsdTypeDate(maturityNode);
             }
         }
         else
         {
             maturity_ = new XsdTypeDate(maturityNode);
         }
     }
     
 
     XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");
     
     if (paymentFrequencyNode != null)
     {
         if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null) 
         {
             if (paymentFrequencyNode.Attributes["id"] != null) 
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                 Period ob = new Period(paymentFrequencyNode);
                 IDManager.SetID(paymentFrequencyIDRef_, ob);
             }
             else if (paymentFrequencyNode.Attributes["href"] != null)
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
             }
             else
             {
                 paymentFrequency_ = new Period(paymentFrequencyNode);
             }
         }
         else
         {
             paymentFrequency_ = new Period(paymentFrequencyNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
     XmlNode originalPrincipalAmountNode = xmlNode.SelectSingleNode("originalPrincipalAmount");
     
     if (originalPrincipalAmountNode != null)
     {
         if (originalPrincipalAmountNode.Attributes["href"] != null || originalPrincipalAmountNode.Attributes["id"] != null) 
         {
             if (originalPrincipalAmountNode.Attributes["id"] != null) 
             {
                 originalPrincipalAmountIDRef_ = originalPrincipalAmountNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(originalPrincipalAmountNode);
                 IDManager.SetID(originalPrincipalAmountIDRef_, ob);
             }
             else if (originalPrincipalAmountNode.Attributes["href"] != null)
             {
                 originalPrincipalAmountIDRef_ = originalPrincipalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 originalPrincipalAmount_ = new XsdTypeDecimal(originalPrincipalAmountNode);
             }
         }
         else
         {
             originalPrincipalAmount_ = new XsdTypeDecimal(originalPrincipalAmountNode);
         }
     }
     
 
     XmlNode poolNode = xmlNode.SelectSingleNode("pool");
     
     if (poolNode != null)
     {
         if (poolNode.Attributes["href"] != null || poolNode.Attributes["id"] != null) 
         {
             if (poolNode.Attributes["id"] != null) 
             {
                 poolIDRef_ = poolNode.Attributes["id"].Value;
                 AssetPool ob = new AssetPool(poolNode);
                 IDManager.SetID(poolIDRef_, ob);
             }
             else if (poolNode.Attributes["href"] != null)
             {
                 poolIDRef_ = poolNode.Attributes["href"].Value;
             }
             else
             {
                 pool_ = new AssetPool(poolNode);
             }
         }
         else
         {
             pool_ = new AssetPool(poolNode);
         }
     }
     
 
     XmlNode sectorNode = xmlNode.SelectSingleNode("sector");
     
     if (sectorNode != null)
     {
         if (sectorNode.Attributes["href"] != null || sectorNode.Attributes["id"] != null) 
         {
             if (sectorNode.Attributes["id"] != null) 
             {
                 sectorIDRef_ = sectorNode.Attributes["id"].Value;
                 MortgageSector ob = new MortgageSector(sectorNode);
                 IDManager.SetID(sectorIDRef_, ob);
             }
             else if (sectorNode.Attributes["href"] != null)
             {
                 sectorIDRef_ = sectorNode.Attributes["href"].Value;
             }
             else
             {
                 sector_ = new MortgageSector(sectorNode);
             }
         }
         else
         {
             sector_ = new MortgageSector(sectorNode);
         }
     }
     
 
     XmlNode trancheNode = xmlNode.SelectSingleNode("tranche");
     
     if (trancheNode != null)
     {
         if (trancheNode.Attributes["href"] != null || trancheNode.Attributes["id"] != null) 
         {
             if (trancheNode.Attributes["id"] != null) 
             {
                 trancheIDRef_ = trancheNode.Attributes["id"].Value;
                 XsdTypeToken ob = new XsdTypeToken(trancheNode);
                 IDManager.SetID(trancheIDRef_, ob);
             }
             else if (trancheNode.Attributes["href"] != null)
             {
                 trancheIDRef_ = trancheNode.Attributes["href"].Value;
             }
             else
             {
                 tranche_ = new XsdTypeToken(trancheNode);
             }
         }
         else
         {
             tranche_ = new XsdTypeToken(trancheNode);
         }
     }
     
 
 }
 public SimpleFra(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList startTermNodeList = xmlNode.SelectNodes("startTerm");
     if (startTermNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in startTermNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 startTermIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(startTermIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 startTermIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 startTerm = new Period(item);
             }
         }
     }
     
 
     XmlNodeList endTermNodeList = xmlNode.SelectNodes("endTerm");
     if (endTermNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in endTermNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 endTermIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(endTermIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 endTermIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 endTerm = new Period(item);
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     if (dayCountFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dayCountFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef = item.Attributes["id"].Name;
                 DayCountFraction ob = DayCountFraction();
                 IDManager.SetID(dayCountFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dayCountFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dayCountFraction = new DayCountFraction(item);
             }
         }
     }
     
 
 }
        public FixedAmountCalculation(XmlNode xmlNode)
        {
            XmlNodeList calculationAmountNodeList = xmlNode.SelectNodes("calculationAmount");

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

            foreach (XmlNode item in calculationAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationAmountIDRef = item.Attributes["id"].Name;
                        CalculationAmount ob = CalculationAmount();
                        IDManager.SetID(calculationAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationAmount = new CalculationAmount(item);
                    }
                }
            }


            XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");

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

            foreach (XmlNode item in fixedRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedRateIDRef = item.Attributes["id"].Name;
                        FixedRate ob = FixedRate();
                        IDManager.SetID(fixedRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedRate = new FixedRate(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }
        }
 public TermDeposit(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 startDateNode = xmlNode.SelectSingleNode("startDate");
     
     if (startDateNode != null)
     {
         if (startDateNode.Attributes["href"] != null || startDateNode.Attributes["id"] != null) 
         {
             if (startDateNode.Attributes["id"] != null) 
             {
                 startDateIDRef_ = startDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(startDateNode);
                 IDManager.SetID(startDateIDRef_, ob);
             }
             else if (startDateNode.Attributes["href"] != null)
             {
                 startDateIDRef_ = startDateNode.Attributes["href"].Value;
             }
             else
             {
                 startDate_ = new XsdTypeDate(startDateNode);
             }
         }
         else
         {
             startDate_ = new XsdTypeDate(startDateNode);
         }
     }
     
 
     XmlNode maturityDateNode = xmlNode.SelectSingleNode("maturityDate");
     
     if (maturityDateNode != null)
     {
         if (maturityDateNode.Attributes["href"] != null || maturityDateNode.Attributes["id"] != null) 
         {
             if (maturityDateNode.Attributes["id"] != null) 
             {
                 maturityDateIDRef_ = maturityDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(maturityDateNode);
                 IDManager.SetID(maturityDateIDRef_, ob);
             }
             else if (maturityDateNode.Attributes["href"] != null)
             {
                 maturityDateIDRef_ = maturityDateNode.Attributes["href"].Value;
             }
             else
             {
                 maturityDate_ = new XsdTypeDate(maturityDateNode);
             }
         }
         else
         {
             maturityDate_ = new XsdTypeDate(maturityDateNode);
         }
     }
     
 
     XmlNode tenorNameNode = xmlNode.SelectSingleNode("tenorName");
     
     if (tenorNameNode != null)
     {
         if (tenorNameNode.Attributes["href"] != null || tenorNameNode.Attributes["id"] != null) 
         {
             if (tenorNameNode.Attributes["id"] != null) 
             {
                 tenorNameIDRef_ = tenorNameNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(tenorNameNode);
                 IDManager.SetID(tenorNameIDRef_, ob);
             }
             else if (tenorNameNode.Attributes["href"] != null)
             {
                 tenorNameIDRef_ = tenorNameNode.Attributes["href"].Value;
             }
             else
             {
                 tenorName_ = new XsdTypeBoolean(tenorNameNode);
             }
         }
         else
         {
             tenorName_ = new XsdTypeBoolean(tenorNameNode);
         }
     }
     
 
     XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");
     
     if (tenorPeriodNode != null)
     {
         if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null) 
         {
             if (tenorPeriodNode.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                 Period ob = new Period(tenorPeriodNode);
                 IDManager.SetID(tenorPeriodIDRef_, ob);
             }
             else if (tenorPeriodNode.Attributes["href"] != null)
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
             }
             else
             {
                 tenorPeriod_ = new Period(tenorPeriodNode);
             }
         }
         else
         {
             tenorPeriod_ = new Period(tenorPeriodNode);
         }
     }
     
 
     XmlNode principalNode = xmlNode.SelectSingleNode("principal");
     
     if (principalNode != null)
     {
         if (principalNode.Attributes["href"] != null || principalNode.Attributes["id"] != null) 
         {
             if (principalNode.Attributes["id"] != null) 
             {
                 principalIDRef_ = principalNode.Attributes["id"].Value;
                 PositiveMoney ob = new PositiveMoney(principalNode);
                 IDManager.SetID(principalIDRef_, ob);
             }
             else if (principalNode.Attributes["href"] != null)
             {
                 principalIDRef_ = principalNode.Attributes["href"].Value;
             }
             else
             {
                 principal_ = new PositiveMoney(principalNode);
             }
         }
         else
         {
             principal_ = new PositiveMoney(principalNode);
         }
     }
     
 
     XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");
     
     if (fixedRateNode != null)
     {
         if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null) 
         {
             if (fixedRateNode.Attributes["id"] != null) 
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(fixedRateNode);
                 IDManager.SetID(fixedRateIDRef_, ob);
             }
             else if (fixedRateNode.Attributes["href"] != null)
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
             }
             else
             {
                 fixedRate_ = new PositiveDecimal(fixedRateNode);
             }
         }
         else
         {
             fixedRate_ = new PositiveDecimal(fixedRateNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
     XmlNode featuresNode = xmlNode.SelectSingleNode("features");
     
     if (featuresNode != null)
     {
         if (featuresNode.Attributes["href"] != null || featuresNode.Attributes["id"] != null) 
         {
             if (featuresNode.Attributes["id"] != null) 
             {
                 featuresIDRef_ = featuresNode.Attributes["id"].Value;
                 TermDepositFeatures ob = new TermDepositFeatures(featuresNode);
                 IDManager.SetID(featuresIDRef_, ob);
             }
             else if (featuresNode.Attributes["href"] != null)
             {
                 featuresIDRef_ = featuresNode.Attributes["href"].Value;
             }
             else
             {
                 features_ = new TermDepositFeatures(featuresNode);
             }
         }
         else
         {
             features_ = new TermDepositFeatures(featuresNode);
         }
     }
     
 
     XmlNode interestNode = xmlNode.SelectSingleNode("interest");
     
     if (interestNode != null)
     {
         if (interestNode.Attributes["href"] != null || interestNode.Attributes["id"] != null) 
         {
             if (interestNode.Attributes["id"] != null) 
             {
                 interestIDRef_ = interestNode.Attributes["id"].Value;
                 Money ob = new Money(interestNode);
                 IDManager.SetID(interestIDRef_, ob);
             }
             else if (interestNode.Attributes["href"] != null)
             {
                 interestIDRef_ = interestNode.Attributes["href"].Value;
             }
             else
             {
                 interest_ = new Money(interestNode);
             }
         }
         else
         {
             interest_ = new Money(interestNode);
         }
     }
     
 
     XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");
     
     if (paymentNodeList != null)
     {
         this.payment_ = new List<Payment>();
         foreach (XmlNode item in paymentNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     paymentIDRef_ = item.Attributes["id"].Value;
                     payment_.Add(new Payment(item));
                     IDManager.SetID(paymentIDRef_, payment_[payment_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     paymentIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 payment_.Add(new Payment(item));
                 }
             }
             else
             {
                 payment_.Add(new Payment(item));
             }
         }
     }
     
 
 }
Пример #37
0
        public Mortgage(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList insurerNodeList = xmlNode.SelectNodes("insurer");

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

            foreach (XmlNode item in insurerNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        insurerIDRef = item.Attributes["id"].Name;
                        LegalEntity ob = LegalEntity();
                        IDManager.SetID(insurerIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        insurerIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        insurer = new LegalEntity(item);
                    }
                }
            }


            XmlNodeList insurerReferenceNodeList = xmlNode.SelectNodes("insurerReference");

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

            foreach (XmlNode item in insurerReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        insurerReferenceIDRef = item.Attributes["id"].Name;
                        LegalEntityReference ob = LegalEntityReference();
                        IDManager.SetID(insurerReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        insurerReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        insurerReference = new LegalEntityReference(item);
                    }
                }
            }


            XmlNodeList issuerNameNodeList = xmlNode.SelectNodes("issuerName");

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

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


            XmlNodeList issuerPartyReferenceNodeList = xmlNode.SelectNodes("issuerPartyReference");

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

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


            XmlNodeList seniorityNodeList = xmlNode.SelectNodes("seniority");

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

            foreach (XmlNode item in seniorityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        seniorityIDRef = item.Attributes["id"].Name;
                        CreditSeniority ob = CreditSeniority();
                        IDManager.SetID(seniorityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        seniorityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        seniority = new CreditSeniority(item);
                    }
                }
            }


            XmlNodeList couponTypeNodeList = xmlNode.SelectNodes("couponType");

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

            foreach (XmlNode item in couponTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        couponTypeIDRef = item.Attributes["id"].Name;
                        CouponType ob = CouponType();
                        IDManager.SetID(couponTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        couponTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        couponType = new CouponType(item);
                    }
                }
            }


            XmlNodeList couponRateNodeList = xmlNode.SelectNodes("couponRate");

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

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


            XmlNodeList maturityNodeList = xmlNode.SelectNodes("maturity");

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

            foreach (XmlNode item in maturityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        maturityIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(maturityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        maturityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        maturity = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList paymentFrequencyNodeList = xmlNode.SelectNodes("paymentFrequency");

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

            foreach (XmlNode item in paymentFrequencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(paymentFrequencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentFrequencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentFrequency = new Period(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }


            XmlNodeList originalPrincipalAmountNodeList = xmlNode.SelectNodes("originalPrincipalAmount");

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

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


            XmlNodeList poolNodeList = xmlNode.SelectNodes("pool");

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

            foreach (XmlNode item in poolNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        poolIDRef = item.Attributes["id"].Name;
                        AssetPool ob = AssetPool();
                        IDManager.SetID(poolIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        poolIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pool = new AssetPool(item);
                    }
                }
            }


            XmlNodeList sectorNodeList = xmlNode.SelectNodes("sector");

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

            foreach (XmlNode item in sectorNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sectorIDRef = item.Attributes["id"].Name;
                        MortgageSector ob = MortgageSector();
                        IDManager.SetID(sectorIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sectorIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sector = new MortgageSector(item);
                    }
                }
            }


            XmlNodeList trancheNodeList = xmlNode.SelectNodes("tranche");

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

            foreach (XmlNode item in trancheNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        trancheIDRef = item.Attributes["id"].Name;
                        XsdTypeToken ob = XsdTypeToken();
                        IDManager.SetID(trancheIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        trancheIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tranche = new XsdTypeToken(item);
                    }
                }
            }
        }
Пример #38
0
        public FixedAmountCalculation(XmlNode xmlNode)
        {
            XmlNode calculationAmountNode = xmlNode.SelectSingleNode("calculationAmount");

            if (calculationAmountNode != null)
            {
                if (calculationAmountNode.Attributes["href"] != null || calculationAmountNode.Attributes["id"] != null)
                {
                    if (calculationAmountNode.Attributes["id"] != null)
                    {
                        calculationAmountIDRef_ = calculationAmountNode.Attributes["id"].Value;
                        CalculationAmount ob = new CalculationAmount(calculationAmountNode);
                        IDManager.SetID(calculationAmountIDRef_, ob);
                    }
                    else if (calculationAmountNode.Attributes["href"] != null)
                    {
                        calculationAmountIDRef_ = calculationAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationAmount_ = new CalculationAmount(calculationAmountNode);
                    }
                }
                else
                {
                    calculationAmount_ = new CalculationAmount(calculationAmountNode);
                }
            }


            XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");

            if (fixedRateNode != null)
            {
                if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null)
                {
                    if (fixedRateNode.Attributes["id"] != null)
                    {
                        fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                        FixedRate ob = new FixedRate(fixedRateNode);
                        IDManager.SetID(fixedRateIDRef_, ob);
                    }
                    else if (fixedRateNode.Attributes["href"] != null)
                    {
                        fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixedRate_ = new FixedRate(fixedRateNode);
                    }
                }
                else
                {
                    fixedRate_ = new FixedRate(fixedRateNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }
        }
Пример #39
0
        public Calculation(XmlNode xmlNode)
        {
            XmlNode notionalScheduleNode = xmlNode.SelectSingleNode("notionalSchedule");

            if (notionalScheduleNode != null)
            {
                if (notionalScheduleNode.Attributes["href"] != null || notionalScheduleNode.Attributes["id"] != null)
                {
                    if (notionalScheduleNode.Attributes["id"] != null)
                    {
                        notionalScheduleIDRef_ = notionalScheduleNode.Attributes["id"].Value;
                        Notional ob = new Notional(notionalScheduleNode);
                        IDManager.SetID(notionalScheduleIDRef_, ob);
                    }
                    else if (notionalScheduleNode.Attributes["href"] != null)
                    {
                        notionalScheduleIDRef_ = notionalScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        notionalSchedule_ = new Notional(notionalScheduleNode);
                    }
                }
                else
                {
                    notionalSchedule_ = new Notional(notionalScheduleNode);
                }
            }


            XmlNode fxLinkedNotionalScheduleNode = xmlNode.SelectSingleNode("fxLinkedNotionalSchedule");

            if (fxLinkedNotionalScheduleNode != null)
            {
                if (fxLinkedNotionalScheduleNode.Attributes["href"] != null || fxLinkedNotionalScheduleNode.Attributes["id"] != null)
                {
                    if (fxLinkedNotionalScheduleNode.Attributes["id"] != null)
                    {
                        fxLinkedNotionalScheduleIDRef_ = fxLinkedNotionalScheduleNode.Attributes["id"].Value;
                        FxLinkedNotionalSchedule ob = new FxLinkedNotionalSchedule(fxLinkedNotionalScheduleNode);
                        IDManager.SetID(fxLinkedNotionalScheduleIDRef_, ob);
                    }
                    else if (fxLinkedNotionalScheduleNode.Attributes["href"] != null)
                    {
                        fxLinkedNotionalScheduleIDRef_ = fxLinkedNotionalScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fxLinkedNotionalSchedule_ = new FxLinkedNotionalSchedule(fxLinkedNotionalScheduleNode);
                    }
                }
                else
                {
                    fxLinkedNotionalSchedule_ = new FxLinkedNotionalSchedule(fxLinkedNotionalScheduleNode);
                }
            }


            XmlNode fixedRateScheduleNode = xmlNode.SelectSingleNode("fixedRateSchedule");

            if (fixedRateScheduleNode != null)
            {
                if (fixedRateScheduleNode.Attributes["href"] != null || fixedRateScheduleNode.Attributes["id"] != null)
                {
                    if (fixedRateScheduleNode.Attributes["id"] != null)
                    {
                        fixedRateScheduleIDRef_ = fixedRateScheduleNode.Attributes["id"].Value;
                        Schedule ob = new Schedule(fixedRateScheduleNode);
                        IDManager.SetID(fixedRateScheduleIDRef_, ob);
                    }
                    else if (fixedRateScheduleNode.Attributes["href"] != null)
                    {
                        fixedRateScheduleIDRef_ = fixedRateScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixedRateSchedule_ = new Schedule(fixedRateScheduleNode);
                    }
                }
                else
                {
                    fixedRateSchedule_ = new Schedule(fixedRateScheduleNode);
                }
            }


            XmlNode futureValueNotionalNode = xmlNode.SelectSingleNode("futureValueNotional");

            if (futureValueNotionalNode != null)
            {
                if (futureValueNotionalNode.Attributes["href"] != null || futureValueNotionalNode.Attributes["id"] != null)
                {
                    if (futureValueNotionalNode.Attributes["id"] != null)
                    {
                        futureValueNotionalIDRef_ = futureValueNotionalNode.Attributes["id"].Value;
                        FutureValueAmount ob = new FutureValueAmount(futureValueNotionalNode);
                        IDManager.SetID(futureValueNotionalIDRef_, ob);
                    }
                    else if (futureValueNotionalNode.Attributes["href"] != null)
                    {
                        futureValueNotionalIDRef_ = futureValueNotionalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        futureValueNotional_ = new FutureValueAmount(futureValueNotionalNode);
                    }
                }
                else
                {
                    futureValueNotional_ = new FutureValueAmount(futureValueNotionalNode);
                }
            }


            XmlNode rateCalculationNode = xmlNode.SelectSingleNode("rateCalculation");

            if (rateCalculationNode != null)
            {
                if (rateCalculationNode.Attributes["href"] != null || rateCalculationNode.Attributes["id"] != null)
                {
                    if (rateCalculationNode.Attributes["id"] != null)
                    {
                        rateCalculationIDRef_ = rateCalculationNode.Attributes["id"].Value;
                        Rate ob = new Rate(rateCalculationNode);
                        IDManager.SetID(rateCalculationIDRef_, ob);
                    }
                    else if (rateCalculationNode.Attributes["href"] != null)
                    {
                        rateCalculationIDRef_ = rateCalculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        rateCalculation_ = new Rate(rateCalculationNode);
                    }
                }
                else
                {
                    rateCalculation_ = new Rate(rateCalculationNode);
                }
            }


            XmlNode floatingRateCalculationNode = xmlNode.SelectSingleNode("floatingRateCalculation");

            if (floatingRateCalculationNode != null)
            {
                if (floatingRateCalculationNode.Attributes["href"] != null || floatingRateCalculationNode.Attributes["id"] != null)
                {
                    if (floatingRateCalculationNode.Attributes["id"] != null)
                    {
                        floatingRateCalculationIDRef_ = floatingRateCalculationNode.Attributes["id"].Value;
                        FloatingRateCalculation ob = new FloatingRateCalculation(floatingRateCalculationNode);
                        IDManager.SetID(floatingRateCalculationIDRef_, ob);
                    }
                    else if (floatingRateCalculationNode.Attributes["href"] != null)
                    {
                        floatingRateCalculationIDRef_ = floatingRateCalculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        floatingRateCalculation_ = new FloatingRateCalculation(floatingRateCalculationNode);
                    }
                }
                else
                {
                    floatingRateCalculation_ = new FloatingRateCalculation(floatingRateCalculationNode);
                }
            }


            XmlNode inflationRateCalculationNode = xmlNode.SelectSingleNode("inflationRateCalculation");

            if (inflationRateCalculationNode != null)
            {
                if (inflationRateCalculationNode.Attributes["href"] != null || inflationRateCalculationNode.Attributes["id"] != null)
                {
                    if (inflationRateCalculationNode.Attributes["id"] != null)
                    {
                        inflationRateCalculationIDRef_ = inflationRateCalculationNode.Attributes["id"].Value;
                        InflationRateCalculation ob = new InflationRateCalculation(inflationRateCalculationNode);
                        IDManager.SetID(inflationRateCalculationIDRef_, ob);
                    }
                    else if (inflationRateCalculationNode.Attributes["href"] != null)
                    {
                        inflationRateCalculationIDRef_ = inflationRateCalculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        inflationRateCalculation_ = new InflationRateCalculation(inflationRateCalculationNode);
                    }
                }
                else
                {
                    inflationRateCalculation_ = new InflationRateCalculation(inflationRateCalculationNode);
                }
            }


            XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");

            if (dayCountFractionNode != null)
            {
                if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null)
                {
                    if (dayCountFractionNode.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                        DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                        IDManager.SetID(dayCountFractionIDRef_, ob);
                    }
                    else if (dayCountFractionNode.Attributes["href"] != null)
                    {
                        dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                    }
                }
                else
                {
                    dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
                }
            }


            XmlNode discountingNode = xmlNode.SelectSingleNode("discounting");

            if (discountingNode != null)
            {
                if (discountingNode.Attributes["href"] != null || discountingNode.Attributes["id"] != null)
                {
                    if (discountingNode.Attributes["id"] != null)
                    {
                        discountingIDRef_ = discountingNode.Attributes["id"].Value;
                        Discounting ob = new Discounting(discountingNode);
                        IDManager.SetID(discountingIDRef_, ob);
                    }
                    else if (discountingNode.Attributes["href"] != null)
                    {
                        discountingIDRef_ = discountingNode.Attributes["href"].Value;
                    }
                    else
                    {
                        discounting_ = new Discounting(discountingNode);
                    }
                }
                else
                {
                    discounting_ = new Discounting(discountingNode);
                }
            }


            XmlNode compoundingMethodNode = xmlNode.SelectSingleNode("compoundingMethod");

            if (compoundingMethodNode != null)
            {
                if (compoundingMethodNode.Attributes["href"] != null || compoundingMethodNode.Attributes["id"] != null)
                {
                    if (compoundingMethodNode.Attributes["id"] != null)
                    {
                        compoundingMethodIDRef_ = compoundingMethodNode.Attributes["id"].Value;
                        CompoundingMethodEnum ob = new CompoundingMethodEnum(compoundingMethodNode);
                        IDManager.SetID(compoundingMethodIDRef_, ob);
                    }
                    else if (compoundingMethodNode.Attributes["href"] != null)
                    {
                        compoundingMethodIDRef_ = compoundingMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        compoundingMethod_ = new CompoundingMethodEnum(compoundingMethodNode);
                    }
                }
                else
                {
                    compoundingMethod_ = new CompoundingMethodEnum(compoundingMethodNode);
                }
            }
        }