Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Xml.​XmlTextReader

Assembly: System.Xml.ReaderWriter

Inheritance: object → XmlReader → XmlTextReader

Implemented Interfaces

Represents a reader that provides fast, non-cached, forward-only access to XML data. We recommend that you use the <see cref="T:System.Xml.XmlReader" /> class instead.

Properties

public int
AttributeCount
Gets the number of attributes on the current node.
public string
BaseURI
Gets the base URI of the current node.
public bool
CanReadBinaryContent
Gets a value indicating whether the <see cref="T:System.Xml.XmlTextReader" /> implements the binary content read methods.
public bool
CanReadValueChunk
Gets a value indicating whether the <see cref="T:System.Xml.XmlTextReader" /> implements the <see cref="M:System.Xml.XmlReader.ReadValueChunk(System.Char[],System.Int32,System.Int32)" /> method.
public bool
CanResolveEntity
Gets a value indicating whether this reader can parse and resolve entities.
public int
Depth
Gets the depth of the current node in the XML document.
public DtdProcessing
DtdProcessing
Gets or sets the <see cref="T:System.Xml.DtdProcessing" /> enumeration.
Encoding
Gets the encoding of the document.
EntityHandling
Gets or sets a value that specifies how the reader handles entities.
public bool
EOF
Gets a value indicating whether the reader is positioned at the end of the stream.
public bool
HasValue
Gets a value indicating whether the current node can have a <see cref="P:System.Xml.XmlTextReader.Value" /> other than <see langword="String.Empty" /> .
public bool
IsDefault
Gets a value indicating whether the current node is an attribute that was generated from the default value defined in the DTD or schema.
public bool
IsEmptyElement
Gets a value indicating whether the current node is an empty element (for example, <c>&lt;MyElement/&gt;</c> ).
public int
LineNumber
Gets the current line number.
public int
LinePosition
Gets the current line position.
public string
LocalName
Gets the local name of the current node.
public string
Name
Gets the qualified name of the current node.
public bool
Namespaces
Gets or sets a value indicating whether to do namespace support.
public string
NamespaceURI
Gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned.
public XmlNameTable
NameTable
Gets the <see cref="T:System.Xml.XmlNameTable" /> associated with this implementation.
public XmlNodeType
NodeType
Gets the type of the current node.
public bool
Normalization
Gets or sets a value indicating whether to normalize white space and attribute values.
public string
Prefix
Gets the namespace prefix associated with the current node.
public bool
ProhibitDtd
Gets or sets a value indicating whether to allow DTD processing. This property is obsolete. Use <see cref="P:System.Xml.XmlTextReader.DtdProcessing" /> instead.
public char
QuoteChar
Gets the quotation mark character used to enclose the value of an attribute node.
public ReadState
ReadState
Gets the state of the reader.
public string
Value
Gets the text value of the current node.
WhitespaceHandling
Gets or sets a value that specifies how white space is handled.
public string
XmlLang
Gets the current <see langword="xml:lang" /> scope.
public XmlResolver
XmlResolver
Sets the <see cref="T:System.Xml.XmlResolver" /> used for resolving DTD references.
public XmlSpace
XmlSpace
Gets the current <see langword="xml:space" /> scope.
public bool
HasAttributes
Gets a value indicating whether the current node has any attributes.
public string
Item
public string
Item
public string
Item
SchemaInfo
Gets the schema information that has been assigned to the current node as a result of schema validation.
Settings
Gets the <see cref="T:System.Xml.XmlReaderSettings" /> object used to create this <see cref="T:System.Xml.XmlReader" /> instance.
public Type
ValueType
Gets The Common Language Runtime (CLR) type for the current node.

Methods

public void
Close​()
Changes the <see cref="P:System.Xml.XmlReader.ReadState" /> to <see langword="Closed" /> .
public string
GetAttribute​(int i)
Gets the value of the attribute with the specified index.
Returns The value of the specified attribute.
i The index of the attribute. The index is zero-based. (The first attribute has index 0.)
public string
GetAttribute​(string name)
Gets the value of the attribute with the specified name.
Returns The value of the specified attribute. If the attribute is not found, <see langword="null" /> is returned.
name The qualified name of the attribute.
public string
GetAttribute​(string localName, string namespaceURI)
Gets the value of the attribute with the specified local name and namespace URI.
Returns The value of the specified attribute. If the attribute is not found, <see langword="null" /> is returned. This method does not move the reader.
localName The local name of the attribute.
namespaceURI The namespace URI of the attribute.
public Collections.​Generic.​IDictionary<​string, string>
GetNamespacesInScope​(XmlNamespaceScope scope)
Gets a collection that contains all namespaces currently in-scope.
Returns An <see cref="T:System.Collections.IDictionary" /> object that contains all the current in-scope namespaces. If the reader is not positioned on an element, an empty dictionary (no namespaces) is returned.
scope An <see cref="T:System.Xml.XmlNamespaceScope" /> value that specifies the type of namespace nodes to return.
GetRemainder​()
Gets the remainder of the buffered XML.
Returns A <see cref="T:System.IO.TextReader" /> containing the remainder of the buffered XML.
public bool
HasLineInfo​()
Gets a value indicating whether the class can return line information.
Returns <see langword="true" /> if the class can return line information; otherwise, <see langword="false" /> .
public string
LookupNamespace​(string prefix)
Resolves a namespace prefix in the current element's scope.
Returns The namespace URI to which the prefix maps or <see langword="null" /> if no matching prefix is found.
prefix The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string. This string does not have to be atomized.
public void
MoveToAttribute​(int i)
Moves to the attribute with the specified index.
i The index of the attribute.
public bool
MoveToAttribute​(string name)
Moves to the attribute with the specified name.
Returns <see langword="true" /> if the attribute is found; otherwise, <see langword="false" /> . If <see langword="false" /> , the reader's position does not change.
name The qualified name of the attribute.
public bool
MoveToAttribute​(string localName, string namespaceURI)
Moves to the attribute with the specified local name and namespace URI.
Returns <see langword="true" /> if the attribute is found; otherwise, <see langword="false" /> . If <see langword="false" /> , the reader's position does not change.
localName The local name of the attribute.
namespaceURI The namespace URI of the attribute.
public bool
MoveToElement​()
Moves to the element that contains the current attribute node.
Returns <see langword="true" /> if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); <see langword="false" /> if the reader is not positioned on an attribute (the position of the reader does not change).
public bool
MoveToFirstAttribute​()
Moves to the first attribute.
Returns <see langword="true" /> if an attribute exists (the reader moves to the first attribute); otherwise, <see langword="false" /> (the position of the reader does not change).
public bool
MoveToNextAttribute​()
Moves to the next attribute.
Returns <see langword="true" /> if there is a next attribute; <see langword="false" /> if there are no more attributes.
public bool
Read​()
Reads the next node from the stream.
Returns <see langword="true" /> if the next node was read successfully; <see langword="false" /> if there are no more nodes to read.
public bool
ReadAttributeValue​()
Parses the attribute value into one or more <see langword="Text" /> , <see langword="EntityReference" /> , or <see langword="EndEntity" /> nodes.
Returns <see langword="true" /> if there are nodes to return. <see langword="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, <c>misc=""</c> , returns <see langword="true" /> with a single node with a value of <see langword="String.Empty" /> .
public int
ReadBase64​(byte[] array, int offset, int len)
Decodes Base64 and returns the decoded binary bytes.
Returns The number of bytes written to the buffer.
array The array of characters that serves as the buffer to which the text contents are written.
offset The zero-based index into the array specifying where the method can begin to write to the buffer.
len The number of bytes to write into the buffer.
public int
ReadBinHex​(byte[] array, int offset, int len)
Decodes <see langword="BinHex" /> and returns the decoded binary bytes.
Returns The number of bytes written to your buffer.
array The byte array that serves as the buffer to which the decoded binary bytes are written.
offset The zero-based index into the array specifying where the method can begin to write to the buffer.
len The number of bytes to write into the buffer.
public int
ReadChars​(char[] buffer, int index, int count)
Reads the text contents of an element into a character buffer. This method is designed to read large streams of embedded text by calling it successively.
Returns The number of characters read. This can be <see langword="0" /> if the reader is not positioned on an element or if there is no more text content to return in the current context.
buffer The array of characters that serves as the buffer to which the text contents are written.
index The position within <paramref name="buffer" /> where the method can begin writing text contents.
count The number of characters to write into <paramref name="buffer" /> .
public int
ReadContentAsBase64​(byte[] buffer, int index, int count)
Reads the content and returns the <see langword="Base64" /> decoded binary bytes.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
public int
ReadContentAsBinHex​(byte[] buffer, int index, int count)
Reads the content and returns the <see langword="BinHex" /> decoded binary bytes.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
public int
ReadElementContentAsBase64​(byte[] buffer, int index, int count)
Reads the element and decodes the Base64 content.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
public int
ReadElementContentAsBinHex​(byte[] buffer, int index, int count)
Reads the element and decodes the <see langword="BinHex" /> content.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
public string
ReadString​()
Reads the contents of an element or a text node as a string.
Returns The contents of the element or text node. This can be an empty string if the reader is positioned on something other than an element or text node, or if there is no more text content to return in the current context. <see langword="Note:" /> The text node can be either an element or an attribute text node.
public void
ResetState​()
Resets the state of the reader to ReadState.Initial.
public void
ResolveEntity​()
Resolves the entity reference for <see langword="EntityReference" /> nodes.
public void
Skip​()
Skips the children of the current node.
public void
Dispose​()
Inherited from XmlReader
Releases all resources used by the current instance of the <see cref="T:System.Xml.XmlReader" /> class.
protected void
Dispose​(bool disposing)
Inherited from XmlReader
Releases the unmanaged resources used by the <see cref="T:System.Xml.XmlReader" /> and optionally releases the managed resources.
disposing <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.
public Threading.​Tasks.​Task<​string>
GetValueAsync​()
Inherited from XmlReader
Asynchronously gets the value of the current node.
Returns The value of the current node.
public bool
IsStartElement​()
Inherited from XmlReader
Calls <see cref="M:System.Xml.XmlReader.MoveToContent" /> and tests if the current content node is a start tag or empty element tag.
Returns <see langword="true" /> if <see cref="M:System.Xml.XmlReader.MoveToContent" /> finds a start tag or empty element tag; <see langword="false" /> if a node type other than <see langword="XmlNodeType.Element" /> was found.
public bool
IsStartElement​(string name)
Inherited from XmlReader
Calls <see cref="M:System.Xml.XmlReader.MoveToContent" /> and tests if the current content node is a start tag or empty element tag and if the <see cref="P:System.Xml.XmlReader.Name" /> property of the element found matches the given argument.
Returns <see langword="true" /> if the resulting node is an element and the <see langword="Name" /> property matches the specified string. <see langword="false" /> if a node type other than <see langword="XmlNodeType.Element" /> was found or if the element <see langword="Name" /> property does not match the specified string.
name The string matched against the <see langword="Name" /> property of the element found.
public bool
IsStartElement​(string localname, string ns)
Inherited from XmlReader
Calls <see cref="M:System.Xml.XmlReader.MoveToContent" /> and tests if the current content node is a start tag or empty element tag and if the <see cref="P:System.Xml.XmlReader.LocalName" /> and <see cref="P:System.Xml.XmlReader.NamespaceURI" /> properties of the element found match the given strings.
Returns <see langword="true" /> if the resulting node is an element. <see langword="false" /> if a node type other than <see langword="XmlNodeType.Element" /> was found or if the <see langword="LocalName" /> and <see langword="NamespaceURI" /> properties of the element do not match the specified strings.
localname The string to match against the <see langword="LocalName" /> property of the element found.
ns The string to match against the <see langword="NamespaceURI" /> property of the element found.
public XmlNodeType
MoveToContent​()
Inherited from XmlReader
Checks whether the current node is a content (non-white space text, <see langword="CDATA" /> , <see langword="Element" /> , <see langword="EndElement" /> , <see langword="EntityReference" /> , or <see langword="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: <see langword="ProcessingInstruction" /> , <see langword="DocumentType" /> , <see langword="Comment" /> , <see langword="Whitespace" /> , or <see langword="SignificantWhitespace" /> .
Returns The <see cref="P:System.Xml.XmlReader.NodeType" /> of the current node found by the method or <see langword="XmlNodeType.None" /> if the reader has reached the end of the input stream.
MoveToContentAsync​()
Inherited from XmlReader
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 <see cref="P:System.Xml.XmlReader.NodeType" /> of the current node found by the method or <see langword="XmlNodeType.None" /> if the reader has reached the end of the input stream.
public Threading.​Tasks.​Task<​bool>
ReadAsync​()
Inherited from XmlReader
Asynchronously reads the next node from the stream.
Returns <see langword="true" /> if the next node was read successfully; <see langword="false" /> if there are no more nodes to read.
public object
ReadContentAs​(Type returnType, IXmlNamespaceResolver? namespaceResolver)
Inherited from XmlReader
Reads the content as an object of the type specified.
Returns The concatenated text content or attribute value converted to the requested type.
returnType The type of the value to be returned. Note With the release of the .NET Framework 3.5, the value of the <paramref name="returnType" /> parameter can now be the <see cref="T:System.DateTimeOffset" /> type.
namespaceResolver An <see cref="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 <see cref="T:System.Xml.XmlQualifiedName" /> object to an <c>xs:string</c> . This value can be <see langword="null" /> .
public Threading.​Tasks.​Task<​object>
ReadContentAsAsync​(Type returnType, IXmlNamespaceResolver? namespaceResolver)
Inherited from XmlReader
Asynchronously reads the content as an object of the type specified.
Returns The concatenated text content or attribute value converted to the requested type.
returnType The type of the value to be returned.
namespaceResolver An <see cref="T:System.Xml.IXmlNamespaceResolver" /> object that is used to resolve any namespace prefixes related to type conversion.
ReadContentAsBase64Async​(byte[] buffer, int index, int count)
Inherited from XmlReader
Asynchronously reads the content and returns the Base64 decoded binary bytes.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
ReadContentAsBinHexAsync​(byte[] buffer, int index, int count)
Inherited from XmlReader
Asynchronously reads the content and returns the <see langword="BinHex" /> decoded binary bytes.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
public bool
ReadContentAsBoolean​()
Inherited from XmlReader
Reads the text content at the current position as a <see langword="Boolean" /> .
Returns The text content as a <see cref="T:System.Boolean" /> object.
public DateTime
ReadContentAsDateTime​()
Inherited from XmlReader
Reads the text content at the current position as a <see cref="T:System.DateTime" /> object.
Returns The text content as a <see cref="T:System.DateTime" /> object.
ReadContentAsDateTimeOffset​()
Inherited from XmlReader
Reads the text content at the current position as a <see cref="T:System.DateTimeOffset" /> object.
Returns The text content as a <see cref="T:System.DateTimeOffset" /> object.
public decimal
ReadContentAsDecimal​()
Inherited from XmlReader
Reads the text content at the current position as a <see cref="T:System.Decimal" /> object.
Returns The text content at the current position as a <see cref="T:System.Decimal" /> object.
public double
ReadContentAsDouble​()
Inherited from XmlReader
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.
public Single
ReadContentAsFloat​()
Inherited from XmlReader
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.
public int
ReadContentAsInt​()
Inherited from XmlReader
Reads the text content at the current position as a 32-bit signed integer.
Returns The text content as a 32-bit signed integer.
public long
ReadContentAsLong​()
Inherited from XmlReader
Reads the text content at the current position as a 64-bit signed integer.
Returns The text content as a 64-bit signed integer.
public object
ReadContentAsObject​()
Inherited from XmlReader
Reads the text content at the current position as an <see cref="T:System.Object" /> .
Returns The text content as the most appropriate common language runtime (CLR) object.
public Threading.​Tasks.​Task<​object>
ReadContentAsObjectAsync​()
Inherited from XmlReader
Asynchronously reads the text content at the current position as an <see cref="T:System.Object" /> .
Returns The text content as the most appropriate common language runtime (CLR) object.
public string
ReadContentAsString​()
Inherited from XmlReader
Reads the text content at the current position as a <see cref="T:System.String" /> object.
Returns The text content as a <see cref="T:System.String" /> object.
public Threading.​Tasks.​Task<​string>
ReadContentAsStringAsync​()
Inherited from XmlReader
Asynchronously reads the text content at the current position as a <see cref="T:System.String" /> object.
Returns The text content as a <see cref="T:System.String" /> object.
public object
ReadElementContentAs​(Type returnType, IXmlNamespaceResolver namespaceResolver)
Inherited from XmlReader
Reads the element content as the requested type.
Returns The element content converted to the requested typed object.
returnType The type of the value to be returned. Note With the release of the .NET Framework 3.5, the value of the <paramref name="returnType" /> parameter can now be the <see cref="T:System.DateTimeOffset" /> type.
namespaceResolver An <see cref="T:System.Xml.IXmlNamespaceResolver" /> object that is used to resolve any namespace prefixes related to type conversion.
public object
ReadElementContentAs​(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI)
Inherited from XmlReader
Checks that the specified local name and namespace URI matches that of the current element, then reads the element content as the requested type.
Returns The element content converted to the requested typed object.
returnType The type of the value to be returned. Note With the release of the .NET Framework 3.5, the value of the <paramref name="returnType" /> parameter can now be the <see cref="T:System.DateTimeOffset" /> type.
namespaceResolver An <see cref="T:System.Xml.IXmlNamespaceResolver" /> object that is used to resolve any namespace prefixes related to type conversion.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public Threading.​Tasks.​Task<​object>
ReadElementContentAsAsync​(Type returnType, IXmlNamespaceResolver namespaceResolver)
Inherited from XmlReader
Asynchronously reads the element content as the requested type.
Returns The element content converted to the requested typed object.
returnType The type of the value to be returned.
namespaceResolver An <see cref="T:System.Xml.IXmlNamespaceResolver" /> object that is used to resolve any namespace prefixes related to type conversion.
ReadElementContentAsBase64Async​(byte[] buffer, int index, int count)
Inherited from XmlReader
Asynchronously reads the element and decodes the <see langword="Base64" /> content.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
ReadElementContentAsBinHexAsync​(byte[] buffer, int index, int count)
Inherited from XmlReader
Asynchronously reads the element and decodes the <see langword="BinHex" /> content.
Returns The number of bytes written to the buffer.
buffer The buffer into which to copy the resulting text. This value cannot be <see langword="null" /> .
index The offset into the buffer where to start copying the result.
count The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method.
public bool
ReadElementContentAsBoolean​()
Inherited from XmlReader
Reads the current element and returns the contents as a <see cref="T:System.Boolean" /> object.
Returns The element content as a <see cref="T:System.Boolean" /> object.
public bool
ReadElementContentAsBoolean​(string localName, string namespaceURI)
Inherited from XmlReader
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 <see cref="T:System.Boolean" /> object.
Returns The element content as a <see cref="T:System.Boolean" /> object.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public DateTime
ReadElementContentAsDateTime​()
Inherited from XmlReader
Reads the current element and returns the contents as a <see cref="T:System.DateTime" /> object.
Returns The element content as a <see cref="T:System.DateTime" /> object.
public DateTime
ReadElementContentAsDateTime​(string localName, string namespaceURI)
Inherited from XmlReader
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 <see cref="T:System.DateTime" /> object.
Returns The element contents as a <see cref="T:System.DateTime" /> object.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public decimal
ReadElementContentAsDecimal​()
Inherited from XmlReader
Reads the current element and returns the contents as a <see cref="T:System.Decimal" /> object.
Returns The element content as a <see cref="T:System.Decimal" /> object.
public decimal
ReadElementContentAsDecimal​(string localName, string namespaceURI)
Inherited from XmlReader
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 <see cref="T:System.Decimal" /> object.
Returns The element content as a <see cref="T:System.Decimal" /> object.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public double
ReadElementContentAsDouble​()
Inherited from XmlReader
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.
public double
ReadElementContentAsDouble​(string localName, string namespaceURI)
Inherited from XmlReader
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.
Returns The element content as a double-precision floating-point number.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public Single
ReadElementContentAsFloat​()
Inherited from XmlReader
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.
public Single
ReadElementContentAsFloat​(string localName, string namespaceURI)
Inherited from XmlReader
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.
Returns The element content as a single-precision floating point number.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public int
ReadElementContentAsInt​()
Inherited from XmlReader
Reads the current element and returns the contents as a 32-bit signed integer.
Returns The element content as a 32-bit signed integer.
public int
ReadElementContentAsInt​(string localName, string namespaceURI)
Inherited from XmlReader
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.
Returns The element content as a 32-bit signed integer.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public long
ReadElementContentAsLong​()
Inherited from XmlReader
Reads the current element and returns the contents as a 64-bit signed integer.
Returns The element content as a 64-bit signed integer.
public long
ReadElementContentAsLong​(string localName, string namespaceURI)
Inherited from XmlReader
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.
Returns The element content as a 64-bit signed integer.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public object
ReadElementContentAsObject​()
Inherited from XmlReader
Reads the current element and returns the contents as an <see cref="T:System.Object" /> .
Returns A boxed common language runtime (CLR) object of the most appropriate type. The <see cref="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.
public object
ReadElementContentAsObject​(string localName, string namespaceURI)
Inherited from XmlReader
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 <see cref="T:System.Object" /> .
Returns A boxed common language runtime (CLR) object of the most appropriate type. The <see cref="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.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public Threading.​Tasks.​Task<​object>
ReadElementContentAsObjectAsync​()
Inherited from XmlReader
Asynchronously reads the current element and returns the contents as an <see cref="T:System.Object" /> .
Returns A boxed common language runtime (CLR) object of the most appropriate type. The <see cref="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.
public string
ReadElementContentAsString​()
Inherited from XmlReader
Reads the current element and returns the contents as a <see cref="T:System.String" /> object.
Returns The element content as a <see cref="T:System.String" /> object.
public string
ReadElementContentAsString​(string localName, string namespaceURI)
Inherited from XmlReader
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 <see cref="T:System.String" /> object.
Returns The element content as a <see cref="T:System.String" /> object.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public Threading.​Tasks.​Task<​string>
ReadElementContentAsStringAsync​()
Inherited from XmlReader
Asynchronously reads the current element and returns the contents as a <see cref="T:System.String" /> object.
Returns The element content as a <see cref="T:System.String" /> object.
public string
ReadElementString​()
Inherited from XmlReader
Reads a text-only element. However, we recommend that you use the <see cref="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.
public string
ReadElementString​(string name)
Inherited from XmlReader
Checks that the <see cref="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 <see cref="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.
name The name to check.
public string
ReadElementString​(string localname, string ns)
Inherited from XmlReader
Checks that the <see cref="P:System.Xml.XmlReader.LocalName" /> and <see cref="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 <see cref="M:System.Xml.XmlReader.ReadElementContentAsString(System.String,System.String)" /> 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.
localname The local name to check.
ns The namespace URI to check.
public void
ReadEndElement​()
Inherited from XmlReader
Checks that the current content node is an end tag and advances the reader to the next node.
public string
ReadInnerXml​()
Inherited from XmlReader
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.
public Threading.​Tasks.​Task<​string>
ReadInnerXmlAsync​()
Inherited from XmlReader
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.
public string
ReadOuterXml​()
Inherited from XmlReader
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.
public Threading.​Tasks.​Task<​string>
ReadOuterXmlAsync​()
Inherited from XmlReader
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.
public void
ReadStartElement​()
Inherited from XmlReader
Checks that the current node is an element and advances the reader to the next node.
public void
ReadStartElement​(string name)
Inherited from XmlReader
Checks that the current content node is an element with the given <see cref="P:System.Xml.XmlReader.Name" /> and advances the reader to the next node.
name The qualified name of the element.
public void
ReadStartElement​(string localname, string ns)
Inherited from XmlReader
Checks that the current content node is an element with the given <see cref="P:System.Xml.XmlReader.LocalName" /> and <see cref="P:System.Xml.XmlReader.NamespaceURI" /> and advances the reader to the next node.
localname The local name of the element.
ns The namespace URI of the element.
public XmlReader
ReadSubtree​()
Inherited from XmlReader
Returns a new <see langword="XmlReader" /> instance that can be used to read the current node, and all its descendants.
Returns A new XML reader instance set to <see cref="F:System.Xml.ReadState.Initial" /> . Calling the <see cref="M:System.Xml.XmlReader.Read" /> method positions the new reader on the node that was current before the call to the <see cref="M:System.Xml.XmlReader.ReadSubtree" /> method.
public bool
ReadToDescendant​(string name)
Inherited from XmlReader
Advances the <see cref="T:System.Xml.XmlReader" /> to the next descendant element with the specified qualified name.
Returns <see langword="true" /> if a matching descendant element is found; otherwise <see langword="false" /> . If a matching descendant element is not found, the <see cref="T:System.Xml.XmlReader" /> is positioned on the end tag ( <see cref="P:System.Xml.XmlReader.NodeType" /> is <see langword="XmlNodeType.EndElement" /> ) of the element. If the <see cref="T:System.Xml.XmlReader" /> is not positioned on an element when <see cref="M:System.Xml.XmlReader.ReadToDescendant(System.String)" /> was called, this method returns <see langword="false" /> and the position of the <see cref="T:System.Xml.XmlReader" /> is not changed.
name The qualified name of the element you wish to move to.
public bool
ReadToDescendant​(string localName, string namespaceURI)
Inherited from XmlReader
Advances the <see cref="T:System.Xml.XmlReader" /> to the next descendant element with the specified local name and namespace URI.
Returns <see langword="true" /> if a matching descendant element is found; otherwise <see langword="false" /> . If a matching descendant element is not found, the <see cref="T:System.Xml.XmlReader" /> is positioned on the end tag ( <see cref="P:System.Xml.XmlReader.NodeType" /> is <see langword="XmlNodeType.EndElement" /> ) of the element. If the <see cref="T:System.Xml.XmlReader" /> is not positioned on an element when <see cref="M:System.Xml.XmlReader.ReadToDescendant(System.String,System.String)" /> was called, this method returns <see langword="false" /> and the position of the <see cref="T:System.Xml.XmlReader" /> is not changed.
localName The local name of the element you wish to move to.
namespaceURI The namespace URI of the element you wish to move to.
public bool
ReadToFollowing​(string name)
Inherited from XmlReader
Reads until an element with the specified qualified name is found.
Returns <see langword="true" /> if a matching element is found; otherwise <see langword="false" /> and the <see cref="T:System.Xml.XmlReader" /> is in an end of file state.
name The qualified name of the element.
public bool
ReadToFollowing​(string localName, string namespaceURI)
Inherited from XmlReader
Reads until an element with the specified local name and namespace URI is found.
Returns <see langword="true" /> if a matching element is found; otherwise <see langword="false" /> and the <see cref="T:System.Xml.XmlReader" /> is in an end of file state.
localName The local name of the element.
namespaceURI The namespace URI of the element.
public bool
ReadToNextSibling​(string name)
Inherited from XmlReader
Advances the <see langword="XmlReader" /> to the next sibling element with the specified qualified name.
Returns <see langword="true" /> if a matching sibling element is found; otherwise <see langword="false" /> . If a matching sibling element is not found, the <see langword="XmlReader" /> is positioned on the end tag ( <see cref="P:System.Xml.XmlReader.NodeType" /> is <see langword="XmlNodeType.EndElement" /> ) of the parent element.
name The qualified name of the sibling element you wish to move to.
public bool
ReadToNextSibling​(string localName, string namespaceURI)
Inherited from XmlReader
Advances the <see langword="XmlReader" /> to the next sibling element with the specified local name and namespace URI.
Returns <see langword="true" /> if a matching sibling element is found; otherwise, <see langword="false" /> . If a matching sibling element is not found, the <see langword="XmlReader" /> is positioned on the end tag ( <see cref="P:System.Xml.XmlReader.NodeType" /> is <see langword="XmlNodeType.EndElement" /> ) of the parent element.
localName The local name of the sibling element you wish to move to.
namespaceURI The namespace URI of the sibling element you wish to move to.
public int
ReadValueChunk​(char[] buffer, int index, int count)
Inherited from XmlReader
Reads large streams of text embedded in an XML document.
Returns The number of characters read into the buffer. The value zero is returned when there is no more text content.
buffer The array of characters that serves as the buffer to which the text contents are written. This value cannot be <see langword="null" /> .
index The offset within the buffer where the <see cref="T:System.Xml.XmlReader" /> can start to copy the results.
count The maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method.
ReadValueChunkAsync​(char[] buffer, int index, int count)
Inherited from XmlReader
Asynchronously reads large streams of text embedded in an XML document.
Returns The number of characters read into the buffer. The value zero is returned when there is no more text content.
buffer The array of characters that serves as the buffer to which the text contents are written. This value cannot be <see langword="null" /> .
index The offset within the buffer where the <see cref="T:System.Xml.XmlReader" /> can start to copy the results.
count The maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method.
SkipAsync​()
Inherited from XmlReader
Asynchronously skips the children of the current node.
Returns The current node.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object