2002-08-17 Jason Diamond <jason@injektilo.org>
[mono.git] / mcs / class / System.XML / System.Xml.XPath / XPathDocument.cs
1 //
2 // System.Xml.XPath.XPathDocument
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // (C) Copyright 2002 Tim Coleman
8 //
9
10 using System.IO;
11 using System.Xml;
12
13 namespace System.Xml.XPath
14 {
15         [MonoTODO]
16         public class XPathDocument : IXPathNavigable
17         {
18                 XmlDocument _doc = new XmlDocument ();
19
20 #region Constructors
21
22                 public XPathDocument (Stream stream)
23                 {
24                         _doc.Load (stream);
25                 }
26
27                 public XPathDocument (string uri)
28                 {
29                         _doc.Load (uri);
30                 }
31
32                 public XPathDocument (TextReader reader)
33                 {
34                         _doc.Load (reader);
35                 }
36
37                 public XPathDocument (XmlReader reader)
38                 {
39                         _doc.Load (reader);
40                 }
41
42                 public XPathDocument (string uri, XmlSpace space)
43                 {
44                         if (space == XmlSpace.Preserve)
45                                 _doc.PreserveWhitespace = true;
46                         _doc.Load (uri);
47                 }
48
49                 public XPathDocument (XmlReader reader, XmlSpace space)
50                 {
51                         if (space == XmlSpace.Preserve)
52                                 _doc.PreserveWhitespace = true;
53                         _doc.Load (reader);
54                 }
55
56 #endregion
57
58 #region Methods
59
60                 public XPathNavigator CreateNavigator ()
61                 {
62                         return _doc.CreateNavigator ();
63                 }
64
65 #endregion
66         }
67 }
68