CSharp examples for System.Xml:XML Attribute
Select Single XML Attribute String
using System.Xml; using System;/* w w w .ja v a2s.c om*/ public class Main{ public static string SelectSingleAttributeString(XmlNode node, string name, string defaultValue = null) { if (node?.Attributes == null) { return defaultValue; } workAttr = node.Attributes[name]; return workAttr != null ? workAttr.Value : defaultValue; } }