Property Settings on XmlReader
The XmlReader class has properties that can be modified while reading, and other properties that, if changed after the reading has begun, do not have the new setting affect the reading. These properties need to be set to their correct value before initiating the reading if the default values are not appropriate. However, some properties can be modified after the reading has started. For properties that cannot be set after calling Read the readers throw an exception. The table below shows what properties can be modified once reading has begun.
Class | Property | Can be modified |
---|---|---|
XmlTextReader | Namespaces | no |
XmlTextReader | WhitespaceHandling | yes |
XmlTextReader | Normalization | yes |
XmlTextReader | XmlResolver | yes |
XmlValidatingReader | Namespaces | no |
XmlValidatingReader | EntityHandling | yes |
XmlValidatingReader | XmlResolver | yes |
XmlValidatingReader | ValidationType | no |
The XmlValidatingReader propagates the XmlResolver property to the contained XmlTextReader class. The XmlNodeReader class has no properties that can be set.
See Also
Reading XML with the XmlReader | Current Node Position in XmlReader | Object Comparison Using XmlNameTable with XmlReader | Reading Attributes with XmlReader | Reading Element and Attributes Content | Skipping Content with XmlReader | EntityReference Reading and Expansion | Comparing XmlReader to SAX Reader | Reading XML Data with XmlTextReader | Reading Node Trees with XmlNodeReader | Validating XML with XmlValidatingReader | Customized XML Reader Creation | XmlReader Class | XmlReader Members | XmlNodeReader Class | XmlNodeReader Members | XmlTextReader Class | XmlTextReader Members | XmlValidatingReader Class | XmlValidatingReader