System.Xml.XmlReader.ReadEndElement Method

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

Syntax

public virtual void ReadEndElement ()

Exceptions

TypeReason
System.Xml.XmlExceptionThe node is not an EndElement node or an error occurred while parsing the XML.

Remarks

Operation
As described above.

This method calls the XmlReader.MoveToContent method, which determines whether the current node can contain content and, if not, moves the reader to the next content node or the end of the input stream. The node the reader ends up positioned on is checked to determine if it is an EndElement node. If so, the node is read and the reader is moved to the next node.

Note to Inheritors
Override this method to customize the behavior of this method in types derived from the System.Xml.XmlReader class.

Usage
Use this method to read an EndElement node and advance the reader to the next node.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0