Get XML Attribute - CSharp System.Xml

CSharp examples for System.Xml:XML Attribute

Description

Get XML Attribute

Demo Code

// Permission is hereby granted, free of charge, to any person obtaining
using System.Xml;
using System.Collections.Generic;
using System;/*from   ww  w.j  a v  a 2 s  . com*/

public class Main{
        #region Attributes

        public static string GetAttribute(XmlNode node, string name)
        {
            XmlAttribute attr = node.Attributes[name];
            return attr == null ? null : attr.Value;
        }
}

Related Tutorials