O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading XML Nodes

As you traverse the XML stream, the XmlTextReader will be a pointer to each node that is encountered. Once the XmlTextReader points at a valid node, there are four pieces of vital information that you can query for: Node Name, Node Namespace, Node Value, and Node Attributes. The XmlTextReader has accessors for each of these properties, but not all of them are applicable to every node type. The node value and node attributes properties are directly dependent on the type of the current node.

The node value property depends directly on the node type. Table 10.2 shows which node types have a value and the actual value that is returned for each. If the node type is not in the list, String.Empty is returned.

Table 10.2. XML Nodes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required