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.CheckStartTag (String)

Checks that the current content node is a start tag with a given name.

[Visual Basic]
Overloads Public Sub CheckStartTag( _
   ByVal name As String _
)
[C#]
public void CheckStartTag(
   string name
);
[C++]
public: void CheckStartTag(
   String* name
);
[JScript]
public function CheckStartTag(
   name : String
);

Parameters

name
The required name for the start tag.

Exceptions

Exception Type Condition
XmlException If incorrect XML is encountered in the input stream or if the resulting node is not a start tag with the given name and the same namespace URI as the enclosing element.

Remarks

This method skips whitespace, comments, and processing instructions until the reader is positioned on a content node. The method then checks that the current node is a start tag with the given name and the same namespace URI as the enclosing element. If the check is unsuccessful, an exception is thrown.

Given the input:



the call to CheckStartTag in the following code succeeds because the

reader.ReadStartTag("order", "urn:acme.order");
  reader.CheckStartTag("item");

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 CheckStartTag method for that identifier.

See Also

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