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
[C#]
public abstract bool IsEmptyElement {get;}
[C++]
public: __property virtual bool get_IsEmptyElement() = 0;
[JScript]
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.

Remarks

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.

Example

See XmlTextReader.IsEmptyElement for an example using this property.

Requirements

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

Show: