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.Read

Advances the reader to the next node.

[Visual Basic]
MustOverride Public Function Read() As Boolean
[C#]
public abstract bool Read();
[C++]
public: virtual bool Read() = 0;
[JScript]
public abstract function Read() : Boolean;

Return Value

false if the resulting node is the end of the input stream, true otherwise.

Exceptions

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

Remarks

The reader is advanced to the next node and the NodeType, ID, and Text properties are updated to reflect the next node in the input stream. The method returns false if the resulting node is the end of the input stream. Otherwise the method returns true.

An XmlException is thrown if incorrect XML is encountered in the input stream. This might for example occur if a tag name contains an invalid character or if the name of an end tag does not match the name of the corresponding start tag.

Unlike the ReadNode method, when the reader is positioned on a start tag, the Read method does not consume all nodes between that tag and the corresponding end tag. Instead, the Read method reports start and end tags (and the content between them) as individual nodes, and when the reader is positioned on the start tag of an element, a call to Read moves the reader to the first node contained in the element (or to the end tag of the element if the element has no content).

Example

The following example extracts the values of all



See Also

XmlReader Class | XmlReader Members | System.Xml Namespace | ReadNode | ReadString