System.Xml.XmlReader.IsStartElement Method

Calls XmlReader.MoveToContent and tests if the current content node is a start tag or empty element tag and if the XmlReader.Name property of the element found matches the given argument.

Syntax

public virtual bool IsStartElement (string name)

Parameters

name
The string matched against the Name property of the element found.

Returns

true if the resulting node is an element and the Name property matches the specified string. false if a node type other than XmlNodeType.Element was found or if the element Name property does not match the specified string.

Exceptions

TypeReason
System.Xml.XmlExceptionAn error occurred while parsing the XML.

Remarks

This method skips white space, comments, and processing instructions until the reader is positioned on a content node. The method then tests if the current node is an element.

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