12 [DebuggerDisplay(
"{debuggerDisplayProxy}")]
13 [DebuggerDisplay(
"{debuggerDisplayProxy}")]
14 [global::__DynamicallyInvokable]
17 [DebuggerDisplay(
"{ToString()}")]
18 private struct XmlReaderDebuggerDisplayProxy
22 internal XmlReaderDebuggerDisplayProxy(
XmlReader reader)
27 public override string ToString()
30 string text = nodeType.ToString();
37 text = text +
", Name=\"" + reader.
Name +
"\"";
41 text = text +
", Name=\"" + reader.
Name +
"\", Value=\"" +
XmlConvert.EscapeValueForDebuggerDisplay(reader.
Value) +
"\"";
49 text = text +
", Value=\"" +
XmlConvert.EscapeValueForDebuggerDisplay(reader.
Value) +
"\"";
52 text = text +
", Name=\"" + reader.
Name +
"'";
53 text = text +
", SYSTEM=\"" + reader.
GetAttribute(
"SYSTEM") +
"\"";
54 text = text +
", PUBLIC=\"" + reader.
GetAttribute(
"PUBLIC") +
"\"";
55 text = text +
", Value=\"" +
XmlConvert.EscapeValueForDebuggerDisplay(reader.
Value) +
"\"";
62 private static uint IsTextualNodeBitmap = 24600u;
64 private static uint CanReadContentAsBitmap = 123324u;
66 private static uint HasValueBitmap = 157084u;
68 internal const int DefaultBufferSize = 4096;
70 internal const int BiggerBufferSize = 8192;
72 internal const int MaxStreamLengthForDefaultBufferSize = 65536;
74 internal const int AsyncBufferSize = 65536;
79 [global::__DynamicallyInvokable]
82 [global::__DynamicallyInvokable]
92 [global::__DynamicallyInvokable]
95 [global::__DynamicallyInvokable]
114 [global::__DynamicallyInvokable]
115 public virtual string Name 117 [global::__DynamicallyInvokable]
131 [global::__DynamicallyInvokable]
134 [global::__DynamicallyInvokable]
141 [global::__DynamicallyInvokable]
144 [global::__DynamicallyInvokable]
151 [global::__DynamicallyInvokable]
152 public abstract string Prefix 154 [global::__DynamicallyInvokable]
162 [global::__DynamicallyInvokable]
165 [global::__DynamicallyInvokable]
193 [global::__DynamicallyInvokable]
194 public abstract string Value 196 [global::__DynamicallyInvokable]
203 [global::__DynamicallyInvokable]
204 public abstract int Depth 206 [global::__DynamicallyInvokable]
213 [global::__DynamicallyInvokable]
216 [global::__DynamicallyInvokable]
224 [global::__DynamicallyInvokable]
227 [global::__DynamicallyInvokable]
235 [global::__DynamicallyInvokable]
238 [global::__DynamicallyInvokable]
253 [global::__DynamicallyInvokable]
256 [global::__DynamicallyInvokable]
266 [global::__DynamicallyInvokable]
269 [global::__DynamicallyInvokable]
284 [global::__DynamicallyInvokable]
287 [global::__DynamicallyInvokable]
290 return typeof(
string);
297 [global::__DynamicallyInvokable]
300 [global::__DynamicallyInvokable]
308 [global::__DynamicallyInvokable]
309 public virtual string this[
int i]
311 [global::__DynamicallyInvokable]
322 [global::__DynamicallyInvokable]
323 public virtual string this[
string name]
325 [global::__DynamicallyInvokable]
337 [global::__DynamicallyInvokable]
338 public virtual string this[
string name,
string namespaceURI]
340 [global::__DynamicallyInvokable]
351 [global::__DynamicallyInvokable]
352 public abstract bool EOF 354 [global::__DynamicallyInvokable]
361 [global::__DynamicallyInvokable]
364 [global::__DynamicallyInvokable]
371 [global::__DynamicallyInvokable]
374 [global::__DynamicallyInvokable]
382 [global::__DynamicallyInvokable]
385 [global::__DynamicallyInvokable]
396 [global::__DynamicallyInvokable]
399 [global::__DynamicallyInvokable]
410 [global::__DynamicallyInvokable]
413 [global::__DynamicallyInvokable]
424 [global::__DynamicallyInvokable]
427 [global::__DynamicallyInvokable]
436 internal bool IsDefaultInternal
445 if (schemaInfo !=
null && schemaInfo.
IsDefault)
453 internal virtual IDtdInfo DtdInfo =>
null;
455 private object debuggerDisplayProxy =>
new XmlReaderDebuggerDisplayProxy(
this);
462 [global::__DynamicallyInvokable]
465 if (!CanReadContentAs())
467 throw CreateReadContentAsException(
"ReadContentAsObject");
469 return InternalReadContentAsString();
477 [global::__DynamicallyInvokable]
480 if (!CanReadContentAs())
482 throw CreateReadContentAsException(
"ReadContentAsBoolean");
501 if (!CanReadContentAs())
503 throw CreateReadContentAsException(
"ReadContentAsDateTime");
518 [global::__DynamicallyInvokable]
521 if (!CanReadContentAs())
523 throw CreateReadContentAsException(
"ReadContentAsDateTimeOffset");
540 [global::__DynamicallyInvokable]
543 if (!CanReadContentAs())
545 throw CreateReadContentAsException(
"ReadContentAsDouble");
562 [global::__DynamicallyInvokable]
565 if (!CanReadContentAs())
567 throw CreateReadContentAsException(
"ReadContentAsFloat");
584 [global::__DynamicallyInvokable]
587 if (!CanReadContentAs())
589 throw CreateReadContentAsException(
"ReadContentAsDecimal");
606 [global::__DynamicallyInvokable]
609 if (!CanReadContentAs())
611 throw CreateReadContentAsException(
"ReadContentAsInt");
628 [global::__DynamicallyInvokable]
631 if (!CanReadContentAs())
633 throw CreateReadContentAsException(
"ReadContentAsLong");
650 [global::__DynamicallyInvokable]
653 if (!CanReadContentAs())
655 throw CreateReadContentAsException(
"ReadContentAsString");
657 return InternalReadContentAsString();
671 [global::__DynamicallyInvokable]
674 if (!CanReadContentAs())
676 throw CreateReadContentAsException(
"ReadContentAs");
678 string text = InternalReadContentAsString();
679 if (returnType == typeof(
string))
685 return XmlUntypedConverter.Untyped.ChangeType(text, returnType, (namespaceResolver ==
null) ? (
this as
IXmlNamespaceResolver) : namespaceResolver);
703 [global::__DynamicallyInvokable]
706 if (SetupReadElementContentAsXxx(
"ReadElementContentAsObject"))
709 FinishReadElementContentAsXxx();
724 [global::__DynamicallyInvokable]
727 CheckElement(localName, namespaceURI);
737 [global::__DynamicallyInvokable]
740 if (SetupReadElementContentAsXxx(
"ReadElementContentAsBoolean"))
743 FinishReadElementContentAsXxx();
758 [global::__DynamicallyInvokable]
761 CheckElement(localName, namespaceURI);
773 if (SetupReadElementContentAsXxx(
"ReadElementContentAsDateTime"))
776 FinishReadElementContentAsXxx();
793 CheckElement(localName, namespaceURI);
803 [global::__DynamicallyInvokable]
806 if (SetupReadElementContentAsXxx(
"ReadElementContentAsDouble"))
809 FinishReadElementContentAsXxx();
824 [global::__DynamicallyInvokable]
827 CheckElement(localName, namespaceURI);
837 [global::__DynamicallyInvokable]
840 if (SetupReadElementContentAsXxx(
"ReadElementContentAsFloat"))
843 FinishReadElementContentAsXxx();
858 [global::__DynamicallyInvokable]
861 CheckElement(localName, namespaceURI);
871 [global::__DynamicallyInvokable]
874 if (SetupReadElementContentAsXxx(
"ReadElementContentAsDecimal"))
877 FinishReadElementContentAsXxx();
892 [global::__DynamicallyInvokable]
895 CheckElement(localName, namespaceURI);
905 [global::__DynamicallyInvokable]
908 if (SetupReadElementContentAsXxx(
"ReadElementContentAsInt"))
911 FinishReadElementContentAsXxx();
926 [global::__DynamicallyInvokable]
929 CheckElement(localName, namespaceURI);
939 [global::__DynamicallyInvokable]
942 if (SetupReadElementContentAsXxx(
"ReadElementContentAsLong"))
945 FinishReadElementContentAsXxx();
960 [global::__DynamicallyInvokable]
963 CheckElement(localName, namespaceURI);
973 [global::__DynamicallyInvokable]
976 if (SetupReadElementContentAsXxx(
"ReadElementContentAsString"))
979 FinishReadElementContentAsXxx();
994 [global::__DynamicallyInvokable]
997 CheckElement(localName, namespaceURI);
1011 [global::__DynamicallyInvokable]
1014 if (SetupReadElementContentAsXxx(
"ReadElementContentAs"))
1016 object result =
ReadContentAs(returnType, namespaceResolver);
1017 FinishReadElementContentAsXxx();
1020 if (!(returnType == typeof(
string)))
1022 return XmlUntypedConverter.Untyped.ChangeType(
string.Empty, returnType, namespaceResolver);
1024 return string.Empty;
1040 [global::__DynamicallyInvokable]
1043 CheckElement(localName, namespaceURI);
1053 [global::__DynamicallyInvokable]
1063 [global::__DynamicallyInvokable]
1064 public abstract string GetAttribute(
string name,
string namespaceURI);
1072 [global::__DynamicallyInvokable]
1081 [global::__DynamicallyInvokable]
1091 [global::__DynamicallyInvokable]
1098 [global::__DynamicallyInvokable]
1107 for (
int j = 0; j < i; j++)
1117 [global::__DynamicallyInvokable]
1124 [global::__DynamicallyInvokable]
1131 [global::__DynamicallyInvokable]
1139 [global::__DynamicallyInvokable]
1147 [global::__DynamicallyInvokable]
1148 public abstract bool Read();
1158 [global::__DynamicallyInvokable]
1171 [global::__DynamicallyInvokable]
1177 [global::__DynamicallyInvokable]
1191 [global::__DynamicallyInvokable]
1194 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadContentAsBase64"));
1209 [global::__DynamicallyInvokable]
1212 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadElementContentAsBase64"));
1226 [global::__DynamicallyInvokable]
1229 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadContentAsBinHex"));
1244 [global::__DynamicallyInvokable]
1247 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadElementContentAsBinHex"));
1261 [global::__DynamicallyInvokable]
1276 return string.Empty;
1283 return string.Empty;
1291 return string.Empty;
1294 string text =
string.Empty;
1310 [global::__DynamicallyInvokable]
1339 [global::__DynamicallyInvokable]
1353 [global::__DynamicallyInvokable]
1373 [global::__DynamicallyInvokable]
1385 throw new XmlException(
"Xml_ElementNotFoundNs",
new string[2]
1399 string result =
string.Empty;
1410 throw new XmlException(
"Xml_UnexpectedNodeInSimpleContent",
new string[2]
1433 string result =
string.Empty;
1467 string result =
string.Empty;
1474 throw new XmlException(
"Xml_ElementNotFoundNs",
new string[2]
1499 [global::__DynamicallyInvokable]
1514 [global::__DynamicallyInvokable]
1526 [global::__DynamicallyInvokable]
1531 return Name == name;
1543 [global::__DynamicallyInvokable]
1563 [global::__DynamicallyInvokable]
1566 if (name ==
null || name.Length == 0)
1568 throw XmlConvert.CreateInvalidNameArgumentException(name,
"name");
1588 [global::__DynamicallyInvokable]
1591 if (localName ==
null || localName.Length == 0)
1593 throw XmlConvert.CreateInvalidNameArgumentException(localName,
"localName");
1595 if (namespaceURI ==
null)
1617 [global::__DynamicallyInvokable]
1620 if (name ==
null || name.Length == 0)
1622 throw XmlConvert.CreateInvalidNameArgumentException(name,
"name");
1655 [global::__DynamicallyInvokable]
1658 if (localName ==
null || localName.Length == 0)
1660 throw XmlConvert.CreateInvalidNameArgumentException(localName,
"localName");
1662 if (namespaceURI ==
null)
1697 [global::__DynamicallyInvokable]
1700 if (name ==
null || name.Length == 0)
1702 throw XmlConvert.CreateInvalidNameArgumentException(name,
"name");
1705 while (SkipSubtree())
1727 [global::__DynamicallyInvokable]
1730 if (localName ==
null || localName.Length == 0)
1732 throw XmlConvert.CreateInvalidNameArgumentException(localName,
"localName");
1734 if (namespaceURI ==
null)
1740 while (SkipSubtree())
1760 [global::__DynamicallyInvokable]
1767 return ValidateNames.IsNameNoNamespaces(str);
1775 [global::__DynamicallyInvokable]
1782 return ValidateNames.IsNmtokenNoNamespaces(str);
1789 [global::__DynamicallyInvokable]
1794 return string.Empty;
1799 return string.Empty;
1802 XmlWriter xmlWriter = CreateWriterForInnerOuterXml(stringWriter);
1808 WriteAttributeValue(xmlWriter);
1812 WriteNode(xmlWriter, defattr:
false);
1822 private void WriteNode(
XmlWriter xtw,
bool defattr)
1872 private void WriteAttributeValue(XmlWriter xtw)
1879 xtw.WriteEntityRef(
Name);
1883 xtw.WriteString(
Value);
1893 [global::__DynamicallyInvokable]
1898 return string.Empty;
1903 return string.Empty;
1906 XmlWriter xmlWriter = CreateWriterForInnerOuterXml(stringWriter);
1912 WriteAttributeValue(xmlWriter);
1917 xmlWriter.
WriteNode(
this, defattr:
false);
1930 SetNamespacesFlag(xmlTextWriter);
1931 return xmlTextWriter;
1934 private void SetNamespacesFlag(XmlTextWriter xtw)
1936 XmlTextReader xmlTextReader =
this as XmlTextReader;
1937 if (xmlTextReader !=
null)
1942 XmlValidatingReader xmlValidatingReader =
this as XmlValidatingReader;
1943 if (xmlValidatingReader !=
null)
1945 xtw.Namespaces = xmlValidatingReader.Namespaces;
1953 [global::__DynamicallyInvokable]
1960 return new XmlSubtreeReader(
this);
1965 [global::__DynamicallyInvokable]
1975 [global::__DynamicallyInvokable]
1984 internal static bool IsTextualNode(
XmlNodeType nodeType)
1986 return (IsTextualNodeBitmap & (1 << (
int)nodeType)) != 0;
1989 internal static bool CanReadContentAs(
XmlNodeType nodeType)
1991 return (CanReadContentAsBitmap & (1 << (
int)nodeType)) != 0;
1994 internal static bool HasValueInternal(
XmlNodeType nodeType)
1996 return (HasValueBitmap & (1 << (
int)nodeType)) != 0;
1999 private bool SkipSubtree()
2017 internal void CheckElement(
string localName,
string namespaceURI)
2019 if (localName ==
null || localName.Length == 0)
2021 throw XmlConvert.CreateInvalidNameArgumentException(localName,
"localName");
2023 if (namespaceURI ==
null)
2025 throw new ArgumentNullException(
"namespaceURI");
2029 throw new XmlException(
"Xml_InvalidNodeType",
NodeType.ToString(),
this as IXmlLineInfo);
2033 throw new XmlException(
"Xml_ElementNotFoundNs",
new string[2]
2037 },
this as IXmlLineInfo);
2041 internal Exception CreateReadContentAsException(
string methodName)
2043 return CreateReadContentAsException(methodName,
NodeType,
this as IXmlLineInfo);
2046 internal Exception CreateReadElementContentAsException(
string methodName)
2048 return CreateReadElementContentAsException(methodName,
NodeType,
this as IXmlLineInfo);
2051 internal bool CanReadContentAs()
2056 internal static Exception CreateReadContentAsException(
string methodName,
XmlNodeType nodeType, IXmlLineInfo lineInfo)
2058 return new InvalidOperationException(AddLineInfo(Res.GetString(
"Xml_InvalidReadContentAs", methodName, nodeType.ToString()), lineInfo));
2061 internal static Exception CreateReadElementContentAsException(
string methodName,
XmlNodeType nodeType, IXmlLineInfo lineInfo)
2063 return new InvalidOperationException(AddLineInfo(Res.GetString(
"Xml_InvalidReadElementContentAs", methodName, nodeType.ToString()), lineInfo));
2066 private static string AddLineInfo(
string message, IXmlLineInfo lineInfo)
2068 if (lineInfo !=
null)
2075 internal string InternalReadContentAsString()
2077 string text =
string.Empty;
2090 if (text.Length == 0)
2096 if (stringBuilder ==
null)
2099 stringBuilder.
Append(text);
2120 if (stringBuilder !=
null)
2127 private bool SetupReadElementContentAsXxx(
string methodName)
2131 throw CreateReadElementContentAsException(methodName);
2145 throw new XmlException(
"Xml_MixedReadElementContentAs",
string.Empty,
this as IXmlLineInfo);
2151 private void FinishReadElementContentAsXxx()
2155 throw new XmlException(
"Xml_InvalidNodeType",
NodeType.ToString());
2162 return GetXmlTextReaderImpl(reader)?.Encoding;
2167 return GetXmlTextReaderImpl(reader)?.V1ComformanceLevel ??
ConformanceLevel.Document;
2170 private static XmlTextReaderImpl GetXmlTextReaderImpl(
XmlReader reader)
2172 XmlTextReaderImpl xmlTextReaderImpl = reader as XmlTextReaderImpl;
2173 if (xmlTextReaderImpl !=
null)
2175 return xmlTextReaderImpl;
2177 XmlTextReader xmlTextReader = reader as XmlTextReader;
2178 if (xmlTextReader !=
null)
2180 return xmlTextReader.Impl;
2182 XmlValidatingReaderImpl xmlValidatingReaderImpl = reader as XmlValidatingReaderImpl;
2183 if (xmlValidatingReaderImpl !=
null)
2185 return xmlValidatingReaderImpl.ReaderImpl;
2187 return (reader as XmlValidatingReader)?.Impl.ReaderImpl;
2198 [global::__DynamicallyInvokable]
2201 return Create(inputUri,
null,
null);
2212 [global::__DynamicallyInvokable]
2215 return Create(inputUri, settings,
null);
2230 if (settings ==
null)
2234 return settings.CreateReader(inputUri, inputContext);
2242 [global::__DynamicallyInvokable]
2245 return Create(input,
null,
string.Empty);
2253 [global::__DynamicallyInvokable]
2256 return Create(input, settings,
string.Empty);
2268 if (settings ==
null)
2272 return settings.CreateReader(input,
null, baseUri,
null);
2281 [global::__DynamicallyInvokable]
2284 if (settings ==
null)
2288 return settings.CreateReader(input,
null,
string.Empty, inputContext);
2295 [global::__DynamicallyInvokable]
2298 return Create(input,
null,
string.Empty);
2306 [global::__DynamicallyInvokable]
2309 return Create(input, settings,
string.Empty);
2321 if (settings ==
null)
2325 return settings.CreateReader(input, baseUri,
null);
2335 [global::__DynamicallyInvokable]
2338 if (settings ==
null)
2342 return settings.CreateReader(input,
string.Empty, inputContext);
2351 [global::__DynamicallyInvokable]
2354 if (settings ==
null)
2358 return settings.CreateReader(reader);
2367 if (settings ==
null)
2369 settings =
new XmlReaderSettings();
2371 byte[] array =
new byte[CalcBufferSize(input)];
2376 num2 = input.
Read(array, num, array.Length - num);
2379 while (num2 > 0 && num < 2);
2381 if (num >= 2 && array[0] == 223 && array[1] ==
byte.MaxValue)
2383 if (inputContext !=
null)
2385 throw new ArgumentException(Res.GetString(
"XmlBinary_NoParserContext"),
"inputContext");
2387 xmlReader =
new XmlSqlBinaryReader(input, array, num,
string.Empty, settings.
CloseInput, settings);
2391 xmlReader =
new XmlTextReaderImpl(input, array, num, settings,
null,
string.Empty, inputContext, settings.
CloseInput);
2395 xmlReader = settings.AddValidation(xmlReader);
2399 xmlReader = XmlAsyncCheckReader.CreateAsyncCheckWrapper(xmlReader);
2404 internal static int CalcBufferSize(
Stream input)
2409 long length = input.
Length;
2412 num = checked((
int)length);
2414 else if (length > 65536)
2426 [global::__DynamicallyInvokable]
2436 [global::__DynamicallyInvokable]
2439 if (!CanReadContentAs())
2441 throw CreateReadContentAsException(
"ReadContentAsObject");
2443 return await InternalReadContentAsStringAsync().ConfigureAwait(continueOnCapturedContext:
false);
2450 [global::__DynamicallyInvokable]
2453 if (!CanReadContentAs())
2455 throw CreateReadContentAsException(
"ReadContentAsString");
2457 return InternalReadContentAsStringAsync();
2466 [global::__DynamicallyInvokable]
2469 if (!CanReadContentAs())
2471 throw CreateReadContentAsException(
"ReadContentAs");
2473 string text = await InternalReadContentAsStringAsync().ConfigureAwait(continueOnCapturedContext:
false);
2474 if (returnType == typeof(
string))
2480 return XmlUntypedConverter.Untyped.ChangeType(text, returnType, (namespaceResolver ==
null) ? (
this as
IXmlNamespaceResolver) : namespaceResolver);
2496 [global::__DynamicallyInvokable]
2499 if (await SetupReadElementContentAsXxxAsync(
"ReadElementContentAsObject").ConfigureAwait(continueOnCapturedContext:
false))
2502 await FinishReadElementContentAsXxxAsync().
ConfigureAwait(continueOnCapturedContext:
false);
2505 return string.Empty;
2512 [global::__DynamicallyInvokable]
2515 if (await SetupReadElementContentAsXxxAsync(
"ReadElementContentAsString").ConfigureAwait(continueOnCapturedContext:
false))
2518 await FinishReadElementContentAsXxxAsync().
ConfigureAwait(continueOnCapturedContext:
false);
2521 return string.Empty;
2530 [global::__DynamicallyInvokable]
2533 if (await SetupReadElementContentAsXxxAsync(
"ReadElementContentAs").ConfigureAwait(continueOnCapturedContext:
false))
2535 object value = await
ReadContentAsAsync(returnType, namespaceResolver).ConfigureAwait(continueOnCapturedContext:
false);
2536 await FinishReadElementContentAsXxxAsync().
ConfigureAwait(continueOnCapturedContext:
false);
2539 return (returnType == typeof(
string)) ?
string.Empty : XmlUntypedConverter.Untyped.ChangeType(
string.Empty, returnType, namespaceResolver);
2547 [global::__DynamicallyInvokable]
2557 [global::__DynamicallyInvokable]
2562 return AsyncHelper.DoneTask;
2564 return SkipSubtreeAsync();
2574 [global::__DynamicallyInvokable]
2577 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadContentAsBase64"));
2587 [global::__DynamicallyInvokable]
2590 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadElementContentAsBase64"));
2600 [global::__DynamicallyInvokable]
2603 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadContentAsBinHex"));
2613 [global::__DynamicallyInvokable]
2616 throw new NotSupportedException(Res.GetString(
"Xml_ReadBinaryContentNotSupported",
"ReadElementContentAsBinHex"));
2626 [global::__DynamicallyInvokable]
2636 [global::__DynamicallyInvokable]
2658 while (await
ReadAsync().ConfigureAwait(continueOnCapturedContext:
false));
2666 [global::__DynamicallyInvokable]
2671 return string.Empty;
2676 return string.Empty;
2679 XmlWriter xtw = CreateWriterForInnerOuterXml(sw);
2685 WriteAttributeValue(xtw);
2689 await WriteNodeAsync(xtw, defattr:
false).
ConfigureAwait(continueOnCapturedContext:
false);
2699 private async
Task WriteNodeAsync(
XmlWriter xtw,
bool defattr)
2753 [global::__DynamicallyInvokable]
2758 return string.Empty;
2763 return string.Empty;
2766 XmlWriter xmlWriter = CreateWriterForInnerOuterXml(stringWriter);
2772 WriteAttributeValue(xmlWriter);
2777 xmlWriter.
WriteNode(
this, defattr:
false);
2793 while (await
ReadAsync().ConfigureAwait(continueOnCapturedContext:
false) && depth <
Depth)
2805 internal async
Task<string> InternalReadContentAsStringAsync()
2807 string value =
string.Empty;
2820 if (value.Length == 0)
2822 value = await
GetValueAsync().ConfigureAwait(continueOnCapturedContext:
false);
2832 stringBuilder.
Append(await
GetValueAsync().ConfigureAwait(continueOnCapturedContext:
false));
2851 return (sb ==
null) ? value : sb.
ToString();
2854 private async
Task<bool> SetupReadElementContentAsXxxAsync(
string methodName)
2858 throw CreateReadElementContentAsException(methodName);
2872 throw new XmlException(
"Xml_MixedReadElementContentAs",
string.Empty,
this as IXmlLineInfo);
2878 private Task FinishReadElementContentAsXxxAsync()
2882 throw new XmlException(
"Xml_InvalidNodeType",
NodeType.ToString());
2888 [global::__DynamicallyInvokable]
virtual long ReadContentAsLong()
Reads the text content at the current position as a 64-bit signed integer.
Represents a character encoding.To browse the .NET Framework source code for this type,...
Provides an interface to enable a class to return line and position information.
abstract void ResolveEntity()
When overridden in a derived class, resolves the entity reference for EntityReference nodes.
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
abstract string BaseURI
When overridden in a derived class, gets the base URI of the current node.
virtual bool ReadElementContentAsBoolean()
Reads the current element and returns the contents as a T:System.Boolean object.
bool Async
Gets or sets whether asynchronous T:System.Xml.XmlReader methods can be used on a particular T:System...
static DateTime ToDateTime(string s)
Converts the T:System.String to a T:System.DateTime equivalent.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static float ToSingle(string s)
Converts the T:System.String to a T:System.Single equivalent.
abstract string LookupNamespace(string prefix)
When overridden in a derived class, resolves a namespace prefix in the current element's scope.
The exception that is thrown when there is an attempt to dereference a null object reference.
abstract int Read([In] [Out] byte[] buffer, int offset, int count)
When overridden in a derived class, reads a sequence of bytes from the current stream and advances th...
virtual bool CanReadBinaryContent
Gets a value indicating whether the T:System.Xml.XmlReader implements the binary content read methods...
virtual bool IsDefault
When overridden in a derived class, gets a value indicating whether the current node is an attribute ...
Defines the post-schema-validation infoset of a validated XML node.
virtual bool HasValue
When overridden in a derived class, gets a value indicating whether the current node can have a P:Sys...
Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Un...
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Configures an awaiter used to await this T:System.Threading.Tasks.Task`1.
override string Add(string key)
Atomizes the specified string and adds it to the NameTable.
virtual int ReadContentAsBinHex(byte[] buffer, int index, int count)
Reads the content and returns the BinHex decoded binary bytes.
abstract bool MoveToElement()
When overridden in a derived class, moves to the element that contains the current attribute node.
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
virtual Task< string > ReadContentAsStringAsync()
Asynchronously reads the text content at the current position as a T:System.String object.
virtual decimal ReadContentAsDecimal()
Reads the text content at the current position as a T:System.Decimal object.
virtual DateTime ReadElementContentAsDateTime(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
abstract string LocalName
When overridden in a derived class, gets the local name of the current node.
Implements a T:System.IO.TextWriter for writing information to a string. The information is stored in...
abstract bool CanSeek
When overridden in a derived class, gets a value indicating whether the current stream supports seeki...
static XmlReader Create(Stream input, XmlReaderSettings settings)
Creates a new T:System.Xml.XmlReader instance with the specified stream and settings.
virtual bool ReadElementContentAsBoolean(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
virtual float ReadElementContentAsFloat(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
static XmlReader Create(string inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
Creates a new T:System.Xml.XmlReader instance by using the specified URI, settings,...
virtual void Skip()
Skips the children of the current node.
EditorBrowsableState
Specifies the browsable state of a property or method from within an editor.
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
virtual Task< bool > ReadAsync()
Asynchronously reads the next node from the stream.
static long ToInt64(string s)
Converts the T:System.String to a T:System.Int64 equivalent.
virtual long ReadElementContentAsLong()
Reads the current element and returns the contents as a 64-bit signed integer.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
The exception that is thrown for invalid casting or explicit conversion.
virtual DateTime ReadElementContentAsDateTime()
Reads the current element and returns the contents as a T:System.DateTime object.
override string ToString()
Returns a String representing the name of the current Type.
abstract void WriteEndAttribute()
When overridden in a derived class, closes the previous M:System.Xml.XmlWriter.WriteStartAttribute(Sy...
virtual string ReadElementContentAsString()
Reads the current element and returns the contents as a T:System.String object.
virtual Task< string > GetValueAsync()
Asynchronously gets the value of the current node.
abstract string NamespaceURI
When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specifica...
void WriteStartAttribute(string localName, string ns)
Writes the start of an attribute with the specified local name and namespace URI.
abstract void WriteWhitespace(string ws)
When overridden in a derived class, writes out the given white space.
virtual char QuoteChar
When overridden in a derived class, gets the quotation mark character used to enclose the value of an...
static XmlReader Create(XmlReader reader, XmlReaderSettings settings)
Creates a new T:System.Xml.XmlReader instance by using the specified XML reader and settings.
virtual async Task< object > ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
Asynchronously reads the content as an object of the type specified.
virtual bool ReadToNextSibling(string name)
Advances the XmlReader to the next sibling element with the specified qualified name.
virtual XmlNodeType MoveToContent()
Checks whether the current node is a content (non-white space text, CDATA, Element,...
abstract bool MoveToAttribute(string name)
When overridden in a derived class, moves to the attribute with the specified P:System....
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
virtual object ReadElementContentAsObject(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
XmlNodeType
Specifies the type of node.
virtual bool ReadToNextSibling(string localName, string namespaceURI)
Advances the XmlReader to the next sibling element with the specified local name and namespace URI.
virtual Task< int > ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
Asynchronously reads the content and returns the BinHex decoded binary bytes.
abstract void WriteString(string text)
When overridden in a derived class, writes the given text content.
Specifies a set of features to support on the T:System.Xml.XmlReader object created by the Overload:S...
static bool IsNameToken(string str)
Returns a value indicating whether or not the string argument is a valid XML name token.
static XmlReader Create(TextReader input, XmlReaderSettings settings)
Creates a new T:System.Xml.XmlReader instance by using the specified text reader and settings.
virtual Task< int > ReadValueChunkAsync(char[] buffer, int index, int count)
Asynchronously reads large streams of text embedded in an XML document.
virtual Task SkipAsync()
Asynchronously skips the children of the current node.
abstract XmlNodeType NodeType
When overridden in a derived class, gets the type of the current node.
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files t...
Provides all the context information required by the T:System.Xml.XmlReader to parse an XML fragment.
Represents a reader that provides fast, noncached, forward-only access to XML data....
virtual IXmlSchemaInfo SchemaInfo
Gets the schema information that has been assigned to the current node as a result of schema validati...
abstract bool MoveToFirstAttribute()
When overridden in a derived class, moves to the first attribute.
virtual int ReadElementContentAsBinHex(byte[] buffer, int index, int count)
Reads the element and decodes the BinHex content.
Implements a single-threaded T:System.Xml.XmlNameTable.
abstract bool EOF
When overridden in a derived class, gets a value indicating whether the reader is positioned at the e...
virtual string Name
When overridden in a derived class, gets the qualified name of the current node.
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
override string ToString()
Returns a string containing the characters written to the current StringWriter so far.
virtual bool HasAttributes
Gets a value indicating whether the current node has any attributes.
virtual async Task< string > ReadElementContentAsStringAsync()
Asynchronously reads the current element and returns the contents as a T:System.String object.
static XmlReader Create(TextReader input, XmlReaderSettings settings, XmlParserContext inputContext)
Creates a new T:System.Xml.XmlReader instance by using the specified text reader, settings,...
virtual bool IsStartElement()
Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or em...
static XmlReader Create(Stream input)
Creates a new T:System.Xml.XmlReader instance using the specified stream with default settings.
virtual bool ReadContentAsBoolean()
Reads the text content at the current position as a Boolean.
virtual object ReadContentAsObject()
Reads the text content at the current position as an T:System.Object.
virtual XmlReader ReadSubtree()
Returns a new XmlReader instance that can be used to read the current node, and all its descendants.
ConformanceLevel
Specifies the amount of input or output checking that T:System.Xml.XmlReader and T:System....
abstract void WriteFullEndElement()
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
abstract int Depth
When overridden in a derived class, gets the depth of the current node in the XML document.
virtual void MoveToAttribute(int i)
When overridden in a derived class, moves to the attribute with the specified index.
virtual void ReadEndElement()
Checks that the current content node is an end tag and advances the reader to the next node.
virtual async Task< string > ReadInnerXmlAsync()
Asynchronously reads all the content, including markup, as a string.
Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files...
virtual string ReadElementString(string localname, string ns)
Checks that the P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI properties o...
Resolves, adds, and removes namespaces to a collection and provides scope management for these namesp...
void Dispose()
Releases all resources used by the current instance of the T:System.Xml.XmlReader class.
virtual float ReadElementContentAsFloat()
Reads the current element and returns the contents as single-precision floating-point number.
virtual XmlReaderSettings Settings
Gets the T:System.Xml.XmlReaderSettings object used to create this T:System.Xml.XmlReader instance.
virtual bool ReadToDescendant(string name)
Advances the T:System.Xml.XmlReader to the next descendant element with the specified qualified name.
virtual bool IsStartElement(string name)
Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or em...
virtual int ReadElementContentAsBase64(byte[] buffer, int index, int count)
Reads the element and decodes the Base64 content.
virtual string ReadElementString(string name)
Checks that the P:System.Xml.XmlReader.Name property of the element found matches the given string be...
virtual async Task< string > ReadOuterXmlAsync()
Asynchronously reads the content, including markup, representing this node and all its children.
virtual DateTimeOffset ReadContentAsDateTimeOffset()
Reads the text content at the current position as a T:System.DateTimeOffset object.
abstract void WriteCData(string text)
When overridden in a derived class, writes out a <![CDATA[...]]> block containing the specified text.
static bool IsName(string str)
Returns a value indicating whether the string argument is a valid XML name.
virtual void ReadStartElement(string name)
Checks that the current content node is an element with the given P:System.Xml.XmlReader....
virtual object ReadElementContentAsObject()
Reads the current element and returns the contents as an T:System.Object.
Represents type declarations: class types, interface types, array types, value types,...
abstract void WriteDocType(string name, string pubid, string sysid, string subset)
When overridden in a derived class, writes the DOCTYPE declaration with the specified name and option...
virtual async Task< object > ReadElementContentAsObjectAsync()
Asynchronously reads the current element and returns the contents as an T:System.Object.
virtual bool IsStartElement(string localname, string ns)
Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or em...
virtual int ReadValueChunk(char[] buffer, int index, int count)
Reads large streams of text embedded in an XML document.
abstract void WriteEndElement()
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
Table of atomized string objects.
virtual decimal ReadElementContentAsDecimal(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
virtual bool CanReadValueChunk
Gets a value indicating whether the T:System.Xml.XmlReader implements the M:System....
ReadState
Specifies the state of the reader.
virtual long ReadElementContentAsLong(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
abstract bool MoveToNextAttribute()
When overridden in a derived class, moves to the next attribute.
virtual bool CanResolveEntity
Gets a value indicating whether this reader can parse and resolve entities.
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
virtual double ReadElementContentAsDouble(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
Reads the element content as the requested type.
Returns detailed information about the last exception.
abstract string GetAttribute(string name)
When overridden in a derived class, gets the value of the attribute with the specified P:System....
virtual int ReadElementContentAsInt()
Reads the current element and returns the contents as a 32-bit signed integer.
abstract void WriteEntityRef(string name)
When overridden in a derived class, writes out an entity reference as &name;.
abstract long Length
When overridden in a derived class, gets the length in bytes of the stream.
abstract bool Read()
When overridden in a derived class, reads the next node from the stream.
virtual void ReadStartElement()
Checks that the current node is an element and advances the reader to the next node.
virtual void Close()
When overridden in a derived class, closes this stream and the underlying stream.
virtual string ReadElementString()
Reads a text-only element. However, we recommend that you use the M:System.Xml.XmlReader....
virtual Task< int > ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
Asynchronously reads the element and decodes the BinHex content.
abstract string Prefix
When overridden in a derived class, gets the namespace prefix associated with the current node.
virtual void WriteNode(XmlReader reader, bool defattr)
When overridden in a derived class, copies everything from the reader to the writer and moves the rea...
virtual string XmlLang
When overridden in a derived class, gets the current xml:lang scope.
virtual float ReadContentAsFloat()
Reads the text content at the current position as a single-precision floating point number.
virtual int ReadElementContentAsInt(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
virtual bool ReadToFollowing(string name)
Reads until an element with the specified qualified name is found.
virtual double ReadContentAsDouble()
Reads the text content at the current position as a double-precision floating-point number.
virtual bool ReadToFollowing(string localName, string namespaceURI)
Reads until an element with the specified local name and namespace URI is found.
Represents a reader that can read a sequential series of characters.
Provides read-only access to a set of prefix and namespace mappings.
virtual DateTime ReadContentAsDateTime()
Reads the text content at the current position as a T:System.DateTime object.
static bool ToBoolean(string s)
Converts the T:System.String to a T:System.Boolean equivalent.
abstract bool IsEmptyElement
When overridden in a derived class, gets a value indicating whether the current node is an empty elem...
virtual string ReadString()
When overridden in a derived class, reads the contents of an element or text node as a string....
virtual object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
Reads the content as an object of the type specified.
virtual void Dispose(bool disposing)
Releases the unmanaged resources used by the T:System.Xml.XmlReader and optionally releases the manag...
abstract void WriteComment(string text)
When overridden in a derived class, writes out a comment <!–...–> containing the specified text.
virtual void WriteAttributes(XmlReader reader, bool defattr)
When overridden in a derived class, writes out all the attributes found at the current position in th...
virtual int ReadContentAsInt()
Reads the text content at the current position as a 32-bit signed integer.
bool Namespaces
Gets or sets a value indicating whether to do namespace support.
virtual string ReadElementContentAsString(string localName, string namespaceURI)
Checks that the specified local name and namespace URI matches that of the current element,...
virtual async Task< object > ReadContentAsObjectAsync()
Asynchronously reads the text content at the current position as an T:System.Object.
static decimal ToDecimal(string s)
Converts the T:System.String to a T:System.Decimal equivalent.
static XmlReader Create(TextReader input, XmlReaderSettings settings, string baseUri)
Creates a new T:System.Xml.XmlReader instance by using the specified text reader, settings,...
virtual int ReadContentAsBase64(byte[] buffer, int index, int count)
Reads the content and returns the Base64 decoded binary bytes.
The exception that is thrown when a method call is invalid for the object's current state.
ValidationType ValidationType
Gets or sets a value indicating whether the T:System.Xml.XmlReader will perform validation or type as...
virtual decimal ReadElementContentAsDecimal()
Reads the current element and returns the contents as a T:System.Decimal object.
virtual Task< int > ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
Asynchronously reads the element and decodes the Base64 content.
virtual Task< int > ReadContentAsBase64Async(byte[] buffer, int index, int count)
Asynchronously reads the content and returns the Base64 decoded binary bytes.
abstract void WriteProcessingInstruction(string name, string text)
When overridden in a derived class, writes out a processing instruction with a space between the name...
virtual async Task< XmlNodeType > MoveToContentAsync()
Asynchronously checks whether the current node is a content node. If the node is not a content node,...
XmlSpace
Specifies the current xml:space scope.
virtual string ReadContentAsString()
Reads the text content at the current position as a T:System.String object.
Provides information about a specific culture (called a locale for unmanaged code development)....
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
bool CloseInput
Gets or sets a value indicating whether the underlying stream or T:System.IO.TextReader should be clo...
virtual async Task< object > ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
Asynchronously reads the element content as the requested type.
abstract int AttributeCount
When overridden in a derived class, gets the number of attributes on the current node.
abstract string Value
When overridden in a derived class, gets the text value of the current node.
static DateTimeOffset ToDateTimeOffset(string s)
Converts the supplied T:System.String to a T:System.DateTimeOffset equivalent.
static int ToInt32(string s)
Converts the T:System.String to a T:System.Int32 equivalent.
abstract bool ReadAttributeValue()
When overridden in a derived class, parses the attribute value into one or more Text,...
virtual bool ReadToDescendant(string localName, string namespaceURI)
Advances the T:System.Xml.XmlReader to the next descendant element with the specified local name and ...
static XmlReader Create(Stream input, XmlReaderSettings settings, string baseUri)
Creates a new T:System.Xml.XmlReader instance using the specified stream, base URI,...
static XmlReader Create(TextReader input)
Creates a new T:System.Xml.XmlReader instance by using the specified text reader.
The exception that is thrown when a requested method or operation is not implemented.
static XmlReader Create(string inputUri)
Creates a new T:System.Xml.XmlReader instance with specified URI.
Provides the base class for value types.
XmlDateTimeSerializationMode
Specifies how to treat the time value when converting between string and T:System....
XmlReader()
Initializes a new instance of the XmlReader class.
virtual void ReadStartElement(string localname, string ns)
Checks that the current content node is an element with the given P:System.Xml.XmlReader....
virtual double ReadElementContentAsDouble()
Reads the current element and returns the contents as a double-precision floating-point number.
virtual void Close()
When overridden in a derived class, changes the P:System.Xml.XmlReader.ReadState to F:System....
static XmlReader Create(string inputUri, XmlReaderSettings settings)
Creates a new T:System.Xml.XmlReader instance by using the specified URI and settings.
virtual string ReadOuterXml()
When overridden in a derived class, reads the content, including markup, representing this node and a...
static XmlReader Create(Stream input, XmlReaderSettings settings, XmlParserContext inputContext)
Creates a new T:System.Xml.XmlReader instance using the specified stream, settings,...
Encodes and decodes XML names, and provides methods for converting between common language runtime ty...
Represents an asynchronous operation that can return a value.
bool IsDefault
Gets a value indicating if this validated XML node was set as the result of a default being applied d...
void WriteStartElement(string localName, string ns)
When overridden in a derived class, writes the specified start tag and associates it with the given n...
static double ToDouble(string s)
Converts the T:System.String to a T:System.Double equivalent.
Provides a generic view of a sequence of bytes. This is an abstract class.To browse the ....
virtual string ReadInnerXml()
When overridden in a derived class, reads all the content, including markup, as a string.