using System.Collections.Generic;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO.Compression;
public static void Test()
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(GetXml())))
XPathDocument xpResDoc = new XPathDocument(stream);
XPathNavigator xpNav = xpResDoc.CreateNavigator();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xpNav.NameTable);
nsmgr.AddNamespace("g2", "http://schemas.datastream.net/MP_functions/MP0118_GetGridHeaderData_001_Result");
XPathNodeIterator xpNIter = xpNav.Select("//R", nsmgr);
foreach (XPathNavigator nav in xpNIter)
var nodes = nav.Select("(.//D)[1]").Cast<XPathNavigator>().ToList();
Console.WriteLine(" Count = {0}, Result = {1}", nodes.Count, string.Join(",", nodes));
return @"<GRID xmlns:dstm=""http://schemas.datastream.net/MP_functions/MP0118_GetGridHeaderData_001_Result"">
<D>2019-09-27 10:17:36.0</D>
<D>2019-09-27 10:33:24.0</D>
<D>2019-09-27 10:36:53.0</D>
public static void Main()
Console.WriteLine("Environment version: {0} ({1})", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , GetNetCoreVersion());
Console.WriteLine("Failed with unhandled exception: ");
public static string GetNetCoreVersion()
var assembly = typeof(System.Runtime.GCSettings).GetTypeInfo().Assembly;
var assemblyPath = assembly.CodeBase.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries);
int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App");
if (netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2)
return assemblyPath[netCoreAppIndex + 1];