Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads the simple text-only elements. However, we recommend that you use the ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.
ReadElementString() |
Reads a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation. |
ReadElementString(String) |
Checks that the Name property of the element found matches the given string before reading a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation. |
ReadElementString(String, String) |
Checks that the LocalName and NamespaceURI properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the ReadElementContentAsString(String, String) method instead, because it provides a more straightforward way to handle this operation. |
We recommend that you use the ReadElementContentAsString method to read a text element.
Reads a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation.
public:
virtual System::String ^ ReadElementString();
public virtual string ReadElementString();
abstract member ReadElementString : unit -> string
override this.ReadElementString : unit -> string
Public Overridable Function ReadElementString () As String
The text contained in the element that was read. An empty string if the element is empty.
The next content node is not a start tag; or the element found does not contain a simple text value.
An XmlReader method was called before a previous asynchronous operation finished. In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."
We recommend that you use the ReadElementContentAsString() method to read a text element.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Checks that the Name property of the element found matches the given string before reading a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation.
public:
virtual System::String ^ ReadElementString(System::String ^ name);
public virtual string ReadElementString(string name);
abstract member ReadElementString : string -> string
override this.ReadElementString : string -> string
Public Overridable Function ReadElementString (name As String) As String
The name to check.
The text contained in the element that was read. An empty string if the element is empty.
If 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.
An XmlReader method was called before a previous asynchronous operation finished. In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."
We recommend that you use the ReadElementContentAsString() method to read a text element.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Checks that the LocalName and NamespaceURI properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the ReadElementContentAsString(String, String) method instead, because it provides a more straightforward way to handle this operation.
public:
virtual System::String ^ ReadElementString(System::String ^ localname, System::String ^ ns);
public virtual string ReadElementString(string localname, string ns);
abstract member ReadElementString : string * string -> string
override this.ReadElementString : string * string -> string
Public Overridable Function ReadElementString (localname As String, ns As String) As String
The local name to check.
The namespace URI to check.
The text contained in the element that was read. An empty string if the element is empty.
If 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.
An XmlReader method was called before a previous asynchronous operation finished. In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."
We recommend that you use the ReadElementContentAsString(String, String) method to read a text element.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in