Microsoft XML 2.5 SDK


 

IXMLDOMDocument::put_preserveWhiteSpace Method

[This is preliminary documentation and subject to change.]

Sets the value of the preserveWhiteSpace property.

Visual Basic Syntax

objXMLDOMDocument.preserveWhiteSpace = boolValue

C/C++ Syntax

HRESULT put_preserveWhiteSpace(

    VARIANT_BOOL isPreserving);

Parameters

isPreserving

[in]
Value that indicates whether default processing preserves white space.

C/C++ Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

This property is initialized to false.

The preserveWhiteSpace property specifies the default white space handling when xml:space is set to "default." When preserveWhiteSpace is true, all white space is preserved, regardless of the xml:space settings in the document. When preserveWhiteSpace is false, the values of the xml:space attribute specified in the document determine whether white space is preserved or not.

The xml property does not preserve white space exactly as it appeared in the original document. Instead, the object model replaces white space present in the original document with a single newline character in the representation returned by the xml property. Similarly, the text property contains a representation without the leading and trailing spaces and replaces multiple intervening white space characters between words with a single space character.

The text and xml properties preserve white space when the user has set the preserveWhiteSpace property to true and when xml:space on the XML element has the value preserve.

See Also

White space handling