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 until the named element is found.
ReadToFollowing(String) |
Reads until an element with the specified qualified name is found. |
ReadToFollowing(String, String) |
Reads until an element with the specified local name and namespace URI is found. |
Reads until an element with the specified qualified name is found.
public:
virtual bool ReadToFollowing(System::String ^ name);
public virtual bool ReadToFollowing(string name);
abstract member ReadToFollowing : string -> bool
override this.ReadToFollowing : string -> bool
Public Overridable Function ReadToFollowing (name As String) As Boolean
The qualified name of the element.
true
if a matching element is found; otherwise false
and the XmlReader is in an end of file state.
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."
The parameter is an empty string.
This method is functionally equivalent executing the following::name
XPath expression from the current node. It provides a quick way to find a named element in the XML document. It advances the reader to the next following element that matches the specified name and returns true
if a matching element is found. Using the example below, the reader would read to the first instance of the specified element while reading forward.
<!--"sample.xml"-->
<?xml version="1.0">
<items>
<item xmls="urn:1"/>
</items>
</xml>
XmlTextReader reader = newXmlTextReader("sample.xml");
reader.ReadToFollowing("item");
This method can be called on all node types.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 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 | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Reads until an element with the specified local name and namespace URI is found.
public:
virtual bool ReadToFollowing(System::String ^ localName, System::String ^ namespaceURI);
public virtual bool ReadToFollowing(string localName, string namespaceURI);
abstract member ReadToFollowing : string * string -> bool
override this.ReadToFollowing : string * string -> bool
Public Overridable Function ReadToFollowing (localName As String, namespaceURI As String) As Boolean
The local name of the element.
The namespace URI of the element.
true
if a matching element is found; otherwise false
and the XmlReader is in an end of file state.
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."
Both parameter values are null
.
This method is functionally equivalent executing the following::name
XPath expression from the current node. It provides a quick way to find a named element in the XML document. It advances the reader to the next following element that matches the specified name and returns true
if a matching element is found.
<!--"sample.xml"-->
<?xml version="1.0">
<items>
<item xmls="urn:1"/>
</items>
</xml>
XmlTextReader reader = newXmlTextReader("sample.xml");
reader.ReadToFollowing("item", "urn:1");
This method can be called on all node types.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 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 | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in