mscorlib(4.0.0.0) API with additions
XmlParserContext.cs
1 using System.Text;
2 
3 namespace System.Xml
4 {
6  [global::__DynamicallyInvokable]
7  public class XmlParserContext
8  {
9  private XmlNameTable _nt;
10 
11  private XmlNamespaceManager _nsMgr;
12 
13  private string _docTypeName = string.Empty;
14 
15  private string _pubId = string.Empty;
16 
17  private string _sysId = string.Empty;
18 
19  private string _internalSubset = string.Empty;
20 
21  private string _xmlLang = string.Empty;
22 
23  private XmlSpace _xmlSpace;
24 
25  private string _baseURI = string.Empty;
26 
27  private Encoding _encoding;
28 
31  [global::__DynamicallyInvokable]
32  public XmlNameTable NameTable
33  {
34  [global::__DynamicallyInvokable]
35  get
36  {
37  return _nt;
38  }
39  [global::__DynamicallyInvokable]
40  set
41  {
42  _nt = value;
43  }
44  }
45 
48  [global::__DynamicallyInvokable]
50  {
51  [global::__DynamicallyInvokable]
52  get
53  {
54  return _nsMgr;
55  }
56  [global::__DynamicallyInvokable]
57  set
58  {
59  _nsMgr = value;
60  }
61  }
62 
65  [global::__DynamicallyInvokable]
66  public string DocTypeName
67  {
68  [global::__DynamicallyInvokable]
69  get
70  {
71  return _docTypeName;
72  }
73  [global::__DynamicallyInvokable]
74  set
75  {
76  _docTypeName = ((value == null) ? string.Empty : value);
77  }
78  }
79 
82  [global::__DynamicallyInvokable]
83  public string PublicId
84  {
85  [global::__DynamicallyInvokable]
86  get
87  {
88  return _pubId;
89  }
90  [global::__DynamicallyInvokable]
91  set
92  {
93  _pubId = ((value == null) ? string.Empty : value);
94  }
95  }
96 
99  [global::__DynamicallyInvokable]
100  public string SystemId
101  {
102  [global::__DynamicallyInvokable]
103  get
104  {
105  return _sysId;
106  }
107  [global::__DynamicallyInvokable]
108  set
109  {
110  _sysId = ((value == null) ? string.Empty : value);
111  }
112  }
113 
116  [global::__DynamicallyInvokable]
117  public string BaseURI
118  {
119  [global::__DynamicallyInvokable]
120  get
121  {
122  return _baseURI;
123  }
124  [global::__DynamicallyInvokable]
125  set
126  {
127  _baseURI = ((value == null) ? string.Empty : value);
128  }
129  }
130 
133  [global::__DynamicallyInvokable]
134  public string InternalSubset
135  {
136  [global::__DynamicallyInvokable]
137  get
138  {
139  return _internalSubset;
140  }
141  [global::__DynamicallyInvokable]
142  set
143  {
144  _internalSubset = ((value == null) ? string.Empty : value);
145  }
146  }
147 
150  [global::__DynamicallyInvokable]
151  public string XmlLang
152  {
153  [global::__DynamicallyInvokable]
154  get
155  {
156  return _xmlLang;
157  }
158  [global::__DynamicallyInvokable]
159  set
160  {
161  _xmlLang = ((value == null) ? string.Empty : value);
162  }
163  }
164 
167  [global::__DynamicallyInvokable]
168  public XmlSpace XmlSpace
169  {
170  [global::__DynamicallyInvokable]
171  get
172  {
173  return _xmlSpace;
174  }
175  [global::__DynamicallyInvokable]
176  set
177  {
178  _xmlSpace = value;
179  }
180  }
181 
184  [global::__DynamicallyInvokable]
185  public Encoding Encoding
186  {
187  [global::__DynamicallyInvokable]
188  get
189  {
190  return _encoding;
191  }
192  [global::__DynamicallyInvokable]
193  set
194  {
195  _encoding = value;
196  }
197  }
198 
199  internal bool HasDtdInfo
200  {
201  get
202  {
203  if (!(_internalSubset != string.Empty) && !(_pubId != string.Empty))
204  {
205  return _sysId != string.Empty;
206  }
207  return true;
208  }
209  }
210 
218  [global::__DynamicallyInvokable]
219  public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace)
220  : this(nt, nsMgr, null, null, null, null, string.Empty, xmlLang, xmlSpace)
221  {
222  }
223 
232  [global::__DynamicallyInvokable]
233  public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace, Encoding enc)
234  : this(nt, nsMgr, null, null, null, null, string.Empty, xmlLang, xmlSpace, enc)
235  {
236  }
237 
250  [global::__DynamicallyInvokable]
251  public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace)
252  : this(nt, nsMgr, docTypeName, pubId, sysId, internalSubset, baseURI, xmlLang, xmlSpace, null)
253  {
254  }
255 
269  [global::__DynamicallyInvokable]
270  public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace, Encoding enc)
271  {
272  if (nsMgr != null)
273  {
274  if (nt == null)
275  {
276  _nt = nsMgr.NameTable;
277  }
278  else
279  {
280  if (nt != nsMgr.NameTable)
281  {
282  throw new XmlException("Xml_NotSameNametable", string.Empty);
283  }
284  _nt = nt;
285  }
286  }
287  else
288  {
289  _nt = nt;
290  }
291  _nsMgr = nsMgr;
292  _docTypeName = ((docTypeName == null) ? string.Empty : docTypeName);
293  _pubId = ((pubId == null) ? string.Empty : pubId);
294  _sysId = ((sysId == null) ? string.Empty : sysId);
295  _internalSubset = ((internalSubset == null) ? string.Empty : internalSubset);
296  _baseURI = ((baseURI == null) ? string.Empty : baseURI);
297  _xmlLang = ((xmlLang == null) ? string.Empty : xmlLang);
298  _xmlSpace = xmlSpace;
299  _encoding = enc;
300  }
301  }
302 }
Represents a character encoding.To browse the .NET Framework source code for this type,...
Definition: Encoding.cs:15
XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace)
Initializes a new instance of the XmlParserContext class with the specified T:System....
XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace, Encoding enc)
Initializes a new instance of the XmlParserContext class with the specified T:System....
XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace)
Initializes a new instance of the XmlParserContext class with the specified T:System....
XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace, Encoding enc)
Initializes a new instance of the XmlParserContext class with the specified T:System....
Definition: __Canon.cs:3
XmlNamespaceManager NamespaceManager
Gets or sets the T:System.Xml.XmlNamespaceManager.
string? InternalSubset
Gets or sets the internal DTD subset.
string? DocTypeName
Gets or sets the name of the document type declaration.
Provides all the context information required by the T:System.Xml.XmlReader to parse an XML fragment.
Implements a single-threaded T:System.Xml.XmlNameTable.
Definition: NameTable.cs:5
string? PublicId
Gets or sets the public identifier.
string? SystemId
Gets or sets the system identifier.
Resolves, adds, and removes namespaces to a collection and provides scope management for these namesp...
virtual XmlNameTable NameTable
Gets the T:System.Xml.XmlNameTable associated with this object.
string? BaseURI
Gets or sets the base URI.
string? XmlLang
Gets or sets the current xml:lang scope.
Table of atomized string objects.
Definition: XmlNameTable.cs:5
Returns detailed information about the last exception.
Definition: XmlException.cs:12
XmlSpace
Specifies the current xml:space scope.
Definition: XmlSpace.cs:5