System.Xml.XmlTextReader.WhitespaceHandling Property

Gets or sets a value that specifies how white space is handled.

Syntax

public WhitespaceHandling WhitespaceHandling { get; set; }

Value

One of the members of the System.Xml.WhitespaceHandling enumeration. The default is WhitespaceHandling.All (returns both significant and insignificant white space).

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe value to be set is not one of the members of the System.Xml.WhitespaceHandling enumeration.
InvalidOperationExceptionWhen setting the property, the XmlTextReader.ReadState is ReadState.Closed.

Remarks

Note:

In the dnprdnext release, the recommended practice is to create System.Xml.XmlReader instances using the erload:System.Xml.XmlReader.Create method. This allows you to take full advantage of the new features introduced in this release. For more information, see Creating XML Readers.

This property can be changed at any time and takes effect on the next read operation.

Because the XmlTextReader does not have DTD information available to it, SignificantWhitepsace nodes are only returned within an xml:space='preserve' scope.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0