XML Element Any Namespace - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

XML Element Any Namespace

Demo Code


using System.Xml.Linq;
using System.Linq;

public class Main{
        public static XElement ElementAnyNamespace(this XContainer root, string localName)
         {//from  ww w .  ja  v  a 2s  .c  o m
             return root.Elements().FirstOrDefault(e => e.Name.LocalName == localName);
         }
}

Related Tutorials