using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.Text;
class Program
{
static void Main(string[] args)
{
string xmlFileName = "e.xml";
XDocument customers = XDocument.Load(xmlFileName);
var queryResult = from c in customers.Descendants("customer").Attributes() select c.Name;
foreach (var item in queryResult)
{
Console.WriteLine(item);
}
}
}
|