// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using System.Xml; class MainClass { public static void Main(string[] args) { XmlTextReader xtr = new XmlTextReader(new StreamReader(@"C:\field.xml")); while(!xtr.EOF) { if(xtr.IsStartElement() && xtr.Name == "name") { Console.WriteLine("name = " + xtr.ReadString()); } if(xtr.IsStartElement() && xtr.Name == "allowInsert") { Console.WriteLine("allowInsert = " + xtr.ReadString()); } if(xtr.IsStartElement() && xtr.Name == "allowDelete") { Console.WriteLine("allowDelete = " + xtr.ReadString()); } xtr.Read(); } } }