CSharp examples for System.Xml:XPath
Select Single XML Text Date Time
using System.Xml; using System;//from ww w . j a v a 2s.co m public class Main{ public static DateTime? SelectSingleTextDateTime(XmlNode node, string selector, DateTime? defaultValue = null) { workNode = node.SelectSingleNode(selector, Manager); if (workNode != null && DateTime.TryParse(workNode.InnerText, out dtTryParse)) { return dtTryParse; } return defaultValue; } }