04/03/30 22:40
>>96
string xmlName = @"C:\Documents and Settings\****\XML ファイル名";
XmlDocument xdoc = new XmlDocument();
xdoc.Load(xmlName);
XmlElement elem = xdoc.DocumentElement;
int i = 1;
foreach(XmlNode person in elem.GetElementsByTagName("person"))
{
Console.Write("{0}人目 名前「{1}」 生年月日「{2}年 {3}月{4}日」\n",
i,
person["name"].InnerText,
person["birth"].Attributes["year"].Value,
person["birth"].Attributes["month"].Value,
person["birth"].Attributes["day"].Value);
++i;
}