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

Accessing an Element's Attributes

In most cases, navigating an XmlDocument node tree involves moving through parent-child relationships, except when you are accessing an element's attributes. The element-attribute relationship is a container-contained relationship. Since the XmlNode is an abstract class that represents the common functionality of all XML nodes, it provides only minimal functionality for accessing attribute information. Since attributes are most meaningful on XML elements, the XmlElement class provides a richer API for retrieving attribute information. In this section we will investigate the methods available on both classes.

The XmlNode class exposes the Attributes property to access its attributes. The Attributes property returns ...

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