XPathDocument.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // System.Xml.XPath.XPathDocument
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // (C) Copyright 2002 Tim Coleman
  8. //
  9. using System.IO;
  10. using System.Xml;
  11. namespace System.Xml.XPath
  12. {
  13. [MonoTODO]
  14. public class XPathDocument : IXPathNavigable
  15. {
  16. XmlDocument _doc = new XmlDocument ();
  17. #region Constructors
  18. public XPathDocument (Stream stream)
  19. {
  20. _doc.Load (stream);
  21. }
  22. public XPathDocument (string uri)
  23. {
  24. _doc.Load (uri);
  25. }
  26. public XPathDocument (TextReader reader)
  27. {
  28. _doc.Load (reader);
  29. }
  30. public XPathDocument (XmlReader reader)
  31. {
  32. _doc.Load (reader);
  33. }
  34. public XPathDocument (string uri, XmlSpace space)
  35. {
  36. if (space == XmlSpace.Preserve)
  37. _doc.PreserveWhitespace = true;
  38. _doc.Load (uri);
  39. }
  40. public XPathDocument (XmlReader reader, XmlSpace space)
  41. {
  42. if (space == XmlSpace.Preserve)
  43. _doc.PreserveWhitespace = true;
  44. _doc.Load (reader);
  45. }
  46. #endregion
  47. #region Methods
  48. public XPathNavigator CreateNavigator ()
  49. {
  50. return _doc.CreateNavigator ();
  51. }
  52. #endregion
  53. }
  54. }