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.LocalName and XmlReader.NamespaceURI properties of the element found match the given strings.

Syntax

public virtual bool IsStartElement (string localname, string ns)

Parameters

localname
The string to match against the LocalName property of the element found.
ns
The string to match against the NamespaceURI property of the element found.

Returns

true if the resulting node is an element. false if a node type other than XmlNodeType.Element was found or if the LocalName and NamespaceURI properties of the element do not match the specified strings.

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