Mono Class Library: System.Xml.XmlDocument Overview | Members

System.Xml.XmlDocument.PreserveWhitespace Property

Gets or sets a flag that indicates whether this document preserves whitespace nodes on loading content. [Edit]

public bool PreserveWhitespace { set; get; }

Value

A boolean value that indicates whether this document preserves whitespacenodes when it loads the document content. [Edit]

Remarks

When loading XML content to this document via such methods like XmlDocument.Load or XmlDocument.LoadXml, this property is used to indicate whether it preserves such nodes whose XmlReader.NodeType is XmlNodeType.Whitespace or not. If this property is true, then those whitespace nodes are loaded as System.Xml.XmlWhitespace nodes. If false, then they are discarded.

Whitespace node in XML is such a node whose character data consists only of 	 
 
 and  .

The default value is false.

This flag does not indicate to ignore significant whitespaces (those whitespace nodes that are descendant of such element that has such "xml:space" attribute whose value is "preserve"), i.e. it does not discard those nodes whose XmlReader.NodeType is XmlNodeType.SignificantWhitespace. Also, it does not indicate to ignore such text or CDATA section nodes whose character data consist of only whitespace characters.

Note that there is no corresponding interface member in any of W3C Document Object Model specifications.

[Edit]

Requirements

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