XmlReader
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.
When overridden in a derived class, gets the number of attributes on the current node.
When overridden in a derived class, gets the base URI of the current node.
Gets a value indicating whether the XmlReader implements the binary content read methods.
Gets a value indicating whether the XmlReader implements the ReadValueChunk method.
Gets a value indicating whether this reader can parse and resolve entities.
When overridden in a derived class, gets the depth of the current node in the XML document.
When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream.
Gets a value indicating whether the current node has any attributes.
When overridden in a derived class, gets a value indicating whether the current node can have a Value.
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.
When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, <MyElement/>).
When overridden in a derived class, gets the value of the attribute with the specified index.
When overridden in a derived class, gets the value of the attribute with the specified Name.
When overridden in a derived class, gets the value of the attribute with the specified LocalName and NamespaceURI.
When overridden in a derived class, gets the local name of the current node.
When overridden in a derived class, gets the qualified name of the current node.
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.
When overridden in a derived class, gets the XmlNameTable associated with this implementation.
When overridden in a derived class, gets the type of the current node.
When overridden in a derived class, gets the namespace prefix associated with the current node.
When overridden in a derived class, gets the state of the reader.
Gets the XmlReaderSettings object used to create this XmlReader instance.
When overridden in a derived class, gets the text value of the current node.
Gets The Common Language Runtime (CLR) type for the current node.
When overridden in a derived class, gets the current xml:lang scope.
When overridden in a derived class, gets the current xml:space scope.
protected XmlReader()
Initializes a new instance of the XmlReader class.
Creates a new XmlReader instance with specified URI.
Creates a new XmlReader instance by using the specified URI and settings.
Creates a new XmlReader instance using the specified stream with default settings.
Creates a new XmlReader instance with the specified stream and settings.
public static XmlReader Create(Stream input, XmlReaderSettings settings, XmlParserContext inputContext)
Creates a new XmlReader instance using the specified stream, settings, and context information for parsing.
Creates a new XmlReader instance by using the specified text reader.
Creates a new XmlReader instance by using the specified text reader and settings.
public static XmlReader Create(TextReader input, XmlReaderSettings settings, XmlParserContext inputContext)
Creates a new XmlReader instance by using the specified text reader, settings, and context information for parsing.
Creates a new XmlReader instance by using the specified XML reader and settings.
Returns a value indicating whether the string argument is a valid XML name.
Returns a value indicating whether or not the string argument is a valid XML name token.
Releases all resources used by the current instance of the XmlReader class.
Releases the unmanaged resources used by the XmlReader and optionally releases the managed resources.
When overridden in a derived class, gets the value of the attribute with the specified Name.
When overridden in a derived class, gets the value of the attribute with the specified LocalName and NamespaceURI.
When overridden in a derived class, gets the value of the attribute with the specified index.
Asynchronously gets the value of the current node.
Calls MoveToContent and tests if the current content node is a start tag or empty element tag.
Calls MoveToContent and tests if the current content node is a start tag or empty element tag and if the Name property of the element found matches the given argument.
Calls MoveToContent and tests if the current content node is a start tag or empty element tag and if the LocalName and NamespaceURI properties of the element found match the given strings.
When overridden in a derived class, resolves a namespace prefix in the current element's scope.
When overridden in a derived class, moves to the attribute with the specified Name.
When overridden in a derived class, moves to the attribute with the specified LocalName and NamespaceURI.
When overridden in a derived class, moves to the attribute with the specified index.
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.
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.
When overridden in a derived class, moves to the element that contains the current attribute node.
When overridden in a derived class, moves to the first attribute.
When overridden in a derived class, moves to the next attribute.
When overridden in a derived class, reads the next node from the stream.
Asynchronously reads the next node from the stream.
When overridden in a derived class, parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.
Reads the content as an object of the type specified.
public virtual Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
Asynchronously reads the content as an object of the type specified.
Reads the content and returns the Base64 decoded binary bytes.
Asynchronously reads the content and returns the Base64 decoded binary bytes.
Reads the content and returns the BinHex decoded binary bytes.
Asynchronously reads the content and returns the BinHex decoded binary bytes.
Reads the text content at the current position as a Boolean.
Reads the text content at the current position as a DateTimeOffset object.
Reads the text content at the current position as a Decimal object.
Reads the text content at the current position as a double-precision floating-point number.
Reads the text content at the current position as a single-precision floating point number.
Reads the text content at the current position as a 32-bit signed integer.
Reads the text content at the current position as a 64-bit signed integer.
Reads the text content at the current position as an Object.
Asynchronously reads the text content at the current position as an Object.
Reads the text content at the current position as a String object.
Asynchronously reads the text content at the current position as a String object.
public virtual object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
Reads the element content as the requested type.
public 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.
public virtual Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
Asynchronously reads the element content as the requested type.
Reads the element and decodes the Base64 content.
Asynchronously reads the element and decodes the Base64 content.
Reads the element and decodes the BinHex content.
Asynchronously reads the element and decodes the BinHex content.
Reads the current element and returns the contents as a Boolean object.
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 Boolean object.
Reads the current element and returns the contents as a Decimal object.
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 Decimal object.
Reads the current element and returns the contents as a double-precision floating-point number.
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.
Reads the current element and returns the contents as single-precision floating-point number.
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.
Reads the current element and returns the contents as a 32-bit signed integer.
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.
Reads the current element and returns the contents as a 64-bit signed integer.
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.
Reads the current element and returns the contents as an Object.
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 Object.
Asynchronously reads the current element and returns the contents as an Object.
Reads the current element and returns the contents as a String object.
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 String object.
Asynchronously reads the current element and returns the contents as a String object.
Checks that the current content node is an end tag and advances the reader to the next node.
When overridden in a derived class, reads all the content, including markup, as a string.
Asynchronously reads all the content, including markup, as a string.
When overridden in a derived class, reads the content, including markup, representing this node and all its children.
Asynchronously reads the content, including markup, representing this node and all its children.
Checks that the current node is an element and advances the reader to the next node.
Checks that the current content node is an element with the given Name and advances the reader to the next node.
Checks that the current content node is an element with the given LocalName and NamespaceURI and advances the reader to the next node.
Returns a new XmlReader instance that can be used to read the current node, and all its descendants.
Advances the XmlReader to the next descendant element with the specified qualified name.
Advances the XmlReader to the next descendant element with the specified local name and namespace URI.
Reads until an element with the specified qualified name is found.
Reads until an element with the specified local name and namespace URI is found.
Advances the XmlReader to the next sibling element with the specified qualified name.
Advances the XmlReader to the next sibling element with the specified local name and namespace URI.
Reads large streams of text embedded in an XML document.
Asynchronously reads large streams of text embedded in an XML document.
When overridden in a derived class, resolves the entity reference for EntityReference nodes.
Skips the children of the current node.
Asynchronously skips the children of the current node.