Fix a big in Close () method - close the underlying stream.
[mono.git] / mcs / class / System.XML / System.Xml / XPathEditor.cs
1 //\r
2 // XPathEditor.cs\r
3 //\r
4 // Author:\r
5 //      Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>\r
6 //\r
7 // (C)2003 Atsushi Enomoto\r
8 //\r
9 \r
10 #if NET_1_2\r
11 \r
12 using System;\r
13 using System.Collections;\r
14 using System.Collections.Specialized;\r
15 using System.ComponentModel;\r
16 using System.IO;\r
17 using System.Security.Policy;\r
18 using System.Xml.Schema;\r
19 using System.Xml.XPath;\r
20 //using Mono.Xml.XPath2;\r
21 //using MS.Internal.Xml;\r
22 \r
23 namespace System.Xml\r
24 {\r
25         public abstract class XPathEditor : XPathNavigator2, IXPathEditor\r
26         {\r
27                 protected XPathEditor ()\r
28                 {\r
29                 }\r
30 \r
31                 public abstract XPathNavigator2 CloneAsNavigator ();\r
32 \r
33                 public abstract XmlWriter CreateAttributes ();\r
34 \r
35                 // TODO: Where to use schemaType?\r
36                 public void CreateAttributeString (string prefix, string name, string ns, XmlSchemaType schemaType, string value)\r
37                 {\r
38                         XmlWriter xw = CreateAttributes ();\r
39                         xw.WriteAttributeString (prefix, name, ns, value);\r
40                         xw.Close ();\r
41                 }\r
42 \r
43                 public abstract XmlWriter CreateFirstChild ();\r
44 \r
45                 public abstract void CreateFirstChild (string xmlFragments);\r
46 \r
47                 // TODO: Where to use schemaType?\r
48                 public void CreateFirstChildElement (string prefix, string name, string ns, XmlSchemaType schemaType, string value)\r
49                 {\r
50                         XmlWriter xw = CreateFirstChild ();\r
51                         xw.WriteStartElement (prefix, name, ns);\r
52                         xw.WriteString (value);\r
53                         xw.WriteEndElement ();\r
54                         xw.Close ();\r
55                 }\r
56 \r
57                 public abstract XmlWriter CreateNextSibling ();\r
58                 public abstract void CreateNextSibling (string xmlFragment);\r
59 \r
60                 // TODO: Where to use schemaType?\r
61                 public void CreateNextSiblingElement (string prefix, string name, string ns, XmlSchemaType schemaType, string value)\r
62                 {\r
63                         XmlWriter xw = CreateNextSibling ();\r
64                         xw.WriteStartElement (prefix, name, ns);\r
65                         xw.WriteString (value);\r
66                         xw.WriteEndElement ();\r
67                         xw.Close ();\r
68                 }\r
69 \r
70                 public abstract void DeleteCurrent ();\r
71 \r
72                 public abstract void SetValue (string text);\r
73         }\r
74 }\r
75 \r
76 #endif\r