I am new to XPath and I have the following problem.
I am working on a C # class that reads an XML file and uses the contents of its fields, sets the properties of an object.
In this class, I have the following instruction:
currentDeepSightVuln.Published = n_alertdocument.SelectSingleNode("./x:Published", nsmgr) == null ? DateTime.MinValue : DateTime.Parse(n_alertdocument.SelectSingleNode("./x:Published", nsmgr).InnerText);
This command sets the Published property of the currentDeepSightVuln object using the following field in the XML file:
<x:Published>Mar 11 2014</x:Published>
So, using the previous value ( March 11 2014 ), my program selected the following exception:
ex {"The string was not recognized as a valid DateTime because the day week was incorrect." } System.Exception {System.FormatException}
11 2014 19 2011 ( XML , , 19 2011 ) , .
11 2014 DateTime?
, ?