This documentation is archived and is not being maintained.

XmlReader.IsEmptyElement Property

When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, <MyElement/>).

[Visual Basic]
Public MustOverride ReadOnly Property IsEmptyElement As Boolean
public abstract bool IsEmptyElement {get;}
public: __property virtual bool get_IsEmptyElement() = 0;
public abstract function get IsEmptyElement() : Boolean;

Property Value

true if the current node is an element (NodeType equals XmlNodeType.Element) that ends with />; otherwise, false.


This property enables you to determine the difference between the following:

<item num="123"/> (IsEmptyElement is true).

<item num="123"> (IsEmptyElement is false).

A corresponding EndElement node is not generated for empty elements.


See XmlTextReader.IsEmptyElement for an example using this property.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlReader Class | XmlReader Members | System.Xml Namespace