예제 #1
0
        /// <summary>
        /// Attempts to classify the trades within the document using the ISDA
        /// taxonomy defined for regulatory reporting and generate an example
        /// UPI.
        /// </summary>
        /// <param name="list">A set of context elements to analyse.</param>
        private void DoIsdaClassify(XmlNodeList list)
        {
            foreach (XmlElement element in list)
            {
                XmlDocument infoset     = ProductInfoset.CreateInfoset(element);
                XmlElement  infosetRoot = infoset.DocumentElement;

                Category assetClass  = ISDATaxonomy.AssetClassForInfoset(infosetRoot);
                Category productType = ISDATaxonomy.ProductTypeForInfoset(infosetRoot);
                UPI      upi         = UPI.ForProductInfoset(infosetRoot, productType);

                System.Console.Write(": Trade (");
                System.Console.Write((assetClass != null) ? assetClass.ToString() : "UNKNOWN");
                System.Console.Write(" / ");
                System.Console.Write((productType != null) ? productType.ToString() : "UNKNOWN");
                System.Console.Write(" / ");
                System.Console.Write((upi != null) ? upi.ToString() : "UNKNOWN");
                System.Console.WriteLine(")");
            }
        }
예제 #2
0
 /// <summary>
 /// Derives a <b>UPI</b> from the values in the product infoset
 /// represented by the indicated DOM <see cref="XmlElement"/>.
 /// </summary>
 /// <param name="infoset">The root <see cref="XmlElement"/> of the product infoset.</param>
 /// <returns>The derived <b>UPI</b> instance or <c>null</c>.</returns>
 public static UPI ForProductInfoset(XmlElement infoset)
 {
     return(ForProductInfoset(infoset, ISDATaxonomy.ProductTypeForInfoset(infoset)));
 }