Using the XmlTextReader's Namespaces Property

The Namespaces property provides read and write access to a value indicating whether the reader does namespace support. This property is set to true by default, which means that namespaces are supported. If namespace support is turned off, namespace prefixes are not resolved to their respective namespace URIs. Instead, the prefix and local name are considered the local name of the element. This property can be changed only before any read operation has been executed. This means that the XmlTextReader's ReadState property must equal ReadState.Initial. An InvalidOperationException is thrown if the reader is in any other state. Listing 10.4 shows the difference between a namespace-enabled reader and ...

Get Microsoft® .NET Compact Framework Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.