Driver.cs 997 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  2. //
  3. // Driver.cs
  4. //
  5. // Author:
  6. // Jason Diamond ([email protected])
  7. //
  8. // (C) 2001 Jason Diamond http://injektilo.org/
  9. //
  10. using System;
  11. using System.Xml;
  12. public class Driver
  13. {
  14. public static void Main(string[] args)
  15. {
  16. XmlReader xmlReader = null;
  17. if (args.Length < 1)
  18. {
  19. xmlReader = new XmlTextReader(Console.In);
  20. }
  21. else
  22. {
  23. xmlReader = new XmlTextReader(args[0]);
  24. }
  25. while (xmlReader.Read())
  26. {
  27. Console.WriteLine("NodeType = {0}", xmlReader.NodeType);
  28. Console.WriteLine(" Name = {0}", xmlReader.Name);
  29. Console.WriteLine(" IsEmptyElement = {0}", xmlReader.IsEmptyElement);
  30. Console.WriteLine(" HasAttributes = {0}", xmlReader.HasAttributes);
  31. Console.WriteLine(" AttributeCount = {0}", xmlReader.AttributeCount);
  32. Console.WriteLine(" HasValue = {0}", xmlReader.HasValue);
  33. Console.WriteLine(" Value = {0}", xmlReader.Value);
  34. }
  35. }
  36. }