Example #1
0
        /// <summary>
        /// Removes elements that are numeric type and have NaN value.
        /// </summary>
        /// <param name="element">The XML element.</param>
        /// <returns>The xml with NaN removed.</returns>
        public static string RemoveNaNElements <T>(XElement element)
        {
            _log.Debug("Removing NaN elements.");

            var context = new WitsmlParserContext <T>(element);
            var parser  = new WitsmlParser(context);

            context.IgnoreUnknownElements = true;
            context.RemoveNaNElements     = true;
            parser.Navigate(context.Element);

            return(context.Element.ToString());
        }