NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlReader.IsStartTag (String)

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;

Parameters

name
The name of the start tag for which to test.

Return Value

true if the resulting node is a start tag with the given name, false otherwise.

Exceptions

Exception Type Condition
XmlException If incorrect XML is encountered in the input stream.

Remarks

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.

See Also

XmlReader Class | XmlReader Members | System.Xml Namespace | XmlReader.IsStartTag Overload List | IsStartTag | IsStartTag | IsStartTag | CheckStartTag | MoveToContent