CSharp examples for System.Xml:XPath
Select Single XML Text Int
using System.Xml; using System;//from www . j ava 2s.c o m public class Main{ public static int? SelectSingleTextInt(XmlNode node, string selector, int? defaultValue = null) { workNode = node.SelectSingleNode(selector, Manager); if (workNode != null && int.TryParse(workNode.InnerText, out iTryParse)) { return iTryParse; } return defaultValue; } }