Xmlvalidatingreader sample code
This intuitive, self-paced learning system makes it easy for developers to teach themselves how to draw on all the power of Microsoft Visual C , and to see how Visual C compares with other popular development languages. NET Framework provides full support for just about everything you'll need to do with XML.Developers learn C by following step-by-step instructions with numerous high-quality code examplesall created specifically for this book. NOTE This chapter assumes that you already know something about XML: You should be comfortable with elements, attributes, validation, namespaces, and all the other paraphernalia that surrounds XML.
The second consequence is slightly more subtle: elements are read and presented to you one by one, with no context.For example, elements have names and can have values, while comments have a value (the comment text) but don't have names.Processing instructions normally have both names and values.Every time a new node is read, the switch statement checks its type against members of the Xml Node Type enumeration.I haven't included the cases for every possible node type, but only those that occur in the sample document.
Search for xmlvalidatingreader sample code:
Note that Xml Text Reader isn't limited to reading from files.