Tests if the current content node is a start tag with a given name.
[Visual Basic] Overloads Public Function IsStartTag( _ ByVal name As String _ ) As Boolean [C#] public bool IsStartTag( string name ); [C++] public: bool IsStartTag( String* name ); [JScript] public function IsStartTag( name : String ) : Boolean;
true if the resulting node is a start tag with the given name, false otherwise.
Exception Type | Condition |
---|---|
XmlException | If incorrect XML is encountered in the input stream. |
This method skips whitespace, comments, and processing instructions until the reader is positioned on a content node. The method then tests if the current node is a start tag with the given name and the same namespace URI as the enclosing element.
Given the input:
the IsStartTag test in the following code succeeds because the
reader.ReadStartTag("order", "urn:acme.order");
if (reader.IsStartTag("item")) ProcessItem();
When multiple calls are made to this method with the same argument, it is more efficient to obtain an
XmlIdent once and then repeatedly call the IsStartTag method for that identifier.
XmlReader Class | XmlReader Members | System.Xml Namespace | XmlReader.IsStartTag Overload List | IsStartTag | IsStartTag | IsStartTag | CheckStartTag | MoveToContent