XPathDocument.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // System.Xml.XPath.XPathDocument
  3. //
  4. // Authors:
  5. // Tim Coleman ([email protected])
  6. // Atsushi Enomoto ([email protected])
  7. //
  8. // (C) Copyright 2002 Tim Coleman
  9. // (C) 2003 Atsushi Enomoto
  10. //
  11. using System;
  12. using System.Collections;
  13. using System.IO;
  14. using System.Xml;
  15. using System.Xml.Schema;
  16. using Mono.Xml.XPath;
  17. namespace System.Xml.XPath
  18. {
  19. public class XPathDocument : IXPathNavigable
  20. {
  21. DTMXPathDocument document;
  22. #region Constructors
  23. public XPathDocument (Stream stream)
  24. : this (new XmlTextReader (stream))
  25. {
  26. }
  27. public XPathDocument (string uri)
  28. : this (new XmlTextReader (uri))
  29. {
  30. }
  31. public XPathDocument (TextReader reader)
  32. : this (new XmlTextReader (reader))
  33. {
  34. }
  35. public XPathDocument (XmlReader reader)
  36. : this (reader, XmlSpace.None)
  37. {
  38. }
  39. public XPathDocument (string uri, XmlSpace space)
  40. : this (new XmlTextReader (uri), space)
  41. {
  42. }
  43. public XPathDocument (XmlReader reader, XmlSpace space)
  44. {
  45. document = new DTMXPathDocumentBuilder (reader, space).CreateDocument ();
  46. }
  47. #endregion
  48. #region Methods
  49. public XPathNavigator CreateNavigator ()
  50. {
  51. return document.CreateNavigator ();
  52. }
  53. #endregion
  54. }
  55. }