Get XML Elements Any Namespace - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

Get XML Elements Any Namespace

Demo Code


using System.Xml.Linq;
using System.Linq;
using System.Collections.Generic;

public class Main{
        public static IEnumerable<XElement> ElementsAnyNS<T>(this IEnumerable<T> source, string localName) where T : XContainer
        {//from   w w w . j  a va2s.c o  m
            return source.Elements().Where(e => e.Name.LocalName == localName);
        }
}

Related Tutorials