mscorlib(4.0.0.0) API with additions
System.Xml.XmlReader Class Referenceabstract

Represents a reader that provides fast, noncached, forward-only access to XML data.To browse the .NET Framework source code for this type, see the Reference Source. More...

Inheritance diagram for System.Xml.XmlReader:
[legend]
Collaboration diagram for System.Xml.XmlReader:
[legend]

Public Member Functions

virtual object ReadContentAsObject ()
 Reads the text content at the current position as an T:System.Object. More...
 
virtual bool ReadContentAsBoolean ()
 Reads the text content at the current position as a Boolean. More...
 
virtual DateTime ReadContentAsDateTime ()
 Reads the text content at the current position as a T:System.DateTime object. More...
 
virtual DateTimeOffset ReadContentAsDateTimeOffset ()
 Reads the text content at the current position as a T:System.DateTimeOffset object. More...
 
virtual double ReadContentAsDouble ()
 Reads the text content at the current position as a double-precision floating-point number. More...
 
virtual float ReadContentAsFloat ()
 Reads the text content at the current position as a single-precision floating point number. More...
 
virtual decimal ReadContentAsDecimal ()
 Reads the text content at the current position as a T:System.Decimal object. More...
 
virtual int ReadContentAsInt ()
 Reads the text content at the current position as a 32-bit signed integer. More...
 
virtual long ReadContentAsLong ()
 Reads the text content at the current position as a 64-bit signed integer. More...
 
virtual string ReadContentAsString ()
 Reads the text content at the current position as a T:System.String object. More...
 
virtual object ReadContentAs (Type returnType, IXmlNamespaceResolver namespaceResolver)
 Reads the content as an object of the type specified. More...
 
virtual object ReadElementContentAsObject ()
 Reads the current element and returns the contents as an T:System.Object. More...
 
virtual object ReadElementContentAsObject (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as an T:System.Object. More...
 
virtual bool ReadElementContentAsBoolean ()
 Reads the current element and returns the contents as a T:System.Boolean object. More...
 
virtual bool ReadElementContentAsBoolean (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.Boolean object. More...
 
virtual DateTime ReadElementContentAsDateTime ()
 Reads the current element and returns the contents as a T:System.DateTime object. More...
 
virtual DateTime ReadElementContentAsDateTime (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.DateTime object. More...
 
virtual double ReadElementContentAsDouble ()
 Reads the current element and returns the contents as a double-precision floating-point number. More...
 
virtual double ReadElementContentAsDouble (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a double-precision floating-point number. More...
 
virtual float ReadElementContentAsFloat ()
 Reads the current element and returns the contents as single-precision floating-point number. More...
 
virtual float ReadElementContentAsFloat (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a single-precision floating-point number. More...
 
virtual decimal ReadElementContentAsDecimal ()
 Reads the current element and returns the contents as a T:System.Decimal object. More...
 
virtual decimal ReadElementContentAsDecimal (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.Decimal object. More...
 
virtual int ReadElementContentAsInt ()
 Reads the current element and returns the contents as a 32-bit signed integer. More...
 
virtual int ReadElementContentAsInt (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 32-bit signed integer. More...
 
virtual long ReadElementContentAsLong ()
 Reads the current element and returns the contents as a 64-bit signed integer. More...
 
virtual long ReadElementContentAsLong (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 64-bit signed integer. More...
 
virtual string ReadElementContentAsString ()
 Reads the current element and returns the contents as a T:System.String object. More...
 
virtual string ReadElementContentAsString (string localName, string namespaceURI)
 Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.String object. More...
 
virtual object ReadElementContentAs (Type returnType, IXmlNamespaceResolver namespaceResolver)
 Reads the element content as the requested type. More...
 
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, then reads the element content as the requested type. More...
 
abstract string GetAttribute (string name)
 When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.Name. More...
 
abstract string GetAttribute (string name, string namespaceURI)
 When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI. More...
 
abstract string GetAttribute (int i)
 When overridden in a derived class, gets the value of the attribute with the specified index. More...
 
abstract bool MoveToAttribute (string name)
 When overridden in a derived class, moves to the attribute with the specified P:System.Xml.XmlReader.Name. More...
 
abstract bool MoveToAttribute (string name, string ns)
 When overridden in a derived class, moves to the attribute with the specified P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI. More...
 
virtual void MoveToAttribute (int i)
 When overridden in a derived class, moves to the attribute with the specified index. More...
 
abstract bool MoveToFirstAttribute ()
 When overridden in a derived class, moves to the first attribute. More...
 
abstract bool MoveToNextAttribute ()
 When overridden in a derived class, moves to the next attribute. More...
 
abstract bool MoveToElement ()
 When overridden in a derived class, moves to the element that contains the current attribute node. More...
 
abstract bool ReadAttributeValue ()
 When overridden in a derived class, parses the attribute value into one or more Text, EntityReference, or EndEntity nodes. More...
 
abstract bool Read ()
 When overridden in a derived class, reads the next node from the stream. More...
 
virtual void Close ()
 When overridden in a derived class, changes the P:System.Xml.XmlReader.ReadState to F:System.Xml.ReadState.Closed. More...
 
virtual void Skip ()
 Skips the children of the current node. More...
 
abstract string LookupNamespace (string prefix)
 When overridden in a derived class, resolves a namespace prefix in the current element's scope. More...
 
abstract void ResolveEntity ()
 When overridden in a derived class, resolves the entity reference for EntityReference nodes. More...
 
virtual int ReadContentAsBase64 (byte[] buffer, int index, int count)
 Reads the content and returns the Base64 decoded binary bytes. More...
 
virtual int ReadElementContentAsBase64 (byte[] buffer, int index, int count)
 Reads the element and decodes the Base64 content. More...
 
virtual int ReadContentAsBinHex (byte[] buffer, int index, int count)
 Reads the content and returns the BinHex decoded binary bytes. More...
 
virtual int ReadElementContentAsBinHex (byte[] buffer, int index, int count)
 Reads the element and decodes the BinHex content. More...
 
virtual int ReadValueChunk (char[] buffer, int index, int count)
 Reads large streams of text embedded in an XML document. More...
 
virtual string ReadString ()
 When overridden in a derived class, reads the contents of an element or text node as a string. However, we recommend that you use the Overload:System.Xml.XmlReader.ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation. More...
 
virtual XmlNodeType MoveToContent ()
 Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following type: ProcessingInstruction, DocumentType, Comment, Whitespace, or SignificantWhitespace. More...
 
virtual void ReadStartElement ()
 Checks that the current node is an element and advances the reader to the next node. More...
 
virtual void ReadStartElement (string name)
 Checks that the current content node is an element with the given P:System.Xml.XmlReader.Name and advances the reader to the next node. More...
 
virtual void ReadStartElement (string localname, string ns)
 Checks that the current content node is an element with the given P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI and advances the reader to the next node. More...
 
virtual string ReadElementString ()
 Reads a text-only element. However, we recommend that you use the M:System.Xml.XmlReader.ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation. More...
 
virtual string ReadElementString (string name)
 Checks that the P:System.Xml.XmlReader.Name property of the element found matches the given string before reading a text-only element. However, we recommend that you use the M:System.Xml.XmlReader.ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation. More...
 
virtual string ReadElementString (string localname, string ns)
 Checks that the P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the M:System.Xml.XmlReader.ReadElementContentAsString(System.String,System.String) method instead, because it provides a more straightforward way to handle this operation. More...
 
virtual void ReadEndElement ()
 Checks that the current content node is an end tag and advances the reader to the next node. More...
 
virtual bool IsStartElement ()
 Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or empty element tag. More...
 
virtual bool IsStartElement (string name)
 Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or empty element tag and if the P:System.Xml.XmlReader.Name property of the element found matches the given argument. More...
 
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 empty element tag and if the P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI properties of the element found match the given strings. More...
 
virtual bool ReadToFollowing (string name)
 Reads until an element with the specified qualified name is found. More...
 
virtual bool ReadToFollowing (string localName, string namespaceURI)
 Reads until an element with the specified local name and namespace URI is found. More...
 
virtual bool ReadToDescendant (string name)
 Advances the T:System.Xml.XmlReader to the next descendant element with the specified qualified name. More...
 
virtual bool ReadToDescendant (string localName, string namespaceURI)
 Advances the T:System.Xml.XmlReader to the next descendant element with the specified local name and namespace URI. More...
 
virtual bool ReadToNextSibling (string name)
 Advances the XmlReader to the next sibling element with the specified qualified name. More...
 
virtual bool ReadToNextSibling (string localName, string namespaceURI)
 Advances the XmlReader to the next sibling element with the specified local name and namespace URI. More...
 
virtual string ReadInnerXml ()
 When overridden in a derived class, reads all the content, including markup, as a string. More...
 
virtual string ReadOuterXml ()
 When overridden in a derived class, reads the content, including markup, representing this node and all its children. More...
 
virtual XmlReader ReadSubtree ()
 Returns a new XmlReader instance that can be used to read the current node, and all its descendants. More...
 
void Dispose ()
 Releases all resources used by the current instance of the T:System.Xml.XmlReader class. More...
 
virtual Task< string > GetValueAsync ()
 Asynchronously gets the value of the current node. More...
 
virtual async Task< object > ReadContentAsObjectAsync ()
 Asynchronously reads the text content at the current position as an T:System.Object. More...
 
virtual Task< string > ReadContentAsStringAsync ()
 Asynchronously reads the text content at the current position as a T:System.String object. More...
 
virtual async Task< object > ReadContentAsAsync (Type returnType, IXmlNamespaceResolver namespaceResolver)
 Asynchronously reads the content as an object of the type specified. More...
 
virtual async Task< object > ReadElementContentAsObjectAsync ()
 Asynchronously reads the current element and returns the contents as an T:System.Object. More...
 
virtual async Task< string > ReadElementContentAsStringAsync ()
 Asynchronously reads the current element and returns the contents as a T:System.String object. More...
 
virtual async Task< object > ReadElementContentAsAsync (Type returnType, IXmlNamespaceResolver namespaceResolver)
 Asynchronously reads the element content as the requested type. More...
 
virtual Task< bool > ReadAsync ()
 Asynchronously reads the next node from the stream. More...
 
virtual Task SkipAsync ()
 Asynchronously skips the children of the current node. More...
 
virtual Task< int > ReadContentAsBase64Async (byte[] buffer, int index, int count)
 Asynchronously reads the content and returns the Base64 decoded binary bytes. More...
 
virtual Task< int > ReadElementContentAsBase64Async (byte[] buffer, int index, int count)
 Asynchronously reads the element and decodes the Base64 content. More...
 
virtual Task< int > ReadContentAsBinHexAsync (byte[] buffer, int index, int count)
 Asynchronously reads the content and returns the BinHex decoded binary bytes. More...
 
virtual Task< int > ReadElementContentAsBinHexAsync (byte[] buffer, int index, int count)
 Asynchronously reads the element and decodes the BinHex content. More...
 
virtual Task< int > ReadValueChunkAsync (char[] buffer, int index, int count)
 Asynchronously reads large streams of text embedded in an XML document. More...
 
virtual async Task< XmlNodeTypeMoveToContentAsync ()
 Asynchronously checks whether the current node is a content node. If the node is not a content node, the reader skips ahead to the next content node or end of file. More...
 
virtual async Task< string > ReadInnerXmlAsync ()
 Asynchronously reads all the content, including markup, as a string. More...
 
virtual async Task< string > ReadOuterXmlAsync ()
 Asynchronously reads the content, including markup, representing this node and all its children. More...
 

Static Public Member Functions

static bool IsName (string str)
 Returns a value indicating whether the string argument is a valid XML name. More...
 
static bool IsNameToken (string str)
 Returns a value indicating whether or not the string argument is a valid XML name token. More...
 
static XmlReader Create (string inputUri)
 Creates a new T:System.Xml.XmlReader instance with specified URI. More...
 
static XmlReader Create (string inputUri, XmlReaderSettings settings)
 Creates a new T:System.Xml.XmlReader instance by using the specified URI and settings. More...
 
static XmlReader Create (string inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
 Creates a new T:System.Xml.XmlReader instance by using the specified URI, settings, and context information for parsing. More...
 
static XmlReader Create (Stream input)
 Creates a new T:System.Xml.XmlReader instance using the specified stream with default settings. More...
 
static XmlReader Create (Stream input, XmlReaderSettings settings)
 Creates a new T:System.Xml.XmlReader instance with the specified stream and settings. More...
 
static XmlReader Create (Stream input, XmlReaderSettings settings, string baseUri)
 Creates a new T:System.Xml.XmlReader instance using the specified stream, base URI, and settings. More...
 
static XmlReader Create (Stream input, XmlReaderSettings settings, XmlParserContext inputContext)
 Creates a new T:System.Xml.XmlReader instance using the specified stream, settings, and context information for parsing. More...
 
static XmlReader Create (TextReader input)
 Creates a new T:System.Xml.XmlReader instance by using the specified text reader. More...
 
static XmlReader Create (TextReader input, XmlReaderSettings settings)
 Creates a new T:System.Xml.XmlReader instance by using the specified text reader and settings. More...
 
static XmlReader Create (TextReader input, XmlReaderSettings settings, string baseUri)
 Creates a new T:System.Xml.XmlReader instance by using the specified text reader, settings, and base URI. More...
 
static XmlReader Create (TextReader input, XmlReaderSettings settings, XmlParserContext inputContext)
 Creates a new T:System.Xml.XmlReader instance by using the specified text reader, settings, and context information for parsing. More...
 
static XmlReader Create (XmlReader reader, XmlReaderSettings settings)
 Creates a new T:System.Xml.XmlReader instance by using the specified XML reader and settings. More...
 

Public Attributes

virtual char QuoteChar => '"'
 When overridden in a derived class, gets the quotation mark character used to enclose the value of an attribute node. More...
 
virtual IXmlSchemaInfo SchemaInfo => this as IXmlSchemaInfo
 Gets the schema information that has been assigned to the current node as a result of schema validation. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Releases the unmanaged resources used by the T:System.Xml.XmlReader and optionally releases the managed resources. More...
 
 XmlReader ()
 Initializes a new instance of the XmlReader class. More...
 

Properties

virtual XmlReaderSettings Settings [get]
 Gets the T:System.Xml.XmlReaderSettings object used to create this T:System.Xml.XmlReader instance. More...
 
abstract XmlNodeType NodeType [get]
 When overridden in a derived class, gets the type of the current node. More...
 
virtual string Name [get]
 When overridden in a derived class, gets the qualified name of the current node. More...
 
abstract string LocalName [get]
 When overridden in a derived class, gets the local name of the current node. More...
 
abstract string NamespaceURI [get]
 When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned. More...
 
abstract string Prefix [get]
 When overridden in a derived class, gets the namespace prefix associated with the current node. More...
 
virtual bool HasValue [get]
 When overridden in a derived class, gets a value indicating whether the current node can have a P:System.Xml.XmlReader.Value. More...
 
abstract string Value [get]
 When overridden in a derived class, gets the text value of the current node. More...
 
abstract int Depth [get]
 When overridden in a derived class, gets the depth of the current node in the XML document. More...
 
abstract string BaseURI [get]
 When overridden in a derived class, gets the base URI of the current node. More...
 
abstract bool IsEmptyElement [get]
 When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, <MyElement/>). More...
 
virtual bool IsDefault [get]
 When overridden in a derived class, gets a value indicating whether the current node is an attribute that was generated from the default value defined in the DTD or schema. More...
 
virtual XmlSpace XmlSpace [get]
 When overridden in a derived class, gets the current xml:space scope. More...
 
virtual string XmlLang [get]
 When overridden in a derived class, gets the current xml:lang scope. More...
 
virtual Type ValueType [get]
 Gets The Common Language Runtime (CLR) type for the current node. More...
 
abstract int AttributeCount [get]
 When overridden in a derived class, gets the number of attributes on the current node. More...
 
virtual string this[int i] [get]
 When overridden in a derived class, gets the value of the attribute with the specified index. More...
 
virtual string this[string name] [get]
 When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.Name. More...
 
virtual string this[string name, string namespaceURI] [get]
 When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI. More...
 
abstract bool EOF [get]
 When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream. More...
 
abstract ReadState ReadState [get]
 When overridden in a derived class, gets the state of the reader. More...
 
abstract XmlNameTable NameTable [get]
 When overridden in a derived class, gets the T:System.Xml.XmlNameTable associated with this implementation. More...
 
virtual bool CanResolveEntity [get]
 Gets a value indicating whether this reader can parse and resolve entities. More...
 
virtual bool CanReadBinaryContent [get]
 Gets a value indicating whether the T:System.Xml.XmlReader implements the binary content read methods. More...
 
virtual bool CanReadValueChunk [get]
 Gets a value indicating whether the T:System.Xml.XmlReader implements the M:System.Xml.XmlReader.ReadValueChunk(System.Char[],System.Int32,System.Int32) method. More...
 
virtual bool HasAttributes [get]
 Gets a value indicating whether the current node has any attributes. More...
 

Detailed Description

Represents a reader that provides fast, noncached, forward-only access to XML data.To browse the .NET Framework source code for this type, see the Reference Source.

Definition at line 15 of file XmlReader.cs.

Constructor & Destructor Documentation

◆ XmlReader()

System.Xml.XmlReader.XmlReader ( )
protected

Initializes a new instance of the XmlReader class.

Definition at line 2889 of file XmlReader.cs.

Member Function Documentation

◆ Close()

virtual void System.Xml.XmlReader.Close ( )
virtual

When overridden in a derived class, changes the P:System.Xml.XmlReader.ReadState to F:System.Xml.ReadState.Closed.

Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

Definition at line 1152 of file XmlReader.cs.

◆ Create() [1/12]

static XmlReader System.Xml.XmlReader.Create ( string  inputUri)
static

Creates a new T:System.Xml.XmlReader instance with specified URI.

Parameters
inputUriThe URI for the file that contains the XML data. The T:System.Xml.XmlUrlResolver class is used to convert the path to a canonical data representation.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe inputUri value is null.
T:System.Security.SecurityExceptionThe T:System.Xml.XmlReader does not have sufficient permissions to access the location of the XML data.
T:System.IO.FileNotFoundExceptionThe file identified by the URI does not exist.
T:System.UriFormatExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI format is not correct.

Definition at line 2199 of file XmlReader.cs.

◆ Create() [2/12]

static XmlReader System.Xml.XmlReader.Create ( string  inputUri,
XmlReaderSettings  settings 
)
static

Creates a new T:System.Xml.XmlReader instance by using the specified URI and settings.

Parameters
inputUriThe URI for the file containing the XML data. The T:System.Xml.XmlResolver object on the T:System.Xml.XmlReaderSettings object is used to convert the path to a canonical data representation. If P:System.Xml.XmlReaderSettings.XmlResolver is null, a new T:System.Xml.XmlUrlResolver object is used.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe inputUri value is null.
T:System.IO.FileNotFoundExceptionThe file specified by the URI cannot be found.
T:System.UriFormatExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI format is not correct.

Definition at line 2213 of file XmlReader.cs.

◆ Create() [3/12]

static XmlReader System.Xml.XmlReader.Create ( string  inputUri,
XmlReaderSettings  settings,
XmlParserContext  inputContext 
)
static

Creates a new T:System.Xml.XmlReader instance by using the specified URI, settings, and context information for parsing.

Parameters
inputUriThe URI for the file containing the XML data. The T:System.Xml.XmlResolver object on the T:System.Xml.XmlReaderSettings object is used to convert the path to a canonical data representation. If P:System.Xml.XmlReaderSettings.XmlResolver is null, a new T:System.Xml.XmlUrlResolver object is used.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
inputContextThe context information required to parse the XML fragment. The context information can include the T:System.Xml.XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be null.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe inputUri value is null.
T:System.Security.SecurityExceptionThe T:System.Xml.XmlReader does not have sufficient permissions to access the location of the XML data.
T:System.ArgumentExceptionThe P:System.Xml.XmlReaderSettings.NameTable and P:System.Xml.XmlParserContext.NameTable properties both contain values. (Only one of these NameTable properties can be set and used).
T:System.IO.FileNotFoundExceptionThe file specified by the URI cannot be found.
T:System.UriFormatExceptionThe URI format is not correct.

Definition at line 2228 of file XmlReader.cs.

◆ Create() [4/12]

static XmlReader System.Xml.XmlReader.Create ( Stream  input)
static

Creates a new T:System.Xml.XmlReader instance using the specified stream with default settings.

Parameters
inputThe stream that contains the XML data.The T:System.Xml.XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.
T:System.Security.SecurityExceptionThe T:System.Xml.XmlReader does not have sufficient permissions to access the location of the XML data.

Definition at line 2243 of file XmlReader.cs.

◆ Create() [5/12]

static XmlReader System.Xml.XmlReader.Create ( Stream  input,
XmlReaderSettings  settings 
)
static

Creates a new T:System.Xml.XmlReader instance with the specified stream and settings.

Parameters
inputThe stream that contains the XML data.The T:System.Xml.XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.

Definition at line 2254 of file XmlReader.cs.

◆ Create() [6/12]

static XmlReader System.Xml.XmlReader.Create ( Stream  input,
XmlReaderSettings  settings,
string  baseUri 
)
static

Creates a new T:System.Xml.XmlReader instance using the specified stream, base URI, and settings.

Parameters
inputThe stream that contains the XML data. The T:System.Xml.XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
baseUriThe base URI for the entity or document being read. This value can be null. Security Note   The base URI is used to resolve the relative URI of the XML document. Do not use a base URI from an untrusted source.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.

Definition at line 2266 of file XmlReader.cs.

◆ Create() [7/12]

static XmlReader System.Xml.XmlReader.Create ( Stream  input,
XmlReaderSettings  settings,
XmlParserContext  inputContext 
)
static

Creates a new T:System.Xml.XmlReader instance using the specified stream, settings, and context information for parsing.

Parameters
inputThe stream that contains the XML data. The T:System.Xml.XmlReader scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
inputContextThe context information required to parse the XML fragment. The context information can include the T:System.Xml.XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be null.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.

Definition at line 2282 of file XmlReader.cs.

◆ Create() [8/12]

static XmlReader System.Xml.XmlReader.Create ( TextReader  input)
static

Creates a new T:System.Xml.XmlReader instance by using the specified text reader.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration is not used by the XML reader to decode the data stream.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.

Definition at line 2296 of file XmlReader.cs.

◆ Create() [9/12]

static XmlReader System.Xml.XmlReader.Create ( TextReader  input,
XmlReaderSettings  settings 
)
static

Creates a new T:System.Xml.XmlReader instance by using the specified text reader and settings.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XML reader to decode the data stream.
settingsThe settings for the new T:System.Xml.XmlReader. This value can be null.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.

Definition at line 2307 of file XmlReader.cs.

◆ Create() [10/12]

static XmlReader System.Xml.XmlReader.Create ( TextReader  input,
XmlReaderSettings  settings,
string  baseUri 
)
static

Creates a new T:System.Xml.XmlReader instance by using the specified text reader, settings, and base URI.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the T:System.Xml.XmlReader to decode the data stream.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
baseUriThe base URI for the entity or document being read. This value can be null. Security Note   The base URI is used to resolve the relative URI of the XML document. Do not use a base URI from an untrusted source.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.

Definition at line 2319 of file XmlReader.cs.

◆ Create() [11/12]

static XmlReader System.Xml.XmlReader.Create ( TextReader  input,
XmlReaderSettings  settings,
XmlParserContext  inputContext 
)
static

Creates a new T:System.Xml.XmlReader instance by using the specified text reader, settings, and context information for parsing.

Parameters
inputThe text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XML reader to decode the data stream.
settingsThe settings for the new T:System.Xml.XmlReader instance. This value can be null.
inputContextThe context information required to parse the XML fragment. The context information can include the T:System.Xml.XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition.This value can be null.
Returns
An object that is used to read the XML data in the stream.
Exceptions
T:System.ArgumentNullExceptionThe input value is null.
T:System.ArgumentExceptionThe P:System.Xml.XmlReaderSettings.NameTable and P:System.Xml.XmlParserContext.NameTable properties both contain values. (Only one of these NameTable properties can be set and used).

Definition at line 2336 of file XmlReader.cs.

◆ Create() [12/12]

static XmlReader System.Xml.XmlReader.Create ( XmlReader  reader,
XmlReaderSettings  settings 
)
static

Creates a new T:System.Xml.XmlReader instance by using the specified XML reader and settings.

Parameters
readerThe object that you want to use as the underlying XML reader.
settingsThe settings for the new T:System.Xml.XmlReader instance.The conformance level of the T:System.Xml.XmlReaderSettings object must either match the conformance level of the underlying reader, or it must be set to F:System.Xml.ConformanceLevel.Auto.
Returns
An object that is wrapped around the specified T:System.Xml.XmlReader object.
Exceptions
T:System.ArgumentNullExceptionThe reader value is null.
T:System.InvalidOperationExceptionIf the T:System.Xml.XmlReaderSettings object specifies a conformance level that is not consistent with conformance level of the underlying reader.-or-The underlying T:System.Xml.XmlReader is in an F:System.Xml.ReadState.Error or F:System.Xml.ReadState.Closed state.

Definition at line 2352 of file XmlReader.cs.

◆ Dispose() [1/2]

void System.Xml.XmlReader.Dispose ( )

Releases all resources used by the current instance of the T:System.Xml.XmlReader class.

Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implements System.IDisposable.

Definition at line 1966 of file XmlReader.cs.

◆ Dispose() [2/2]

virtual void System.Xml.XmlReader.Dispose ( bool  disposing)
protectedvirtual

Releases the unmanaged resources used by the T:System.Xml.XmlReader and optionally releases the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1976 of file XmlReader.cs.

◆ GetAttribute() [1/3]

abstract string System.Xml.XmlReader.GetAttribute ( string  name)
pure virtual

When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.Name.

Parameters
nameThe qualified name of the attribute.
Returns
The value of the specified attribute. If the attribute is not found or the value is String.Empty, null is returned.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ GetAttribute() [2/3]

abstract string System.Xml.XmlReader.GetAttribute ( string  name,
string  namespaceURI 
)
pure virtual

When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI.

Parameters
nameThe local name of the attribute.
namespaceURIThe namespace URI of the attribute.
Returns
The value of the specified attribute. If the attribute is not found or the value is String.Empty, null is returned. This method does not move the reader.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ GetAttribute() [3/3]

abstract string System.Xml.XmlReader.GetAttribute ( int  i)
pure virtual

When overridden in a derived class, gets the value of the attribute with the specified index.

Parameters
iThe index of the attribute. The index is zero-based. (The first attribute has index 0.)
Returns
The value of the specified attribute. This method does not move the reader.
Exceptions
T:System.ArgumentOutOfRangeExceptioni is out of range. It must be non-negative and less than the size of the attribute collection.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ GetValueAsync()

virtual Task<string> System.Xml.XmlReader.GetValueAsync ( )
virtual

Asynchronously gets the value of the current node.

Returns
The value of the current node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2427 of file XmlReader.cs.

◆ IsName()

static bool System.Xml.XmlReader.IsName ( string  str)
static

Returns a value indicating whether the string argument is a valid XML name.

Parameters
strThe name to validate.
Returns
true if the name is valid; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionThe str value is null.

Definition at line 1761 of file XmlReader.cs.

◆ IsNameToken()

static bool System.Xml.XmlReader.IsNameToken ( string  str)
static

Returns a value indicating whether or not the string argument is a valid XML name token.

Parameters
strThe name token to validate.
Returns
true if it is a valid name token; otherwise false.
Exceptions
T:System.ArgumentNullExceptionThe str value is null.

Definition at line 1776 of file XmlReader.cs.

◆ IsStartElement() [1/3]

virtual bool System.Xml.XmlReader.IsStartElement ( )
virtual

Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or empty element tag.

Returns
true if M:System.Xml.XmlReader.MoveToContent finds a start tag or empty element tag; false if a node type other than XmlNodeType.Element was found.
Exceptions
T:System.Xml.XmlExceptionIncorrect XML is encountered in the input stream.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1515 of file XmlReader.cs.

◆ IsStartElement() [2/3]

virtual bool System.Xml.XmlReader.IsStartElement ( string  name)
virtual

Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or empty element tag and if the P:System.Xml.XmlReader.Name property of the element found matches the given argument.

Parameters
nameThe string matched against the Name property of the element found.
Returns
true if the resulting node is an element and the Name property matches the specified string. false if a node type other than XmlNodeType.Element was found or if the element Name property does not match the specified string.
Exceptions
T:System.Xml.XmlExceptionIncorrect XML is encountered in the input stream.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1527 of file XmlReader.cs.

◆ IsStartElement() [3/3]

virtual bool System.Xml.XmlReader.IsStartElement ( string  localname,
string  ns 
)
virtual

Calls M:System.Xml.XmlReader.MoveToContent and tests if the current content node is a start tag or empty element tag and if the P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI properties of the element found match the given strings.

Parameters
localnameThe string to match against the LocalName property of the element found.
nsThe string to match against the NamespaceURI property of the element found.
Returns
true if the resulting node is an element. false if a node type other than XmlNodeType.Element was found or if the LocalName and NamespaceURI properties of the element do not match the specified strings.
Exceptions
T:System.Xml.XmlExceptionIncorrect XML is encountered in the input stream.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1544 of file XmlReader.cs.

◆ LookupNamespace()

abstract string System.Xml.XmlReader.LookupNamespace ( string  prefix)
pure virtual

When overridden in a derived class, resolves a namespace prefix in the current element's scope.

Parameters
prefixThe prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string.
Returns
The namespace URI to which the prefix maps or null if no matching prefix is found.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

◆ MoveToAttribute() [1/3]

abstract bool System.Xml.XmlReader.MoveToAttribute ( string  name)
pure virtual

When overridden in a derived class, moves to the attribute with the specified P:System.Xml.XmlReader.Name.

Parameters
nameThe qualified name of the attribute.
Returns
true if the attribute is found; otherwise, false. If false, the reader's position does not change.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentExceptionThe parameter is an empty string.

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ MoveToAttribute() [2/3]

abstract bool System.Xml.XmlReader.MoveToAttribute ( string  name,
string  ns 
)
pure virtual

When overridden in a derived class, moves to the attribute with the specified P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI.

Parameters
nameThe local name of the attribute.
nsThe namespace URI of the attribute.
Returns
true if the attribute is found; otherwise, false. If false, the reader's position does not change.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentNullExceptionBoth parameter values are null.

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ MoveToAttribute() [3/3]

virtual void System.Xml.XmlReader.MoveToAttribute ( int  i)
virtual

When overridden in a derived class, moves to the attribute with the specified index.

Parameters
iThe index of the attribute.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentOutOfRangeExceptionThe parameter has a negative value.

Reimplemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

Definition at line 1099 of file XmlReader.cs.

◆ MoveToContent()

virtual XmlNodeType System.Xml.XmlReader.MoveToContent ( )
virtual

Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following type: ProcessingInstruction, DocumentType, Comment, Whitespace, or SignificantWhitespace.

Returns
The P:System.Xml.XmlReader.NodeType of the current node found by the method or XmlNodeType.None if the reader has reached the end of the input stream.
Exceptions
T:System.Xml.XmlExceptionIncorrect XML encountered in the input stream.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1311 of file XmlReader.cs.

◆ MoveToContentAsync()

virtual async Task<XmlNodeType> System.Xml.XmlReader.MoveToContentAsync ( )
virtual

Asynchronously checks whether the current node is a content node. If the node is not a content node, the reader skips ahead to the next content node or end of file.

Returns
The P:System.Xml.XmlReader.NodeType of the current node found by the method or XmlNodeType.None if the reader has reached the end of the input stream.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2637 of file XmlReader.cs.

◆ MoveToElement()

abstract bool System.Xml.XmlReader.MoveToElement ( )
pure virtual

When overridden in a derived class, moves to the element that contains the current attribute node.

Returns
true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change).
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ MoveToFirstAttribute()

abstract bool System.Xml.XmlReader.MoveToFirstAttribute ( )
pure virtual

When overridden in a derived class, moves to the first attribute.

Returns
true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change).
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ MoveToNextAttribute()

abstract bool System.Xml.XmlReader.MoveToNextAttribute ( )
pure virtual

When overridden in a derived class, moves to the next attribute.

Returns
true if there is a next attribute; false if there are no more attributes.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlTextReader, System.Xml.XmlNodeReader, and System.Xml.XmlValidatingReader.

◆ Read()

abstract bool System.Xml.XmlReader.Read ( )
pure virtual

When overridden in a derived class, reads the next node from the stream.

Returns
true if the next node was read successfully; otherwise, false.
Exceptions
T:System.Xml.XmlExceptionAn error occurred while parsing the XML.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

◆ ReadAsync()

virtual Task<bool> System.Xml.XmlReader.ReadAsync ( )
virtual

Asynchronously reads the next node from the stream.

Returns
true if the next node was read successfully; false if there are no more nodes to read.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2548 of file XmlReader.cs.

◆ ReadAttributeValue()

abstract bool System.Xml.XmlReader.ReadAttributeValue ( )
pure virtual

When overridden in a derived class, parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.

Returns
true if there are nodes to return. false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read.An empty attribute, such as, misc="", returns true with a single node with a value of String.Empty.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

◆ ReadContentAs()

virtual object System.Xml.XmlReader.ReadContentAs ( Type  returnType,
IXmlNamespaceResolver  namespaceResolver 
)
virtual

Reads the content as an object of the type specified.

Parameters
returnTypeThe type of the value to be returned. Note   With the release of the .NET Framework 3.5, the value of the returnType parameter can now be the T:System.DateTimeOffset type.
namespaceResolverAn T:System.Xml.IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion. For example, this can be used when converting an T:System.Xml.XmlQualifiedName object to an xs:string.This value can be null.
Returns
The concatenated text content or attribute value converted to the requested type.
Exceptions
T:System.FormatExceptionThe content is not in the correct format for the target type.
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.ArgumentNullExceptionThe returnType value is null.
T:System.InvalidOperationExceptionThe current node is not a supported node type. See the table below for details.
T:System.OverflowExceptionRead Decimal.MaxValue.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 672 of file XmlReader.cs.

◆ ReadContentAsAsync()

virtual async Task<object> System.Xml.XmlReader.ReadContentAsAsync ( Type  returnType,
IXmlNamespaceResolver  namespaceResolver 
)
virtual

Asynchronously reads the content as an object of the type specified.

Parameters
returnTypeThe type of the value to be returned.
namespaceResolverAn T:System.Xml.IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion.
Returns
The concatenated text content or attribute value converted to the requested type.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2467 of file XmlReader.cs.

◆ ReadContentAsBase64()

virtual int System.Xml.XmlReader.ReadContentAsBase64 ( byte []  buffer,
int  index,
int  count 
)
virtual

Reads the content and returns the Base64 decoded binary bytes.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.ArgumentNullExceptionThe buffer value is null.
T:System.InvalidOperationExceptionM:System.Xml.XmlReader.ReadContentAsBase64(System.Byte[],System.Int32,System.Int32) is not supported on the current node.
T:System.ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
T:System.NotSupportedExceptionThe T:System.Xml.XmlReader implementation does not support this method.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

Definition at line 1192 of file XmlReader.cs.

◆ ReadContentAsBase64Async()

virtual Task<int> System.Xml.XmlReader.ReadContentAsBase64Async ( byte []  buffer,
int  index,
int  count 
)
virtual

Asynchronously reads the content and returns the Base64 decoded binary bytes.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2575 of file XmlReader.cs.

◆ ReadContentAsBinHex()

virtual int System.Xml.XmlReader.ReadContentAsBinHex ( byte []  buffer,
int  index,
int  count 
)
virtual

Reads the content and returns the BinHex decoded binary bytes.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.ArgumentNullExceptionThe buffer value is null.
T:System.InvalidOperationExceptionM:System.Xml.XmlReader.ReadContentAsBinHex(System.Byte[],System.Int32,System.Int32) is not supported on the current node.
T:System.ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
T:System.NotSupportedExceptionThe T:System.Xml.XmlReader implementation does not support this method.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

Definition at line 1227 of file XmlReader.cs.

◆ ReadContentAsBinHexAsync()

virtual Task<int> System.Xml.XmlReader.ReadContentAsBinHexAsync ( byte []  buffer,
int  index,
int  count 
)
virtual

Asynchronously reads the content and returns the BinHex decoded binary bytes.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2601 of file XmlReader.cs.

◆ ReadContentAsBoolean()

virtual bool System.Xml.XmlReader.ReadContentAsBoolean ( )
virtual

Reads the text content at the current position as a Boolean.

Returns
The text content as a T:System.Boolean object.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 478 of file XmlReader.cs.

◆ ReadContentAsDateTime()

virtual DateTime System.Xml.XmlReader.ReadContentAsDateTime ( )
virtual

Reads the text content at the current position as a T:System.DateTime object.

Returns
The text content as a T:System.DateTime object.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 499 of file XmlReader.cs.

◆ ReadContentAsDateTimeOffset()

virtual DateTimeOffset System.Xml.XmlReader.ReadContentAsDateTimeOffset ( )
virtual

Reads the text content at the current position as a T:System.DateTimeOffset object.

Returns
The text content as a T:System.DateTimeOffset object.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 519 of file XmlReader.cs.

◆ ReadContentAsDecimal()

virtual decimal System.Xml.XmlReader.ReadContentAsDecimal ( )
virtual

Reads the text content at the current position as a T:System.Decimal object.

Returns
The text content at the current position as a T:System.Decimal object.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 585 of file XmlReader.cs.

◆ ReadContentAsDouble()

virtual double System.Xml.XmlReader.ReadContentAsDouble ( )
virtual

Reads the text content at the current position as a double-precision floating-point number.

Returns
The text content as a double-precision floating-point number.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 541 of file XmlReader.cs.

◆ ReadContentAsFloat()

virtual float System.Xml.XmlReader.ReadContentAsFloat ( )
virtual

Reads the text content at the current position as a single-precision floating point number.

Returns
The text content at the current position as a single-precision floating point number.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 563 of file XmlReader.cs.

◆ ReadContentAsInt()

virtual int System.Xml.XmlReader.ReadContentAsInt ( )
virtual

Reads the text content at the current position as a 32-bit signed integer.

Returns
The text content as a 32-bit signed integer.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 607 of file XmlReader.cs.

◆ ReadContentAsLong()

virtual long System.Xml.XmlReader.ReadContentAsLong ( )
virtual

Reads the text content at the current position as a 64-bit signed integer.

Returns
The text content as a 64-bit signed integer.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 629 of file XmlReader.cs.

◆ ReadContentAsObject()

virtual object System.Xml.XmlReader.ReadContentAsObject ( )
virtual

Reads the text content at the current position as an T:System.Object.

Returns
The text content as the most appropriate common language runtime (CLR) object.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 463 of file XmlReader.cs.

◆ ReadContentAsObjectAsync()

virtual async Task<object> System.Xml.XmlReader.ReadContentAsObjectAsync ( )
virtual

Asynchronously reads the text content at the current position as an T:System.Object.

Returns
The text content as the most appropriate common language runtime (CLR) object.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2437 of file XmlReader.cs.

◆ ReadContentAsString()

virtual string System.Xml.XmlReader.ReadContentAsString ( )
virtual

Reads the text content at the current position as a T:System.String object.

Returns
The text content as a T:System.String object.
Exceptions
T:System.InvalidCastExceptionThe attempted cast is not valid.
T:System.FormatExceptionThe string format is not valid.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 651 of file XmlReader.cs.

◆ ReadContentAsStringAsync()

virtual Task<string> System.Xml.XmlReader.ReadContentAsStringAsync ( )
virtual

Asynchronously reads the text content at the current position as a T:System.String object.

Returns
The text content as a T:System.String object.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2451 of file XmlReader.cs.

◆ ReadElementContentAs() [1/2]

virtual object System.Xml.XmlReader.ReadElementContentAs ( Type  returnType,
IXmlNamespaceResolver  namespaceResolver 
)
virtual

Reads the element content as the requested type.

Parameters
returnTypeThe type of the value to be returned. Note   With the release of the .NET Framework 3.5, the value of the returnType parameter can now be the T:System.DateTimeOffset type.
namespaceResolverAn T:System.Xml.IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion.
Returns
The element content converted to the requested typed object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.OverflowExceptionRead Decimal.MaxValue.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1012 of file XmlReader.cs.

◆ ReadElementContentAs() [2/2]

virtual object System.Xml.XmlReader.ReadElementContentAs ( Type  returnType,
IXmlNamespaceResolver  namespaceResolver,
string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the element content as the requested type.

Parameters
returnTypeThe type of the value to be returned. Note   With the release of the .NET Framework 3.5, the value of the returnType parameter can now be the T:System.DateTimeOffset type.
namespaceResolverAn T:System.Xml.IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion.
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content converted to the requested typed object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.OverflowExceptionRead Decimal.MaxValue.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1041 of file XmlReader.cs.

◆ ReadElementContentAsAsync()

virtual async Task<object> System.Xml.XmlReader.ReadElementContentAsAsync ( Type  returnType,
IXmlNamespaceResolver  namespaceResolver 
)
virtual

Asynchronously reads the element content as the requested type.

Parameters
returnTypeThe type of the value to be returned.
namespaceResolverAn T:System.Xml.IXmlNamespaceResolver object that is used to resolve any namespace prefixes related to type conversion.
Returns
The element content converted to the requested typed object.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2531 of file XmlReader.cs.

◆ ReadElementContentAsBase64()

virtual int System.Xml.XmlReader.ReadElementContentAsBase64 ( byte []  buffer,
int  index,
int  count 
)
virtual

Reads the element and decodes the Base64 content.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.ArgumentNullExceptionThe buffer value is null.
T:System.InvalidOperationExceptionThe current node is not an element node.
T:System.ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
T:System.NotSupportedExceptionThe T:System.Xml.XmlReader implementation does not support this method.
T:System.Xml.XmlExceptionThe element contains mixed-content.
T:System.FormatExceptionThe content cannot be converted to the requested type.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

Definition at line 1210 of file XmlReader.cs.

◆ ReadElementContentAsBase64Async()

virtual Task<int> System.Xml.XmlReader.ReadElementContentAsBase64Async ( byte []  buffer,
int  index,
int  count 
)
virtual

Asynchronously reads the element and decodes the Base64 content.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2588 of file XmlReader.cs.

◆ ReadElementContentAsBinHex()

virtual int System.Xml.XmlReader.ReadElementContentAsBinHex ( byte []  buffer,
int  index,
int  count 
)
virtual

Reads the element and decodes the BinHex content.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.ArgumentNullExceptionThe buffer value is null.
T:System.InvalidOperationExceptionThe current node is not an element node.
T:System.ArgumentOutOfRangeExceptionThe index into the buffer or index + count is larger than the allocated buffer size.
T:System.NotSupportedExceptionThe T:System.Xml.XmlReader implementation does not support this method.
T:System.Xml.XmlExceptionThe element contains mixed-content.
T:System.FormatExceptionThe content cannot be converted to the requested type.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

Definition at line 1245 of file XmlReader.cs.

◆ ReadElementContentAsBinHexAsync()

virtual Task<int> System.Xml.XmlReader.ReadElementContentAsBinHexAsync ( byte []  buffer,
int  index,
int  count 
)
virtual

Asynchronously reads the element and decodes the BinHex content.

Parameters
bufferThe buffer into which to copy the resulting text. This value cannot be null.
indexThe offset into the buffer where to start copying the result.
countThe maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
Returns
The number of bytes written to the buffer.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2614 of file XmlReader.cs.

◆ ReadElementContentAsBoolean() [1/2]

virtual bool System.Xml.XmlReader.ReadElementContentAsBoolean ( )
virtual

Reads the current element and returns the contents as a T:System.Boolean object.

Returns
The element content as a T:System.Boolean object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a T:System.Boolean object.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 738 of file XmlReader.cs.

◆ ReadElementContentAsBoolean() [2/2]

virtual bool System.Xml.XmlReader.ReadElementContentAsBoolean ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.Boolean object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a T:System.Boolean object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 759 of file XmlReader.cs.

◆ ReadElementContentAsDateTime() [1/2]

virtual DateTime System.Xml.XmlReader.ReadElementContentAsDateTime ( )
virtual

Reads the current element and returns the contents as a T:System.DateTime object.

Returns
The element content as a T:System.DateTime object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a T:System.DateTime object.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 771 of file XmlReader.cs.

◆ ReadElementContentAsDateTime() [2/2]

virtual DateTime System.Xml.XmlReader.ReadElementContentAsDateTime ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.DateTime object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element contents as a T:System.DateTime object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 791 of file XmlReader.cs.

◆ ReadElementContentAsDecimal() [1/2]

virtual decimal System.Xml.XmlReader.ReadElementContentAsDecimal ( )
virtual

Reads the current element and returns the contents as a T:System.Decimal object.

Returns
The element content as a T:System.Decimal object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a T:System.Decimal.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 872 of file XmlReader.cs.

◆ ReadElementContentAsDecimal() [2/2]

virtual decimal System.Xml.XmlReader.ReadElementContentAsDecimal ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.Decimal object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a T:System.Decimal object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a T:System.Decimal.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 893 of file XmlReader.cs.

◆ ReadElementContentAsDouble() [1/2]

virtual double System.Xml.XmlReader.ReadElementContentAsDouble ( )
virtual

Reads the current element and returns the contents as a double-precision floating-point number.

Returns
The element content as a double-precision floating-point number.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a double-precision floating-point number.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 804 of file XmlReader.cs.

◆ ReadElementContentAsDouble() [2/2]

virtual double System.Xml.XmlReader.ReadElementContentAsDouble ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a double-precision floating-point number.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a double-precision floating-point number.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 825 of file XmlReader.cs.

◆ ReadElementContentAsFloat() [1/2]

virtual float System.Xml.XmlReader.ReadElementContentAsFloat ( )
virtual

Reads the current element and returns the contents as single-precision floating-point number.

Returns
The element content as a single-precision floating point number.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a single-precision floating-point number.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 838 of file XmlReader.cs.

◆ ReadElementContentAsFloat() [2/2]

virtual float System.Xml.XmlReader.ReadElementContentAsFloat ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a single-precision floating-point number.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a single-precision floating point number.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a single-precision floating-point number.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 859 of file XmlReader.cs.

◆ ReadElementContentAsInt() [1/2]

virtual int System.Xml.XmlReader.ReadElementContentAsInt ( )
virtual

Reads the current element and returns the contents as a 32-bit signed integer.

Returns
The element content as a 32-bit signed integer.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a 32-bit signed integer.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 906 of file XmlReader.cs.

◆ ReadElementContentAsInt() [2/2]

virtual int System.Xml.XmlReader.ReadElementContentAsInt ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 32-bit signed integer.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a 32-bit signed integer.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a 32-bit signed integer.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 927 of file XmlReader.cs.

◆ ReadElementContentAsLong() [1/2]

virtual long System.Xml.XmlReader.ReadElementContentAsLong ( )
virtual

Reads the current element and returns the contents as a 64-bit signed integer.

Returns
The element content as a 64-bit signed integer.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a 64-bit signed integer.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 940 of file XmlReader.cs.

◆ ReadElementContentAsLong() [2/2]

virtual long System.Xml.XmlReader.ReadElementContentAsLong ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 64-bit signed integer.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a 64-bit signed integer.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a 64-bit signed integer.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 961 of file XmlReader.cs.

◆ ReadElementContentAsObject() [1/2]

virtual object System.Xml.XmlReader.ReadElementContentAsObject ( )
virtual

Reads the current element and returns the contents as an T:System.Object.

Returns
A boxed common language runtime (CLR) object of the most appropriate type. The P:System.Xml.XmlReader.ValueType property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 704 of file XmlReader.cs.

◆ ReadElementContentAsObject() [2/2]

virtual object System.Xml.XmlReader.ReadElementContentAsObject ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as an T:System.Object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
A boxed common language runtime (CLR) object of the most appropriate type. The P:System.Xml.XmlReader.ValueType property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to the requested type.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 725 of file XmlReader.cs.

◆ ReadElementContentAsObjectAsync()

virtual async Task<object> System.Xml.XmlReader.ReadElementContentAsObjectAsync ( )
virtual

Asynchronously reads the current element and returns the contents as an T:System.Object.

Returns
A boxed common language runtime (CLR) object of the most appropriate type. The P:System.Xml.XmlReader.ValueType property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2497 of file XmlReader.cs.

◆ ReadElementContentAsString() [1/2]

virtual string System.Xml.XmlReader.ReadElementContentAsString ( )
virtual

Reads the current element and returns the contents as a T:System.String object.

Returns
The element content as a T:System.String object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a T:System.String object.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 974 of file XmlReader.cs.

◆ ReadElementContentAsString() [2/2]

virtual string System.Xml.XmlReader.ReadElementContentAsString ( string  localName,
string  namespaceURI 
)
virtual

Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a T:System.String object.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
The element content as a T:System.String object.
Exceptions
T:System.InvalidOperationExceptionThe T:System.Xml.XmlReader is not positioned on an element.
T:System.Xml.XmlExceptionThe current element contains child elements.-or-The element content cannot be converted to a T:System.String object.
T:System.ArgumentNullExceptionThe method is called with null arguments.
T:System.ArgumentExceptionThe specified local name and namespace URI do not match that of the current element being read.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 995 of file XmlReader.cs.

◆ ReadElementContentAsStringAsync()

virtual async Task<string> System.Xml.XmlReader.ReadElementContentAsStringAsync ( )
virtual

Asynchronously reads the current element and returns the contents as a T:System.String object.

Returns
The element content as a T:System.String object.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2513 of file XmlReader.cs.

◆ ReadElementString() [1/3]

virtual string System.Xml.XmlReader.ReadElementString ( )
virtual

Reads a text-only element. However, we recommend that you use the M:System.Xml.XmlReader.ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Returns
The text contained in the element that was read. An empty string if the element is empty.
Exceptions
T:System.Xml.XmlExceptionThe next content node is not a start tag; or the element found does not contain a simple text value.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1397 of file XmlReader.cs.

◆ ReadElementString() [2/3]

virtual string System.Xml.XmlReader.ReadElementString ( string  name)
virtual

Checks that the P:System.Xml.XmlReader.Name property of the element found matches the given string before reading a text-only element. However, we recommend that you use the M:System.Xml.XmlReader.ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Parameters
nameThe name to check.
Returns
The text contained in the element that was read. An empty string if the element is empty.
Exceptions
T:System.Xml.XmlExceptionIf the next content node is not a start tag; if the element Name does not match the given argument; or if the element found does not contain a simple text value.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1431 of file XmlReader.cs.

◆ ReadElementString() [3/3]

virtual string System.Xml.XmlReader.ReadElementString ( string  localname,
string  ns 
)
virtual

Checks that the P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the M:System.Xml.XmlReader.ReadElementContentAsString(System.String,System.String) method instead, because it provides a more straightforward way to handle this operation.

Parameters
localnameThe local name to check.
nsThe namespace URI to check.
Returns
The text contained in the element that was read. An empty string if the element is empty.
Exceptions
T:System.Xml.XmlExceptionIf the next content node is not a start tag; if the element LocalName or NamespaceURI do not match the given arguments; or if the element found does not contain a simple text value.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1465 of file XmlReader.cs.

◆ ReadEndElement()

virtual void System.Xml.XmlReader.ReadEndElement ( )
virtual

Checks that the current content node is an end tag and advances the reader to the next node.

Exceptions
T:System.Xml.XmlExceptionThe current node is not an end tag or if incorrect XML is encountered in the input stream.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1500 of file XmlReader.cs.

◆ ReadInnerXml()

virtual string System.Xml.XmlReader.ReadInnerXml ( )
virtual

When overridden in a derived class, reads all the content, including markup, as a string.

Returns
All the XML content, including markup, in the current node. If the current node has no children, an empty string is returned.If the current node is neither an element nor attribute, an empty string is returned.
Exceptions
T:System.Xml.XmlExceptionThe XML was not well-formed, or an error occurred while parsing the XML.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1790 of file XmlReader.cs.

◆ ReadInnerXmlAsync()

virtual async Task<string> System.Xml.XmlReader.ReadInnerXmlAsync ( )
virtual

Asynchronously reads all the content, including markup, as a string.

Returns
All the XML content, including markup, in the current node. If the current node has no children, an empty string is returned.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2667 of file XmlReader.cs.

◆ ReadOuterXml()

virtual string System.Xml.XmlReader.ReadOuterXml ( )
virtual

When overridden in a derived class, reads the content, including markup, representing this node and all its children.

Returns
If the reader is positioned on an element or an attribute node, this method returns all the XML content, including markup, of the current node and all its children; otherwise, it returns an empty string.
Exceptions
T:System.Xml.XmlExceptionThe XML was not well-formed, or an error occurred while parsing the XML.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1894 of file XmlReader.cs.

◆ ReadOuterXmlAsync()

virtual async Task<string> System.Xml.XmlReader.ReadOuterXmlAsync ( )
virtual

Asynchronously reads the content, including markup, representing this node and all its children.

Returns
If the reader is positioned on an element or an attribute node, this method returns all the XML content, including markup, of the current node and all its children; otherwise, it returns an empty string.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2754 of file XmlReader.cs.

◆ ReadStartElement() [1/3]

virtual void System.Xml.XmlReader.ReadStartElement ( )
virtual

Checks that the current node is an element and advances the reader to the next node.

Exceptions
T:System.Xml.XmlExceptionIncorrect XML was encountered in the input stream.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1340 of file XmlReader.cs.

◆ ReadStartElement() [2/3]

virtual void System.Xml.XmlReader.ReadStartElement ( string  name)
virtual

Checks that the current content node is an element with the given P:System.Xml.XmlReader.Name and advances the reader to the next node.

Parameters
nameThe qualified name of the element.
Exceptions
T:System.Xml.XmlExceptionIncorrect XML was encountered in the input stream. -or- The P:System.Xml.XmlReader.Name of the element does not match the given name .
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1354 of file XmlReader.cs.

◆ ReadStartElement() [3/3]

virtual void System.Xml.XmlReader.ReadStartElement ( string  localname,
string  ns 
)
virtual

Checks that the current content node is an element with the given P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI and advances the reader to the next node.

Parameters
localnameThe local name of the element.
nsThe namespace URI of the element.
Exceptions
T:System.Xml.XmlExceptionIncorrect XML was encountered in the input stream.-or-The P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI properties of the element found do not match the given arguments.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1374 of file XmlReader.cs.

◆ ReadString()

virtual string System.Xml.XmlReader.ReadString ( )
virtual

When overridden in a derived class, reads the contents of an element or text node as a string. However, we recommend that you use the Overload:System.Xml.XmlReader.ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.

Returns
The contents of the element or an empty string.
Exceptions
T:System.Xml.XmlExceptionAn error occurred while parsing the XML.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

Definition at line 1272 of file XmlReader.cs.

◆ ReadSubtree()

virtual XmlReader System.Xml.XmlReader.ReadSubtree ( )
virtual

Returns a new XmlReader instance that can be used to read the current node, and all its descendants.

Returns
A new XML reader instance set to F:System.Xml.ReadState.Initial. Calling the M:System.Xml.XmlReader.Read method positions the new reader on the node that was current before the call to the M:System.Xml.XmlReader.ReadSubtree method.
Exceptions
T:System.InvalidOperationExceptionThe XML reader isn't positioned on an element when this method is called.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1954 of file XmlReader.cs.

◆ ReadToDescendant() [1/2]

virtual bool System.Xml.XmlReader.ReadToDescendant ( string  name)
virtual

Advances the T:System.Xml.XmlReader to the next descendant element with the specified qualified name.

Parameters
nameThe qualified name of the element you wish to move to.
Returns
true if a matching descendant element is found; otherwise false. If a matching child element is not found, the T:System.Xml.XmlReader is positioned on the end tag (P:System.Xml.XmlReader.NodeType is XmlNodeType.EndElement) of the element.If the T:System.Xml.XmlReader is not positioned on an element when M:System.Xml.XmlReader.ReadToDescendant(System.String) was called, this method returns false and the position of the T:System.Xml.XmlReader is not changed.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentExceptionThe parameter is an empty string.

Definition at line 1618 of file XmlReader.cs.

◆ ReadToDescendant() [2/2]

virtual bool System.Xml.XmlReader.ReadToDescendant ( string  localName,
string  namespaceURI 
)
virtual

Advances the T:System.Xml.XmlReader to the next descendant element with the specified local name and namespace URI.

Parameters
localNameThe local name of the element you wish to move to.
namespaceURIThe namespace URI of the element you wish to move to.
Returns
true if a matching descendant element is found; otherwise false. If a matching child element is not found, the T:System.Xml.XmlReader is positioned on the end tag (P:System.Xml.XmlReader.NodeType is XmlNodeType.EndElement) of the element.If the T:System.Xml.XmlReader is not positioned on an element when M:System.Xml.XmlReader.ReadToDescendant(System.String,System.String) was called, this method returns false and the position of the T:System.Xml.XmlReader is not changed.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentNullExceptionBoth parameter values are null.

Definition at line 1656 of file XmlReader.cs.

◆ ReadToFollowing() [1/2]

virtual bool System.Xml.XmlReader.ReadToFollowing ( string  name)
virtual

Reads until an element with the specified qualified name is found.

Parameters
nameThe qualified name of the element.
Returns
true if a matching element is found; otherwise false and the T:System.Xml.XmlReader is in an end of file state.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentExceptionThe parameter is an empty string.

Definition at line 1564 of file XmlReader.cs.

◆ ReadToFollowing() [2/2]

virtual bool System.Xml.XmlReader.ReadToFollowing ( string  localName,
string  namespaceURI 
)
virtual

Reads until an element with the specified local name and namespace URI is found.

Parameters
localNameThe local name of the element.
namespaceURIThe namespace URI of the element.
Returns
true if a matching element is found; otherwise false and the T:System.Xml.XmlReader is in an end of file state.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentNullExceptionBoth parameter values are null.

Definition at line 1589 of file XmlReader.cs.

◆ ReadToNextSibling() [1/2]

virtual bool System.Xml.XmlReader.ReadToNextSibling ( string  name)
virtual

Advances the XmlReader to the next sibling element with the specified qualified name.

Parameters
nameThe qualified name of the sibling element you wish to move to.
Returns
true if a matching sibling element is found; otherwise false. If a matching sibling element is not found, the XmlReader is positioned on the end tag (P:System.Xml.XmlReader.NodeType is XmlNodeType.EndElement) of the parent element.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentExceptionThe parameter is an empty string.

Definition at line 1698 of file XmlReader.cs.

◆ ReadToNextSibling() [2/2]

virtual bool System.Xml.XmlReader.ReadToNextSibling ( string  localName,
string  namespaceURI 
)
virtual

Advances the XmlReader to the next sibling element with the specified local name and namespace URI.

Parameters
localNameThe local name of the sibling element you wish to move to.
namespaceURIThe namespace URI of the sibling element you wish to move to.
Returns
true if a matching sibling element is found; otherwise, false. If a matching sibling element is not found, the XmlReader is positioned on the end tag (P:System.Xml.XmlReader.NodeType is XmlNodeType.EndElement) of the parent element.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.ArgumentNullExceptionBoth parameter values are null.

Definition at line 1728 of file XmlReader.cs.

◆ ReadValueChunk()

virtual int System.Xml.XmlReader.ReadValueChunk ( char []  buffer,
int  index,
int  count 
)
virtual

Reads large streams of text embedded in an XML document.

Parameters
bufferThe array of characters that serves as the buffer to which the text contents are written. This value cannot be null.
indexThe offset within the buffer where the T:System.Xml.XmlReader can start to copy the results.
countThe maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method.
Returns
The number of characters read into the buffer. The value zero is returned when there is no more text content.
Exceptions
T:System.InvalidOperationExceptionThe current node does not have a value (P:System.Xml.XmlReader.HasValue is false).
T:System.ArgumentNullExceptionThe buffer value is null.
T:System.ArgumentOutOfRangeExceptionThe index into the buffer, or index + count is larger than the allocated buffer size.
T:System.NotSupportedExceptionThe T:System.Xml.XmlReader implementation does not support this method.
T:System.Xml.XmlExceptionThe XML data is not well-formed.
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 1262 of file XmlReader.cs.

◆ ReadValueChunkAsync()

virtual Task<int> System.Xml.XmlReader.ReadValueChunkAsync ( char []  buffer,
int  index,
int  count 
)
virtual

Asynchronously reads large streams of text embedded in an XML document.

Parameters
bufferThe array of characters that serves as the buffer to which the text contents are written. This value cannot be null.
indexThe offset within the buffer where the T:System.Xml.XmlReader can start to copy the results.
countThe maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method.
Returns
The number of characters read into the buffer. The value zero is returned when there is no more text content.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2627 of file XmlReader.cs.

◆ ResolveEntity()

abstract void System.Xml.XmlReader.ResolveEntity ( )
pure virtual

When overridden in a derived class, resolves the entity reference for EntityReference nodes.

Exceptions
T:System.InvalidOperationExceptionThe reader is not positioned on an EntityReference node; this implementation of the reader cannot resolve entities (P:System.Xml.XmlReader.CanResolveEntity returns false).
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Implemented in System.Xml.XmlNodeReader, System.Xml.XmlTextReader, and System.Xml.XmlValidatingReader.

◆ Skip()

virtual void System.Xml.XmlReader.Skip ( )
virtual

Skips the children of the current node.

Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Reimplemented in System.Xml.XmlNodeReader, and System.Xml.XmlTextReader.

Definition at line 1159 of file XmlReader.cs.

◆ SkipAsync()

virtual Task System.Xml.XmlReader.SkipAsync ( )
virtual

Asynchronously skips the children of the current node.

Returns
The current node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader asynchronous method was called without setting the P:System.Xml.XmlReaderSettings.Async flag to true. In this case, T:System.InvalidOperationException is thrown with the message “Set XmlReaderSettings.Async to true if you want to use Async Methods.”

Definition at line 2558 of file XmlReader.cs.

Member Data Documentation

◆ QuoteChar

virtual char System.Xml.XmlReader.QuoteChar => '"'

When overridden in a derived class, gets the quotation mark character used to enclose the value of an attribute node.

Returns
The quotation mark character (" or ') used to enclose the value of an attribute node.</returns> <exception cref="T:System.InvalidOperationException">An <see cref="T:System.Xml.XmlReader" /> method was called before a previous asynchronous operation finished. In this case, <see cref="T:System.InvalidOperationException" /> is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 248 of file XmlReader.cs.

◆ SchemaInfo

virtual IXmlSchemaInfo System.Xml.XmlReader.SchemaInfo => this as IXmlSchemaInfo

Gets the schema information that has been assigned to the current node as a result of schema validation.

Returns
An T:System.Xml.Schema.IXmlSchemaInfo object containing the schema information for the current node. Schema information can be set on elements, attributes, or on text nodes with a non-null P:System.Xml.XmlReader.ValueType (typed values).If the current node is not one of the above node types, or if the XmlReader instance does not report schema information, this property returns null.If this property is called from an T:System.Xml.XmlTextReader or an T:System.Xml.XmlValidatingReader object, this property always returns null. These XmlReader implementations do not expose schema information through the SchemaInfo property.If you have to get the post-schema-validation information set (PSVI) for an element, position the reader on the end tag of the element, rather than on the start tag. You get the PSVI through the SchemaInfo property of a reader. The validating reader that is created through Overload:System.Xml.XmlReader.Create with the P:System.Xml.XmlReaderSettings.ValidationType property set to F:System.Xml.ValidationType.Schema has complete PSVI for an element only when the reader is positioned on the end tag of an element.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 279 of file XmlReader.cs.

Property Documentation

◆ AttributeCount

abstract int System.Xml.XmlReader.AttributeCount
get

When overridden in a derived class, gets the number of attributes on the current node.

Returns
The number of attributes on the current node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 299 of file XmlReader.cs.

◆ BaseURI

abstract string System.Xml.XmlReader.BaseURI
get

When overridden in a derived class, gets the base URI of the current node.

Returns
The base URI of the current node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 215 of file XmlReader.cs.

◆ CanReadBinaryContent

virtual bool System.Xml.XmlReader.CanReadBinaryContent
get

Gets a value indicating whether the T:System.Xml.XmlReader implements the binary content read methods.

Returns
true if the binary content read methods are implemented; otherwise false.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 398 of file XmlReader.cs.

◆ CanReadValueChunk

virtual bool System.Xml.XmlReader.CanReadValueChunk
get

Gets a value indicating whether the T:System.Xml.XmlReader implements the M:System.Xml.XmlReader.ReadValueChunk(System.Char[],System.Int32,System.Int32) method.

Returns
true if the T:System.Xml.XmlReader implements the M:System.Xml.XmlReader.ReadValueChunk(System.Char[],System.Int32,System.Int32) method; otherwise false.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 412 of file XmlReader.cs.

◆ CanResolveEntity

virtual bool System.Xml.XmlReader.CanResolveEntity
get

Gets a value indicating whether this reader can parse and resolve entities.

Returns
true if the reader can parse and resolve entities; otherwise, false.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 384 of file XmlReader.cs.

◆ Depth

abstract int System.Xml.XmlReader.Depth
get

When overridden in a derived class, gets the depth of the current node in the XML document.

Returns
The depth of the current node in the XML document.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 205 of file XmlReader.cs.

◆ EOF

abstract bool System.Xml.XmlReader.EOF
get

When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream.

Returns
true if the reader is positioned at the end of the stream; otherwise, false.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 353 of file XmlReader.cs.

◆ HasAttributes

virtual bool System.Xml.XmlReader.HasAttributes
get

Gets a value indicating whether the current node has any attributes.

Returns
true if the current node has attributes; otherwise, false.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 426 of file XmlReader.cs.

◆ HasValue

virtual bool System.Xml.XmlReader.HasValue
get

When overridden in a derived class, gets a value indicating whether the current node can have a P:System.Xml.XmlReader.Value.

Returns
true if the node on which the reader is currently positioned can have a Value; otherwise, false. If false, the node has a value of String.Empty.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 164 of file XmlReader.cs.

◆ IsDefault

virtual bool System.Xml.XmlReader.IsDefault
get

When overridden in a derived class, gets a value indicating whether the current node is an attribute that was generated from the default value defined in the DTD or schema.

Returns
true if the current node is an attribute whose value was generated from the default value defined in the DTD or schema; false if the attribute value was explicitly set.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 237 of file XmlReader.cs.

◆ IsEmptyElement

abstract bool System.Xml.XmlReader.IsEmptyElement
get

When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, <MyElement/>).

Returns
true if the current node is an element (P:System.Xml.XmlReader.NodeType equals XmlNodeType.Element) that ends with />; otherwise, false.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 226 of file XmlReader.cs.

◆ LocalName

abstract string System.Xml.XmlReader.LocalName
get

When overridden in a derived class, gets the local name of the current node.

Returns
The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>.For node types that do not have a name (like Text, Comment, and so on), this property returns String.Empty.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 133 of file XmlReader.cs.

◆ Name

virtual string System.Xml.XmlReader.Name
get

When overridden in a derived class, gets the qualified name of the current node.

Returns
The qualified name of the current node. For example, Name is bk:book for the element <bk:book>.The name returned is dependent on the P:System.Xml.XmlReader.NodeType of the node. The following node types return the listed values. All other node types return an empty string.Node type Name Attribute The name of the attribute. DocumentType The document type name. Element The tag name. EntityReference The name of the entity referenced. ProcessingInstruction The target of the processing instruction. XmlDeclaration The literal string xml.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 116 of file XmlReader.cs.

◆ NamespaceURI

abstract string System.Xml.XmlReader.NamespaceURI
get

When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned.

Returns
The namespace URI of the current node; otherwise an empty string.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 143 of file XmlReader.cs.

◆ NameTable

abstract XmlNameTable System.Xml.XmlReader.NameTable
get

When overridden in a derived class, gets the T:System.Xml.XmlNameTable associated with this implementation.

Returns
The XmlNameTable enabling you to get the atomized version of a string within the node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 373 of file XmlReader.cs.

◆ NodeType

abstract XmlNodeType System.Xml.XmlReader.NodeType
get

When overridden in a derived class, gets the type of the current node.

Returns
One of the enumeration values that specify the type of the current node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 94 of file XmlReader.cs.

◆ Prefix

abstract string System.Xml.XmlReader.Prefix
get

When overridden in a derived class, gets the namespace prefix associated with the current node.

Returns
The namespace prefix associated with the current node.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 153 of file XmlReader.cs.

◆ ReadState

abstract ReadState System.Xml.XmlReader.ReadState
get

When overridden in a derived class, gets the state of the reader.

Returns
One of the enumeration values that specifies the state of the reader.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 363 of file XmlReader.cs.

◆ Settings

virtual XmlReaderSettings System.Xml.XmlReader.Settings
get

Gets the T:System.Xml.XmlReaderSettings object used to create this T:System.Xml.XmlReader instance.

Returns
The T:System.Xml.XmlReaderSettings object used to create this reader instance. If this reader was not created using the Overload:System.Xml.XmlReader.Create method, this property returns null.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 81 of file XmlReader.cs.

◆ this[int i]

virtual string System.Xml.XmlReader.this[int i]
get

When overridden in a derived class, gets the value of the attribute with the specified index.

Parameters
iThe index of the attribute.
Returns
The value of the specified attribute.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 310 of file XmlReader.cs.

◆ this[string name, string namespaceURI]

virtual string System.Xml.XmlReader.this[string name, string namespaceURI]
get

When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.LocalName and P:System.Xml.XmlReader.NamespaceURI.

Parameters
nameThe local name of the attribute.
namespaceURIThe namespace URI of the attribute.
Returns
The value of the specified attribute. If the attribute is not found, null is returned.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 339 of file XmlReader.cs.

◆ this[string name]

virtual string System.Xml.XmlReader.this[string name]
get

When overridden in a derived class, gets the value of the attribute with the specified P:System.Xml.XmlReader.Name.

Parameters
nameThe qualified name of the attribute.
Returns
The value of the specified attribute. If the attribute is not found, null is returned.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 324 of file XmlReader.cs.

◆ Value

abstract string System.Xml.XmlReader.Value
get

When overridden in a derived class, gets the text value of the current node.

Returns
The value returned depends on the P:System.Xml.XmlReader.NodeType of the node. The following table lists node types that have a value to return. All other node types return String.Empty.Node type Value Attribute The value of the attribute. CDATA The content of the CDATA section. Comment The content of the comment. DocumentType The internal subset. ProcessingInstruction The entire content, excluding the target. SignificantWhitespace The white space between markup in a mixed content model. Text The content of the text node. Whitespace The white space between markup. XmlDeclaration The content of the declaration.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 195 of file XmlReader.cs.

◆ ValueType

virtual Type System.Xml.XmlReader.ValueType
get

Gets The Common Language Runtime (CLR) type for the current node.

Returns
The CLR type that corresponds to the typed value of the node. The default is System.String.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 286 of file XmlReader.cs.

◆ XmlLang

virtual string System.Xml.XmlReader.XmlLang
get

When overridden in a derived class, gets the current xml:lang scope.

Returns
The current xml:lang scope.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 268 of file XmlReader.cs.

◆ XmlSpace

virtual XmlSpace System.Xml.XmlReader.XmlSpace
get

When overridden in a derived class, gets the current xml:space scope.

Returns
One of the T:System.Xml.XmlSpace values. If no xml:space scope exists, this property defaults to XmlSpace.None.
Exceptions
T:System.InvalidOperationExceptionAn T:System.Xml.XmlReader method was called before a previous asynchronous operation finished. In this case, T:System.InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.”

Definition at line 255 of file XmlReader.cs.


The documentation for this class was generated from the following file: